-
Notifications
You must be signed in to change notification settings - Fork 2.5k
feat(ci): Add public log URLs to build failure reports #14154
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
d40c92f
83de133
2449f3c
04b5b46
4e97b32
0809195
3d9eabb
09bd2c2
82fdb6d
42c456f
a1af255
04dad19
8bd3e3d
614f62a
3ba8379
21152aa
eb6d199
7696bc8
02d49bd
605c7e3
26a982e
36f2912
2cea774
aba1f11
54f117f
0953c7d
712cfcc
0fe1384
582bef4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -364,8 +364,10 @@ def _do_test_builds(args, test_image_suffix, end_time, version_tag): | |
| for build_id, build_type in project_builds: | ||
| logging.info(' - Build ID: %s', build_id) | ||
| logging.info(' - Build Type: %s', build_type) | ||
| logging.info(' GCB URL: %s', | ||
| build_lib.get_gcb_url(build_id, build_lib.IMAGE_PROJECT)) | ||
| gcb_url = build_lib.get_gcb_url(build_id, build_lib.IMAGE_PROJECT) | ||
| log_url = f'https://oss-fuzz-gcb-logs.storage.googleapis.com/log-{build_id}.txt' | ||
| logging.info(' GCB URL: %s', gcb_url) | ||
| logging.info(' Log URL: %s', log_url) | ||
| logging.info('-----------------------') | ||
|
|
||
| wait_result = wait_on_builds(build_ids, credentials, build_lib.IMAGE_PROJECT, | ||
|
|
@@ -544,8 +546,11 @@ def wait_on_builds(build_ids, credentials, cloud_project, end_time, | |
| if status == 'SUCCESS': | ||
| successful_builds[project].append(build_id) | ||
| else: | ||
| logs_url = build_lib.get_gcb_url(build_id, cloud_project) | ||
| failed_builds[project].append((status, logs_url, build_type)) | ||
| gcb_url = build_lib.get_gcb_url(build_id, cloud_project) | ||
| log_url = (f'https://oss-fuzz-gcb-logs.storage.googleapis.com/' | ||
| f'log-{build_id}.txt') | ||
| failed_builds[project].append( | ||
| (status, gcb_url, build_type, log_url)) | ||
|
|
||
| wait_builds[project].remove((build_id, build_type)) | ||
| if not wait_builds[project]: | ||
|
|
@@ -558,8 +563,10 @@ def wait_on_builds(build_ids, credentials, cloud_project, end_time, | |
|
|
||
| finished_builds_count += 1 | ||
| status = 'UNKNOWN (too many HttpErrors)' | ||
| logs_url = build_lib.get_gcb_url(build_id, cloud_project) | ||
| failed_builds[project].append((status, logs_url, build_type)) | ||
| gcb_url = build_lib.get_gcb_url(build_id, cloud_project) | ||
| log_url = (f'https://oss-fuzz-gcb-logs.storage.googleapis.com/' | ||
|
||
| f'log-{build_id}.txt') | ||
| failed_builds[project].append((status, gcb_url, build_type, log_url)) | ||
| wait_builds[project].remove((build_id, build_type)) | ||
| if not wait_builds[project]: | ||
| del wait_builds[project] | ||
|
|
@@ -584,9 +591,11 @@ def wait_on_builds(build_ids, credentials, cloud_project, end_time, | |
| if wait_builds: | ||
| for project, project_builds in list(wait_builds.items()): | ||
| for build_id, build_type in project_builds: | ||
| logs_url = build_lib.get_gcb_url(build_id, cloud_project) | ||
| gcb_url = build_lib.get_gcb_url(build_id, cloud_project) | ||
| log_url = (f'https://oss-fuzz-gcb-logs.storage.googleapis.com/' | ||
|
||
| f'log-{build_id}.txt') | ||
| failed_builds[project].append( | ||
| ('TIMEOUT (Coordinator)', logs_url, build_type)) | ||
| ('TIMEOUT (Coordinator)', gcb_url, build_type, log_url)) | ||
|
|
||
| # Final Report | ||
| successful_builds_count = sum( | ||
|
|
@@ -634,12 +643,13 @@ def wait_on_builds(build_ids, credentials, cloud_project, end_time, | |
| logging.error('--- FAILED BUILDS ---') | ||
| for project, failures in sorted(failed_builds.items()): | ||
| logging.error(' - %s:', project) | ||
| for status, gcb_url, build_type in failures: | ||
| for status, gcb_url, build_type, log_url in failures: | ||
| build_id = gcb_url.split('/')[-1].split('?')[0] | ||
| logging.error(' - Build ID: %s', build_id) | ||
| logging.error(' - Build Type: %s', build_type) | ||
| logging.error(' - Status: %s', status) | ||
| logging.error(' - GCB URL: %s', gcb_url) | ||
| logging.error(' - Log URL: %s', log_url) | ||
| logging.info('-----------------------') | ||
| return False | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is repeated many times in this PR. Can you create a common helper in
build_libfor this and use that everywhere?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. I've moved the repeated logging into a common helper function.