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

[No QA] Build Cherry-pick flow for Expensify.cash #2978

Merged
merged 10 commits into from
May 25, 2021
Merged

Conversation

roryabraham
Copy link
Contributor

@roryabraham roryabraham commented May 18, 2021

Note: This PR creates a CP-staging workflow only. Not CP-production.

Details

Creates the ability to cherry-pick a workflow to staging by merging a pull request with the CP Staging label.

Fixed Issues

Fixes https://github.com/Expensify/Expensify/issues/155229

Testing plan

  1. Ensure that the StagingDeployCash is not locked

  2. Create a pull request with the CP Staging label. OSBotify should comment on the pull request with a comment that looks like:

    image

  3. Merge the pull request with the CP Staging label. It should follow the normal process and be deployed to staging.

  4. Lock the StagingDeployCash. The normal chain-of-events should happen, culminating with a staging deploy. The cherryPick.yml workflow should not be executed.

  5. Merge a pull request with an easily identifiable change (no CP Staging label). Call this PR A. As per usual, it should not be deployed or added to the StagingDeployCash. A comment should appear on the PR stating that it will be deployed later.

  6. @Jag96 - Merge a pull request with an easily identifiable change with the CP Staging label on the PR. Call this PR B. A new version should be created and merged to main, and the preDeploy workflow should synchronously execute the cherryPick.yml workflow.

  7. A staging deploy should occur, and a comment should appear on PR B stating that it was cherry picked (not just deployed) to staging in the correct version.

  8. Once the staging deploy completes, verify that PR A is not present on staging, but PR B is. This is where the easily-identifiable changes will come in handy.

  9. Verify that PR B was added to the StagingDeployCash, but PR A was not.

  10. @Jag96 - Use the GitHub UI to attempt to manually CP PR A to staging. The workflow should not complete. Verify that no staging deploy happens.

  11. @AndrewGable or @roryabraham - Use the GitHub UI to attempt to manually CP PR A to staging. It should work and a staging deploy should occur.

  12. Once the staging deploy completes, verify that PR A is present on staging.

  13. Verify that PR A was added to the StagingDeployCash.

  14. Unlock the StagingDeployCash and revert any temporary changes.

@roryabraham roryabraham requested review from AndrewGable and Jag96 May 18, 2021 18:06
@roryabraham roryabraham self-assigned this May 18, 2021
@roryabraham roryabraham requested a review from a team as a code owner May 18, 2021 18:06
@MelvinBot MelvinBot requested review from jasperhuangg and removed request for a team May 18, 2021 18:06
@AndrewGable
Copy link
Contributor

I know this is a late to the game comment, but did we explore adding the ability to add the label after the PR is merged? Or will that be able to be added in a future iteration?

@roryabraham
Copy link
Contributor Author

did we explore adding the ability to add the label after the PR is merged

Yeah, so this was designed with a specific vision in mind. Basically in many places we currently have if: github.actor == 'OSBotify', we'll instead use an action to check that the actor is a member of a Expensify.cash Deployers GH group. That will allow certain privileged individuals to manually run/restart workflows that currently can only be run by OSBotify.

With that in mind, the cherryPick.yml workflow runs on the workflow_dispatch event, which means it can only be started "manually". So what we'll be able to do is manually trigger the cherryPick.yml workflow using the GH UI, and all you'll have to do is provide the number of the pull request you want to CP. It would look something like this:

image

@AndrewGable
Copy link
Contributor

Wow I had no idea that UI existed, looks great!

@roryabraham roryabraham requested a review from AndrewGable May 20, 2021 17:19
Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good, just 2 comments

.github/workflows/cherryPick.yml Show resolved Hide resolved
.github/workflows/cherryPick.yml Show resolved Hide resolved
@roryabraham
Copy link
Contributor Author

roryabraham commented May 20, 2021

If a PR is created with the CP Staging, let's add a comment like:

⚠️ ⚠️ Heads up! This pull request has the CP Staging label. ⚠️ ⚠️
Merging it will cause it to be immediately deployed to staging, even if the open StagingDeployCash deploy checklist is locked.

@roryabraham roryabraham requested a review from Jag96 May 20, 2021 21:55
@roryabraham
Copy link
Contributor Author

Okay, this is updated and ready for another review. Added some botify comments and opened up the deployBlocker.yml workflow for all members of the Expensify.cash Deployers GH Team

Copy link
Contributor

@Jag96 Jag96 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 Let me know if you need help testing this!

.github/workflows/cherryPick.yml Show resolved Hide resolved
@AndrewGable
Copy link
Contributor

Looks great, feel free to test without me (or if I am around I am happy to help testing!)

Copy link
Contributor

@jasperhuangg jasperhuangg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I don't have the most knowledge about this stuff so I followed as best as I could. Feel free to merge once the test that @AndrewGable mentioned is added!

@AndrewGable AndrewGable merged commit 97f62d5 into main May 25, 2021
@AndrewGable AndrewGable deleted the Rory-CherryPick branch May 25, 2021 23:34
@roryabraham roryabraham changed the title Build Cherry-pick flow for Expensify.cash [No QA] Build Cherry-pick flow for Expensify.cash May 26, 2021
@roryabraham
Copy link
Contributor Author

Marking this as No QA for Applause's sake, but will begin testing this now.

@roryabraham
Copy link
Contributor Author

roryabraham commented May 26, 2021

@roryabraham
Copy link
Contributor Author

Fixing the last failure with this PR

@roryabraham
Copy link
Contributor Author

Adjusting the test plan a bit: we are going to:

  1. skip steps 6-9 for now
  2. Complete steps 10-11, except use PR B
  3. Complete step 7-9
  4. Complete steps 6-9 again with the revert PR for PR B

@roryabraham
Copy link
Contributor Author

Okay, so @Jag96 tried to manually CP this PR, but we ran into a permissions error where the OSBotify token needs higher permissions.

@roryabraham
Copy link
Contributor Author

roryabraham commented May 26, 2021

Okay, this testing was unfortunately a failure, and we need to step back and get some input from ring 0 folks to continue. For now, we'll:

  1. Revert [CP Testing] Change blue to a vibrant magenta #3150
  2. Unlock the StagingDeployCash
  3. Revert Make easily noticeable temporary change #3149
  4. Continue discussion over here

@roryabraham
Copy link
Contributor Author

Continuing QA on this issue with an updated plan: since we already verified steps 1-3, we're going to restart at step 4:

  1. Lock the StagingDeployCash. The normal chain-of-events should happen, culminating with a staging deploy. The cherryPick.yml workflow should not be executed.
  2. Merge this PR: Temporarily replace blue with magenta #3209. As per usual, it should not be deployed or added to the StagingDeployCash. A comment should appear on the PR stating that it will be deployed later.
  3. Someone other than @AndrewGable or I: merge this PR: Temporarily replace green with cyan #3208. A new BUILD version should be created and merged to main, and the preDeploy workflow should synchronously execute the cherryPick.yml workflow.
  4. A staging deploy should occur, and a comment should appear on Temporarily replace green with cyan #3208 stating that it was cherry picked (not just deployed) to staging in the correct version.
  5. Once the staging deploy completes, verify that Temporarily replace blue with magenta #3209 is not present on staging, but Temporarily replace green with cyan #3208 is. This is where the easily-identifiable changes will come in handy.
  6. Verify that Temporarily replace green with cyan #3208 was added to the StagingDeployCash, but Temporarily replace blue with magenta #3209 was not.
  7. Someone other than @AndrewGable or I: Use the GitHub UI to attempt to manually CP Temporarily replace blue with magenta #3209 to staging. The workflow should not complete. Verify that no staging deploy happens.
  8. @AndrewGable or I: Use the GitHub UI to attempt to manually CP Temporarily replace blue with magenta #3209 to staging. It should work and a staging deploy should occur.
  9. Once the staging deploy completes, verify that Temporarily replace blue with magenta #3209 is present on staging.
  10. Create revert-PRs for both test PRs, give both the CP Staging label, and merge both.
  11. Once the later staging deploy completes, verify that there are no incorrect colors on staging.
  12. Close the StagingDeployCash to run a prod deploy. Verify that the latest staging version is deployed to prod. We'll have locked the current StagingDeployCash and CP'd 4 PRs, so I expect that version to be 1.0.57-4.

@roryabraham
Copy link
Contributor Author

roryabraham commented May 28, 2021

  1. https://github.com/Expensify/Expensify.cash/runs/2696159849?check_suite_focus=true
  2. https://github.com/Expensify/Expensify.cash/runs/2696167506?check_suite_focus=true
  3. https://github.com/Expensify/Expensify.cash/runs/2696535209?check_suite_focus=true, https://github.com/Expensify/Expensify.cash/runs/2696547589?check_suite_focus=true
    • CP actor validation didn't seem to work, and the logs are not very helpful.
    • Note: we probably don't want to do the "deploy deferred" comment when a PR has the CP Staging label

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants