You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
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.
"At least one exception was thrown. Check the logs for details."
),
)
end
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.
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:
RegistryCI.jl/src/AutoMerge/cron.jl
Lines 222 to 227 in ea15679
RegistryCI.jl/src/AutoMerge/cron.jl
Lines 229 to 235 in ea15679
The text was updated successfully, but these errors were encountered: