Skip to content

Commit

Permalink
fix(bot): GraphQL API call failures breaking merge loop
Browse files Browse the repository at this point in the history
fixes #739
  • Loading branch information
chdsbd committed Oct 4, 2021
1 parent d4749bb commit b901444
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions bot/kodiak/pull_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ async def evaluate_pr(
return
except asyncio.TimeoutError:
# On timeout we add the PR to the back of the queue to try again.
# We're in a while loop, so we won't loose our spot if we're merging.
log.warning("mergeable_timeout", exc_info=True)
await requeue_callback()

Expand Down
7 changes: 6 additions & 1 deletion bot/kodiak/queries/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

import kodiak.app_config as conf
from kodiak.config import V1, MergeMethod
from kodiak.errors import ApiCallException
from kodiak.queries.commits import Commit, CommitConnection, GitActor
from kodiak.queries.commits import User as PullRequestCommitUser
from kodiak.queries.commits import get_commits
Expand Down Expand Up @@ -877,7 +878,11 @@ async def send_query(
res.raise_for_status()
except http.HTTPError:
log.warning("github api request error", res=res, exc_info=True)
return None
raise ApiCallException(
method="github/graphql",
http_status_code=res.status_code,
response=res.content,
)
return cast(GraphQLResponse, res.json())

async def get_api_features(self) -> ApiFeatures | None:
Expand Down

0 comments on commit b901444

Please sign in to comment.