-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Squiddy-merge the PR, not the branch
We've recently started seeing occasional weird merges with squiddy, where the branch itself is merged, but github considers the PR "closed" and having zero commits. (e.g. https://github.com/futurelearn/futurelearn/pull/14124) This action performs the following steps: * we first rebase the PR branch using cirrus-actions/rebase * we then merge the branch (NB: not the PR!) using the github API * we delete the branch unless the repo is configured to do this automatically None of these operations are directly on the PR, meaning that Github has to detect any relevant changes to the PR and update its state. This happens asynchronously, and is therefore prone to race conditions. This commit tries to eliminate the possibility of race conditions by: * Waiting for the PR head to match the branch head (in other words, it gives Github a chance to catch up following the rebase) * Issuing the merge command on the PR itself, not the branch Note that previously we were using the `merge_method: 'rebase' param in the #merge call; this was a mistake, as we actually want to create a merge commit, but as it happens calling merge on a branch doesn't support the merge_method option, so we got a merge commit anyway. We're now using the #merge_pull_request method, which *does* support that option, and we want to create a merge commit, so the strategy is set to 'merge', not 'rebase'.
- Loading branch information
Simon Coffey
committed
Mar 21, 2023
1 parent
8230a07
commit 507ca4c
Showing
2 changed files
with
103 additions
and
48 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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