-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
[WIP] Fix CI Git logic #10316
[WIP] Fix CI Git logic #10316
Conversation
@@ -40,17 +40,12 @@ jobs: | |||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | |||
with: | |||
ref: staging | |||
token: ${{ secrets.OS_BOTIFY_TOKEN }} |
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 used to pass this token to try and set up git as OSBotify. I don't think it ever really worked, but in any event it's not necessary because in the next step we call setupGitForOSBotify
.
@@ -40,17 +40,12 @@ jobs: | |||
uses: actions/checkout@5a4ac9002d0be2fb38bd78e4b4dbde5606d7042f | |||
with: | |||
ref: staging | |||
token: ${{ secrets.OS_BOTIFY_TOKEN }} | |||
fetch-depth: 0 |
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.
Fetching all history so we don't need to do a separate fetch later
@@ -34,23 +34,20 @@ jobs: | |||
needs: [validateActor, createNewVersion] | |||
if: ${{ always() && fromJSON(needs.validateActor.outputs.IS_DEPLOYER) }} | |||
runs-on: ubuntu-latest | |||
env: |
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 is more concise syntax for what used to be the Save correct NEW_VERSION to env
step
run: git cherry-pick -S -x --mainline 1 -Xtheirs ${{ steps.getVersionBumpMergeCommit.outputs.MERGE_COMMIT_SHA }} | ||
|
||
- name: Cherry-pick the merge commit of target PR to the new branch | ||
run: git cherry-pick -S -x --mainline 1 ${{ steps.getCPMergeCommit.outputs.MERGE_COMMIT_SHA }} |
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.
Need to dig in to confirm, but I think there won't be conflicts against the temporary branch created from the merge-base
of the two commits we're trying to CP.
I think the merge conflicts will pop up when we're attempting to merge code into staging (and even then, only if there are multiple conflicting CPs)
echo "::set-output name=SHOULD_AUTOMERGE::true" | ||
else | ||
echo "😞 PR can't be automerged, there are merge conflicts in the following files:" | ||
git --no-pager diff --name-only --diff-filter=U |
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 was a pretty weird workaround – we were literally committing the conflicts including the ====HEAD====
stuff, and asking people to overwrite that.
Fortunately, I don't think we'll really need to do this anymore. Instead, we'll CP the commits into a temporary branch which won't have any conflicts, then create the PR. If the PR has merge conflicts, then it will be unmergeable and we'll assign someone to resolve those conflicts. However, it will appear like a normal PR with merge conflicts listed at the bottom of the page. None of the wonky ====HEAD====
stuff will be committed into the files.
I think we are going to go another route with this. Going to close this out for now |
This PR fixes some flaws we've got with our existing git logic for cherry-picks.
Problem Details
Some of the Git logic we use to cherry-pick changes to staging is fundamentally flawed. A great resource to understand this problem is this article, especially parts 1-5. (h\t @oldnewthing, this article was very helpful).
Our scenario is a bit different than the one described in the article, so I did my best to draw it up, along with the 3-way merge chart for the problematic merge:
3-way merge chart
Solution Details
Here's a diagram showing the solution I got from the article and applied to our situation, along with the new 3-way-merge chart:
3-way merge chart
Fixed Issues
$ #10214
Tests
PR Review Checklist
Contributor (PR Author) Checklist
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
)src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
are working as expected)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)PR Reviewer Checklist
The Contributor+ will copy/paste it into a new comment and complete it after the author checklist is completed
### Fixed Issues
section aboveTests
sectionQA steps
sectiontoggleReport
and notonIconClick
).src/languages/*
filesSTYLE.md
) were followedAvatar
, I verified the components usingAvatar
have been tested & I retested again)/** comment above it */
displayName
propertythis
properly so there are no scoping issues (i.e. foronClick={this.submit}
the methodthis.submit
should be bound tothis
in the constructor)this
are necessary to be bound (i.e. avoidthis.submit = this.submit.bind(this);
ifthis.submit
is never passed to a component event handler likeonClick
)StyleUtils.getBackgroundAndBorderStyle(themeColors.componentBG
)Avatar
is modified, I verified thatAvatar
is working as expected in all cases)QA Steps
Screenshots
Web
Mobile Web
Desktop
iOS
Android