Repository navigation
auto-update-pr: don't cancel CI on a PR that is already up to date - #48
Merged
Merged
Conversation
A queued run after an update saw fresh CI on the just-updated PR, cancelled it all and called update-branch as a no-op, leaving the PR with no CI.
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.
What changed
On a push to main, auto-update-pr now restarts the PR it is tracking only if GitHub says that PR is behind main.
Effect
Before: a second queued run could see the PR it had just updated still running CI, cancel every run, and call update-branch, which did nothing because the branch was already current. The PR was left with all its CI cancelled (seen on prosopo/captcha#3756, run https://github.com/prosopo/captcha/actions/runs/42301579934).
After: a PR that is already up to date keeps its running CI.
Tests
New unit test
test_push_leaves_up_to_date_labelled_pr_running; all 18 tests intest_auto_update_pr.pypass.