@@ -129,6 +129,7 @@ def fetch(self):
129
129
if request .status_code == 200 :
130
130
return request .json ()
131
131
else :
132
+ print (request .json ())
132
133
raise Exception ("Query Failed: {}" .format (request .status_code ))
133
134
134
135
@@ -164,35 +165,40 @@ def get_commit_and_checksuite(query_commits):
164
165
return [None , None ]
165
166
166
167
167
- def append_runs_to_list (runs , list ):
168
+ def append_runs_to_list (runs , bad_runs_by_matrix ):
168
169
regex_matrix = re .compile ("^build-[^ ]+" )
169
170
regex_board = re .compile ("\([^ ]+\)$" )
170
171
for run in runs ["nodes" ]:
171
172
name = run ["name" ]
172
173
res_matrix = regex_matrix .search (name )
173
174
if res_matrix :
174
175
matrix = res_matrix .group ()
175
- if matrix not in list :
176
- list [matrix ] = []
177
- list [matrix ].append (regex_board .search (name ).group ()[1 :- 1 ])
176
+ if matrix not in bad_runs_by_matrix :
177
+ bad_runs_by_matrix [matrix ] = []
178
+ res_board = regex_board .search (name )
179
+ if res_board :
180
+ bad_runs_by_matrix [matrix ].append (res_board .group ()[1 :- 1 ])
178
181
179
182
180
- def get_bad_checkruns (query_checkruns , list = {}):
181
- checkruns = query_checkruns .fetch ()["data" ]["node" ]
182
- run_types = ["failed" , "incomplete" ]
183
- paginate = False
183
+ def get_bad_checkruns (query_checkruns ):
184
+ more_pages = True
185
+ bad_runs_by_matrix = {}
186
+ while more_pages :
187
+ checkruns = query_checkruns .fetch ()["data" ]["node" ]
188
+ run_types = ["failed" , "incomplete" ]
189
+ more_pages = False
184
190
185
- for run_type in run_types :
186
- run_type_camel = run_type .capitalize () + "Run"
187
- run_type = run_type + "Runs"
191
+ for run_type in run_types :
192
+ run_type_camel = run_type .capitalize () + "Run"
193
+ run_type = run_type + "Runs"
188
194
189
- append_runs_to_list (checkruns [run_type ], list )
195
+ append_runs_to_list (checkruns [run_type ], bad_runs_by_matrix )
190
196
191
- if query_checkruns .paginate (checkruns [run_type ]["pageInfo" ], "after" + run_type_camel ):
192
- query_checkruns .variables ["include" + run_type_camel ] = True
193
- paginate = True
197
+ if query_checkruns .paginate (checkruns [run_type ]["pageInfo" ], "after" + run_type_camel ):
198
+ query_checkruns .variables ["include" + run_type_camel ] = True
199
+ more_pages = True
194
200
195
- return get_bad_checkruns ( query_checkruns , list ) if paginate else list
201
+ return bad_runs_by_matrix
196
202
197
203
198
204
def main ():
0 commit comments