Repository navigation
feat: re-run failed jobs lost to a runner, a bounded number of times - #15
Merged
Merged
Conversation
A pull request whose required check failed because a self-hosted runner was lost is never merged, and stays that way until someone re-runs the failed jobs by hand. The opt-in rerun-lost-runners input is the number of re-runs allowed. For a workflow run that did not succeed, the annotations of each failed or cancelled job are read, and the failed jobs are re-run only when every one carries a runner-loss annotation. A test or build failure, or a job cancelled by its own timeout, leaves the run alone. A run whose attempt number is past the limit is never re-run again. Each job is written to the step summary as re-run or left alone, with the reason. The default of 0 changes nothing. Refs #14
The classification now keys on the prefixes of the messages GitHub writes for a runner that lost contact and for a job past its time limit, replacing wording that had been assumed. The tests use those messages, including one cut short as a captured annotation was.
Jobs were picked by a failure or cancelled conclusion before their annotations were read, so a job lost to its runner under any other conclusion was missed. Every job whose conclusion is not success, skipped or neutral is now read, and a job still running is left alone. A job that timed out with no runner-loss annotation counts as a timeout.
|
🎉 This PR is included in version 1.5.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an opt-in
rerun-lost-runnersinput, the number of re-runs allowed for a workflow run whose failed jobs were all lost to their runner. The default of 0 changes nothing.For a
workflow_runthat did not succeed,merge.shreads the annotations of each failed or cancelled job and callsrerun-failed-jobsonly when every one carries a runner-loss annotation. A test or build failure, or a job cancelled by its own timeout, leaves the run alone, as does a run whose attempt number is past the limit. Each job is written to the step summary as re-run or left alone, with the reason. A successful run is merged as before. The re-run usesread-token, which needsactions: write; the README says so.Not tested against a real runner loss, only against the stubbed
ghthe suite uses.Refs #14