]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/script/build-integration-branch
import quincy beta 17.1.0
[ceph.git] / ceph / src / script / build-integration-branch
index e0cf9f4544f6d36c11ed71b41d989bf2045afc34..d92821b2f1f8060f59d53b68d6933c6b4964f21a 100755 (executable)
@@ -89,14 +89,24 @@ r = call(['git', 'branch', '-D', branch])
 r = call(['git', 'checkout', '-b', branch])
 assert not r
 for pr in prs:
-    print('--- pr %d --- pulling %s branch %s' % (
-        pr['number'],
-        pr['head']['repo']['clone_url'],
-        pr['head']['ref']))
-    r = call(['git', 'pull', '--no-edit',
-              pr['head']['repo']['clone_url'],
-              pr['head']['ref']])
-    assert not r
+    pr_number = pr['number']
+    pr_url = pr['head']['repo']['clone_url']
+    pr_ref = pr['head']['ref']
+    print(f'--- pr {pr_number} --- pulling {pr_url} branch {pr_ref}')
+    while True:
+        r = call(['git', 'pull', '--no-ff', '--no-edit', pr_url, pr_ref])
+        if r == 0:
+            break
+        elif r == 1:
+            print(f'Unable to access {pr_url}, retrying..')
+        elif r == 128:
+            message = f'Unable to resolve conflict when merging PR#{pr_number}'
+            raise Exception(message)
+        else:
+            message = ('Exiting due to an unknown failure when pulling '
+                       f'PR#{pr_number}')
+            raise Exception(message)
+
 print('--- done. these PRs were included:')
 print('\n'.join(prtext).encode('ascii', errors='ignore').decode())
-print('--- perhaps you want to: make && ctest -j12 && git push ci %s' % branch)
+print('--- perhaps you want to: ./run-make-check.sh && git push ci %s' % branch)