@@ -166,26 +166,14 @@ def get_commit_depth_and_check_suite(query_commits):
166166 return [None , None ]
167167
168168
169- def append_runs_to_list (runs , bad_runs_by_matrix ):
170- regex_matrix = re .compile ("^build-[^ ]+" )
171- regex_board = re .compile ("\([^ ]+\)$" )
172- for run in runs ["nodes" ]:
173- name = run ["name" ]
174- res_matrix = regex_matrix .search (name )
175- if res_matrix :
176- matrix = res_matrix .group ()
177- if matrix not in bad_runs_by_matrix :
178- bad_runs_by_matrix [matrix ] = []
179- res_board = regex_board .search (name )
180- if res_board :
181- bad_runs_by_matrix [matrix ].append (res_board .group ()[1 :- 1 ])
182-
183-
184169def get_bad_check_runs (query_check_runs ):
185170 more_pages = True
186171 bad_runs_by_matrix = {}
172+
187173 run_types = ["failed" , "incomplete" ]
188174
175+ regex_matrix = re .compile ("^[^\n ]+ \/ (build|run) \([^\n ]+\)$" )
176+
189177 while more_pages :
190178 check_runs = query_check_runs .fetch ()["data" ]["node" ]
191179 more_pages = False
@@ -194,7 +182,17 @@ def get_bad_check_runs(query_check_runs):
194182 run_type_camel = run_type .capitalize () + "Run"
195183 run_type = run_type + "Runs"
196184
197- append_runs_to_list (check_runs [run_type ], bad_runs_by_matrix )
185+ for check_run in check_runs [run_type ]["nodes" ]:
186+ name = check_run ["name" ]
187+ res_matrix = regex_matrix .search (name )
188+ if res_matrix :
189+ matrix = name .split (" /" , 1 )[0 ]
190+ matrix_job = name .split (" (" , 1 )[1 ][:- 1 ]
191+ bad_runs_by_matrix .setdefault (matrix , []).append (matrix_job )
192+ elif name != "scheduler" :
193+ bad_runs_by_matrix [name ] = True
194+ else :
195+ return {}
198196
199197 if query_check_runs .paginate (
200198 check_runs [run_type ]["pageInfo" ], "after" + run_type_camel
0 commit comments