@@ -166,26 +166,14 @@ def get_commit_depth_and_check_suite(query_commits):
166
166
return [None , None ]
167
167
168
168
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
-
184
169
def get_bad_check_runs (query_check_runs ):
185
170
more_pages = True
186
171
bad_runs_by_matrix = {}
172
+
187
173
run_types = ["failed" , "incomplete" ]
188
174
175
+ regex_matrix = re .compile ("^[^\n ]+ \/ (build|run) \([^\n ]+\)$" )
176
+
189
177
while more_pages :
190
178
check_runs = query_check_runs .fetch ()["data" ]["node" ]
191
179
more_pages = False
@@ -194,7 +182,17 @@ def get_bad_check_runs(query_check_runs):
194
182
run_type_camel = run_type .capitalize () + "Run"
195
183
run_type = run_type + "Runs"
196
184
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 {}
198
196
199
197
if query_check_runs .paginate (
200
198
check_runs [run_type ]["pageInfo" ], "after" + run_type_camel
0 commit comments