From 28f7f79fea91e8af27bd8fd3a454ad1d0199e3c7 Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Fri, 20 Apr 2018 14:23:58 -0700 Subject: [PATCH] Improve monitor function Signed-off-by: Joffrey F --- script/release/release.py | 13 +++++++++---- script/release/release/downloader.py | 4 ++-- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/script/release/release.py b/script/release/release.py index c1908f94a..338e73af2 100755 --- a/script/release/release.py +++ b/script/release/release.py @@ -66,24 +66,29 @@ def monitor_pr_status(pr_data): last_commit = pr_data.get_commits().reversed[0] while True: status = last_commit.get_combined_status() - if status.state == 'pending': + if status.state == 'pending' or status.state == 'failure': summary = { 'pending': 0, 'success': 0, 'failure': 0, } for detail in status.statuses: + if detail.context == 'dco-signed': + # dco-signed check breaks on merge remote-tracking ; ignore it + 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: + return True + elif summary['failure'] > 0: + raise ScriptError('CI failures detected!') time.sleep(30) elif status.state == 'success': print('{} successes: all clear!'.format(status.total_count)) return True - else: - raise ScriptError('CI failure detected') def check_pr_mergeable(pr_data): @@ -159,7 +164,7 @@ def resume(args): delete_assets(gh_release) upload_assets(gh_release, files) img_manager = ImageManager(args.release) - img_manager.build_images(repository, files, args.release) + img_manager.build_images(repository, files) except ScriptError as e: print(e) return 1 diff --git a/script/release/release/downloader.py b/script/release/release/downloader.py index cd43bc993..d92ae78b5 100644 --- a/script/release/release/downloader.py +++ b/script/release/release/downloader.py @@ -36,7 +36,7 @@ class BinaryDownloader(requests.Session): base=self.base_appveyor_url, filename=filename, branch_name=branch_name ) full_dest = os.path.join(REPO_ROOT, self.destination, filename) - return self.download(url, full_dest) + return self._download(url, full_dest) def _download(self, url, full_dest): m = hashlib.sha256() @@ -57,7 +57,7 @@ class BinaryDownloader(requests.Session): files = { 'docker-compose-Darwin-x86_64': None, 'docker-compose-Linux-x86_64': None, - # 'docker-compose-Windows-x86_64.exe': None, + 'docker-compose-Windows-x86_64.exe': None, } for filename in files.keys():