upsidr / merge-gatekeeper

Get better merge control
MIT License
85 stars 14 forks source link

Handling/retrying transient network failures #64

Open franklad opened 1 year ago

franklad commented 1 year ago

Hi everyone,

Sometimes when merge-gatekeeper tries to call GitHub API, GitHub returns 5xx errors or EOF and they tend to be all transient network errors.

Would you be open to adding retries to GitHub API calls? I'm happy to discuss more and add the functionality.

Initial thoughts were adding retry flag to the cli and adding a retry roundTripper to the GitHub client.

rytswd commented 1 year ago

Hi @franklad! Sorry for getting back to you late, we are certainly open to ideas to make Merge Gatekeeper more resilient and reliable! It makes sense to handle some transient errors by retrying them, and we would definitely look more closely 👍

franklad commented 1 year ago

Added this PR: #67. Let me know what you think, happy to make changes.

omer2500 commented 1 year ago

@franklad you mentioned network issues what about jobs that didn't exist or created yet ? does the github api will return 500 for such a request?

Thanks for the pr!

franklad commented 1 year ago

Hey @omer2500, sorry for the late response. They return 400s afaik