Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If TagBotTriggers encounters an exception, it should still process the rest of the PRs in the list before it exits #429

Open
DilumAluthge opened this issue Jun 14, 2021 · 0 comments
Assignees
Labels

Comments

@DilumAluthge
Copy link
Member

Currently, if TagBotTriggers encounters an exception while processing a PR, the exception is thrown and TagBotTriggers exits immediately.

For example, suppose that there are 100 PRs that need to be processed by TagBotTriggers. If the TagBotTriggers throws an exception while processing the third PR in that list, this means that TagBotTriggers will exit before processing PRs four through one hundred, which is unfortunate.

I think we should instead do something like this: if an exception is thrown while processing a PR, don't throw the exception; instead, catch the exception, print a logging message (use exception=(ex, catch_backtrace()) to make sure that the full backtrace is printed to the logs), push the exception onto a list, and then continue processing PRs. Once all PRs have been processed: if the list of exceptions is empty, exit with status code 0; if the list of exceptions is nonempty, exit with nonzero status code.

Here is some prior art:

  1. In RegistryCI.jl, specifically in the AutoMerge cron job, we do exactly this. We loop over all open PRs and process them one by one. If an exception is thrown while we are processing a PR (e.g. maybe there is a merge conflict, or maybe someone manually merges the PR at the same time that we try to auto-merge it), we catch the exception, log it, push the exception onto a list, and continue processing PRs. Then, at the end, we exit with nonzero status code if and only if the list of exceptions is nonempty.
  2. In BumpStdlibs.jl, we do the same thing. If an error is thrown while trying to process a stdlib, we still process all of the other stdlibs before exiting with nonzero status code.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants