-
Notifications
You must be signed in to change notification settings - Fork 3k
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
[No QA] Use force-push to update staging and production #10378
Conversation
|
if: ${{ inputs.TARGET_BRANCH != 'main' }} | ||
shell: bash | ||
run: | | ||
git checkout ${{ env.SOURCE_BRANCH }} |
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.
Do we want to also verify that SOURCE_BRANCH
is either main
or staging
first? Based on line 47, it could be something else too (though I don't understand why)
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.
So the Set source branch
step sets the source branch in the environment like so:
- If the target branch is
staging
, the source branch ismain
- If the target branch is
production
, the source branch isstaging
- Else (the target branch is
main
), and the source branch is whatever is passed ininputs.TARGET_BRANCH
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.
Ok, so this is covered by the if: ${{ inputs.TARGET_BRANCH != 'main' }}
. That's all I wanted to confirm, thanks.
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.
Yeah. Overall this action maybe isn't as clear and clean as it could be because so much of it only applies for if the target branch is main, but cleanup is out-of-scope for now. I'll be working on a design doc soon to clean up a lot of our GitHub Actions code.
if: ${{ inputs.TARGET_BRANCH != 'main' }} | ||
shell: bash | ||
run: | | ||
git checkout ${{ env.SOURCE_BRANCH }} |
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.
Ok, so this is covered by the if: ${{ inputs.TARGET_BRANCH != 'main' }}
. That's all I wanted to confirm, thanks.
(cherry picked from commit c2e99f2)
…-10378 🍒 Cherry pick PR #10378 to staging 🍒
Details
Slack context: https://expensify.slack.com/archives/C07J32337/p1660240289078479
This PR utilizes OSBotify's new ability to bypass branch protection permissions that require pull requests to push changes and prohibit force-pushing to a protected branch. Furthermore, when updating staging, we'll just delete the staging branch and re-create it from main. When updating production, we'll just delete the production branch and re-create it from staging. This eliminates the possibility of conflicts, simplifies deploy workflows, and also fixes #10214
I believe there's more we could do to clean things up (including using the same strategy to update
main
, but for now this PR is focused on unblocking deploys.Fixed Issues
$ #10214
Tests
Merge this PR with the CP staging label. Verify that the staging build is fixed and that staging deploys successfully.