Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions scripts/gha/report_build_status.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,20 +443,25 @@ def main(argv):

packaging_run = 0

logs_url = run['logs_url']
headers = {'Accept': 'application/vnd.github.v3+json', 'Authorization': 'Bearer %s' % FLAGS.token}
with requests.get(logs_url, headers=headers, stream=True) as response:
if response.status_code == 200:
logs_compressed_data = io.BytesIO(response.content)
logs_zip = zipfile.ZipFile(logs_compressed_data)
m = get_message_from_github_log(
logs_zip,
r'check_and_prepare\.txt',
r'\[warning\]Downloading SDK package from previous run:[^\n]*/([0-9]*)$')
if m:
packaging_run = m.group(1)
if str(packaging_run) in packaging_run_ids:
package_tests[day] = run
# Because of the retry logic, there can be multiple attempts.
# The default log location however only include the last attempt.
# Thus, we iterate over the attempts to look for the check_and_prepare file
for attempt in range(run['run_attempt']):
logs_url = run['url'] + '/attempts/%d/logs' % (attempt + 1)
headers = {'Accept': 'application/vnd.github.v3+json', 'Authorization': 'Bearer %s' % FLAGS.token}
with requests.get(logs_url, headers=headers, stream=True) as response:
if response.status_code == 200:
logs_compressed_data = io.BytesIO(response.content)
logs_zip = zipfile.ZipFile(logs_compressed_data)
m = get_message_from_github_log(
logs_zip,
r'check_and_prepare\.txt',
r'\[warning\]Downloading SDK package from previous run:[^\n]*/([0-9]*)$')
if m:
packaging_run = m.group(1)
if str(packaging_run) in packaging_run_ids:
package_tests[day] = run
break
bar.next()

logging.info("Package tests: %s %s", list(package_tests.keys()), [package_tests[r]['id'] for r in package_tests.keys()])
Expand Down
Loading