-
Notifications
You must be signed in to change notification settings - Fork 548
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lk86/fix-merges-cleanly-job Check mergeability against all upstream branches #10133
Conversation
buildkite/scripts/merges-cleanly.sh
Outdated
# The git merge-tree command shows the content of a 3-way merge without | ||
# touching the index, which we can then search for conflict markers. | ||
|
||
git merge-tree `git merge-base origin/$BRANCH HEAD` origin/$BRANCH HEAD | grep "^<<<<<<<" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed emitting a useful diff on our call; should we try to do that? It's probably fine to clobber the checkout and do a git merge origin/$BRANCH && git diff --exit-code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This also appears not to be working correctly. If I locally check out this branch and git merge origin/feature/snapps-protocol
, I see conflicts, but CI seems contented.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think its fine to clobber the checkout, i think a nontrivial amount of the local state is saved between runs in the same pipeline, but I will see about getting better debug output. Certainly I need to see more information to understand why it doesn't catch conflicts yet
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed, when there are merge conflicts the lines begin with +<<<<< so the grep needs "^+<<<<"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Congrats, you are now successfully blocked from merging this 🤣
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with Matthews' note of including the branch name in a future update (No conflict found with upstream branch $BRANCH
).
I also note the ordering of trees in git merge-tree 'git merge-base origin/$BRANCH HEAD' origin/$BRANCH HEAD | grep "^<<<<<<<"
but if the goal is to check against the specific branch and not "develop", this appears correct to me.
…ess review feedback
This PR both fixes the check introduced some time ago for merge conflicts with develop, as well as extending the tool to check for conflicts with
compatible
andfeature/snapps-protocol
.