Skip to content

Commit

Permalink
safe-merge-queue should gracefully handle network failures with github
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=263249
rdar://117172642

Reviewed by Jonathan Bedard.

Adds error handling for when query returns None.

* Tools/CISupport/ews-build/steps.py:
(GitHubMixin.query_graph_ql):
(RetrievePRDataFromLabel.run):

Canonical link: https://commits.webkit.org/269534@main
  • Loading branch information
briannafan committed Oct 19, 2023
1 parent fcbf065 commit c73420e
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions Tools/CISupport/ews-build/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,8 @@ def query_graph_ql(self, payload):
if response and response.status_code // 100 != 2:
yield self._addToLog('stdio', f'Accessed {graphql_url} with unexpected status code {response.status_code}.\n')
defer.returnValue(False if response.status_code // 100 == 4 else None)
elif not response:
defer.returnValue(False)
else:
data = json.loads(response.text)
defer.returnValue(data)
Expand Down Expand Up @@ -2369,6 +2371,7 @@ def run(self):
yield self._addToLog('stdio', f'Ending process as there are no PRs in {self.label}.\n')
return defer.returnValue(SUCCESS)
if not num_prs:
yield self._addToLog('stdio', f'Failed to retrieve number of PRs in {self.label}.\n')
return defer.returnValue(FAILURE)

self.setProperty('passed_status_check', [])
Expand Down

0 comments on commit c73420e

Please sign in to comment.