@@ -196,15 +196,16 @@ class GithubStatus():
196
196
target_url : str
197
197
created_at : datetime
198
198
nwo : str
199
- job_id : int = None
199
+ job_ids : set = None
200
200
201
201
202
202
def get_log_content (status : GithubStatus ) -> str :
203
203
LOGGER .debug (f"'{ status .context } ': Getting logs" )
204
- if status .job_id :
205
- content = subprocess .check_output (
206
- ["gh" , "api" , f"/repos/{ status .nwo } /actions/jobs/{ status .job_id } /logs" ],
207
- ).decode ("utf-8" )
204
+ if status .job_ids :
205
+ contents = [subprocess .check_output (
206
+ ["gh" , "api" , f"/repos/{ status .nwo } /actions/jobs/{ job_id } /logs" ],
207
+ ).decode ("utf-8" ) for job_id in status .job_ids ]
208
+ content = "\n " .join (contents )
208
209
else :
209
210
m = re .fullmatch (r"^https://github\.com/([^/]+/[^/]+)/actions/runs/(\d+)(?:/jobs/(\d+))?$" , status .target_url )
210
211
nwo = m .group (1 )
@@ -301,8 +302,10 @@ def main(pr_number: Optional[int], sha_override: Optional[str] = None, force=Fal
301
302
api_name : str = job ["name" ]
302
303
303
304
if api_name .lower ().startswith (expected_workflow_name .lower ()):
304
- lang_test_failure .job_id = job ["id" ]
305
- break
305
+ if lang_test_failure .job_ids is None :
306
+ lang_test_failure .job_ids = set ()
307
+ lang_test_failure .job_ids .add (job ["id" ])
308
+ continue
306
309
307
310
if " / " not in api_name :
308
311
continue
@@ -311,11 +314,11 @@ def main(pr_number: Optional[int], sha_override: Optional[str] = None, force=Fal
311
314
# The job names we're looking for looks like "Python2 Language Tests / Python2 Language Tests" or "Java Language Tests / Java Language Tests Linux"
312
315
# for "Java Integration Tests Linux / Java Integration tests Linux" we need to ignore case :|
313
316
if workflow_name == expected_workflow_name and job_name .lower ().startswith (lang_test_failure .context .lower ()):
314
- lang_test_failure .job_id = job ["id" ]
315
- break
317
+ lang_test_failure .job_ids . add ( job ["id" ])
318
+ continue
316
319
317
320
for lang_test_failure in lang_test_failures :
318
- if lang_test_failure .job_id is None :
321
+ if lang_test_failure .job_ids is None :
319
322
LOGGER .error (f"Could not find job for { lang_test_failure .context !r} " )
320
323
sys .exit (1 )
321
324
@@ -370,7 +373,7 @@ def ok_job_name(job_name: str) -> bool:
370
373
target_url = job ["html_url" ],
371
374
created_at = check_run ["completed_at" ],
372
375
nwo = nwo ,
373
- job_id = job ["id" ],
376
+ job_ids = { job ["id" ]} ,
374
377
))
375
378
break
376
379
else :
0 commit comments