Project Management Automation: Avoid gracefully handling error#20009
Conversation
See also: #20011 |
|
I'm merging this first, before #20011, anticipating that the action will fail with an error, but doing so intentionally to verify the expected behavior that the task error is not silently absorbed. |
|
Interesting! The process failed, but the task itself was still reported as a success: https://github.com/WordPress/gutenberg/runs/423870820?check_suite_focus=true
I'll follow-up to investigate whether there are documented options for signalling that the the action failed. Also because at some point in the future, we'd need to handle the failure explicitly anyways:
|
|
There appear to be two options, based on the documentation. Using the Or setting the exit code of the process: I might have thought the uncaught error would already be causing a non-zero status code, but apparently not? |
Don't do that. We need to do it explicitly. |
|
Follow-up at #20012 |
This pull request seeks to change the behavior of our GitHub automation tasks to ensure that they fail loudly, rather than be silently absorbed.
For example, the following action was considered a success, despite the fact that it failed to assign the milestone:
https://github.com/WordPress/gutenberg/runs/423269588?check_suite_focus=true
We should want these tasks to fail loudly to ensure that they are working properly. This specific tasks has been dysfunctional for quite some time, but was only recently noticed to not be assigning the milestone.
If a task expects to possibly be throwing errors, it should do its own
try/catchand deal with the error accordingly. In this case, a duplicate milestone may be "fine" (it was previously anticipated), so the specific step of creating the milestone could be allowed to fail with the duplicate, as long as it still proceeds to add the milestone to the pull request. Currently, this last part was never reached, because it never recovers from the thrown error.Testing Instructions:
It will likely not be possible to test this, assuming there are no errors in current automation.
That said, there is an error with the milestone assignment automation, which occurs when the next milestone has already been created. This could either be used as verification that the failures are logged loudly, or could be considered a blocker to resolve first before this is merged.