diff options
Diffstat (limited to 'script/release/release.py')
-rwxr-xr-x | script/release/release.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/script/release/release.py b/script/release/release.py index add8fb2d..4357e36b 100755 --- a/script/release/release.py +++ b/script/release/release.py @@ -78,10 +78,9 @@ def monitor_pr_status(pr_data): continue summary[detail.state] += 1 print('{pending} pending, {success} successes, {failure} failures'.format(**summary)) - if status.total_count == 0: - # Mostly for testing purposes against repos with no CI setup - return True - elif summary['pending'] == 0 and summary['failure'] == 0: + if summary['pending'] == 0 and summary['failure'] == 0 and summary['success'] > 0: + # This check assumes at least 1 non-DCO CI check to avoid race conditions. + # If testing on a repo without CI, use --skip-ci-check to avoid looping eternally return True elif summary['failure'] > 0: raise ScriptError('CI failures detected!') @@ -156,7 +155,8 @@ def resume(args): if not pr_data: pr_data = repository.create_release_pull_request(args.release) check_pr_mergeable(pr_data) - monitor_pr_status(pr_data) + if not args.skip_ci: + monitor_pr_status(pr_data) downloader = BinaryDownloader(args.destination) files = downloader.download_all(args.release) if not gh_release: @@ -195,7 +195,8 @@ def start(args): create_initial_branch(repository, args) pr_data = repository.create_release_pull_request(args.release) check_pr_mergeable(pr_data) - monitor_pr_status(pr_data) + if not args.skip_ci: + monitor_pr_status(pr_data) downloader = BinaryDownloader(args.destination) files = downloader.download_all(args.release) gh_release = create_release_draft(repository, args.release, pr_data, files) @@ -310,6 +311,10 @@ def main(): '--no-cherries', '-C', dest='cherries', action='store_false', help='If set, the program will not prompt the user for PR numbers to cherry-pick' ) + parser.add_argument( + '--skip-ci-checks', dest='skip_ci', action='store_true', + help='If set, the program will not wait for CI jobs to complete' + ) args = parser.parse_args() if args.action == 'start': |