Skip to content
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

Merged
merged 10 commits into from
Feb 7, 2022

Conversation

lk86
Copy link
Contributor

@lk86 lk86 commented Jan 31, 2022

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 and feature/snapps-protocol.

@lk86 lk86 requested a review from mrmr1993 January 31, 2022 23:50
@lk86 lk86 requested a review from a team as a code owner January 31, 2022 23:50
@lk86 lk86 added the ci-build-me Add this label to trigger a circle+buildkite build for this branch label Jan 31, 2022
buildkite/scripts/merges-cleanly.sh Outdated Show resolved Hide resolved
# 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 "^<<<<<<<"
Copy link
Member

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

Copy link
Member

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.

Copy link
Contributor Author

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

Copy link
Contributor Author

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 "^+<<<<"

Copy link
Member

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 🤣

buildkite/scripts/merges-cleanly.sh Outdated Show resolved Hide resolved
Copy link
Contributor

@stevenplatt stevenplatt left a 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.

@lk86 lk86 changed the title lk86/fix-merges-cleanly-job Quick and dirty PoC lk86/fix-merges-cleanly-job Check mergeability against all upstream branches Feb 4, 2022
@lk86 lk86 merged commit e757de5 into compatible Feb 7, 2022
@lk86 lk86 deleted the lk86/fix-merges-cleanly-job branch February 7, 2022 19:33
@lk86 lk86 restored the lk86/fix-merges-cleanly-job branch February 7, 2022 19:33
@lk86 lk86 deleted the lk86/fix-merges-cleanly-job branch February 7, 2022 19:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci-build-me Add this label to trigger a circle+buildkite build for this branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants