Skip to content

Commit be8a1ba

Browse files
committed
feat(report): Add handling for cases with no build results in final report
1 parent 329554d commit be8a1ba

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

infra/build/functions/build_lib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ def get_signed_url(path, method='PUT', content_type=''):
299299
client_id, signature = _sign_blob(blob)
300300
return (f'https://storage.googleapis.com/{path.netloc}/{blob_path}'
301301
f'?GoogleAccessId={client_id}&Expires={int(time.time() + 3600)}'
302-
f'&Signature={urllib.parse.quote_plus(signature)}')
302+
f'&Signature={urlparse.quote_plus(signature)}')
303303

304304

305305
def _normalized_name(name):

infra/build/functions/report_generator.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def main():
117117
"""Main function to generate report and determine pipeline status."""
118118
all_results = {}
119119
any_failures = False
120+
any_results_found = False
120121

121122
print('Generating final build report...')
122123

@@ -129,9 +130,16 @@ def main():
129130
with open(filename, 'r') as f:
130131
data = json.load(f)
131132
all_results[version] = data
133+
any_results_found = True
132134
if data['failed'] > 0:
133135
any_failures = True
134136

137+
if not any_results_found:
138+
error_lines = ['All build versions failed to produce results.']
139+
_print_box('FINAL BUILD REPORT', error_lines)
140+
print('\nPipeline finished with failures.')
141+
sys.exit(1)
142+
135143
generate_comparison_table(all_results)
136144
generate_final_summary(all_results)
137145

0 commit comments

Comments
 (0)