Repository navigation
fix: tell a failed push apart from a pull request behind its base - #16
Merged
Merged
Conversation
A fast-forward merge read every failed push to the base as the pull request being behind it. A dropped connection then either left the run saying the branch needed updating, or, with update-behind, rebased a branch that already held the base, reported that it had rebased it and exited successfully, so the pull request was never merged and nothing said so. After a rejected push the base is fetched again, and the pull request counts as behind only when the base is not an ancestor of its head. Any other failed push fails the run with git's error. The rebase effect likewise leaves alone a head that already contains its base, whatever the conditions say, since rebasing it changes nothing. Every fetch and push is tried again a bounded number of times when its connection fails.
|
🎉 This PR is included in version 1.5.1 🎉 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.
A
fast-forwardmerge treated every failed push to the base as the pull request being behind it. When the SSH connection was dropped (Connection closed by <ip> port 22,fatal: Could not read from remote repository), the run either said the branch needed updating or, withupdate-behind: true, rebased a branch that already contained the base, printedwas behind; rebased it, and CI will run on the new headand exited 0. The pull request was never merged and nothing said so.git merge-base --is-ancestordecides. Only a base that is not contained in the head counts as behind; otherwise the run fails with git's error, or reports that the head is already on the base if the push did land.then: rebaseleaves alone a head that already contains its base, so it cannot report a rebase that changed nothing, with or without abehindcondition. The other head-branch pushes already stop the run when they fail.test/transport.batscovers these. Against the previous script it fails apart from the head-branch push that keeps failing, including the falserebased itreport; with the change it passes.To reproduce with the stubs:
PUSH_ERROR="git@github.com: Permission denied (publickey)." PUSH_ERROR_TIMES=1 UPDATE_BEHIND=trueon afast-forwardrun.