Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 12 additions & 19 deletions contributingGuides/philosophies/DEPLOYING.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,20 @@ This describes the deployment processes, QA cycles, and build workflows for the
### - All code MUST be deployed to staging before production
We utilize a CI/CD deployment system built using [GitHub Actions](https://github.com/features/actions) to ensure that new code is automatically deployed to our users as fast as possible. All code is first deployed to our staging environments, where it undergoes quality assurance (QA) testing before it is deployed to production.

### - Pull requests SHOULD be deployed to staging immediately after merge
Typically, pull requests are deployed to staging immediately after they are merged if the checklist is unlocked.
### - Pull requests are deployed to staging when the current checklist is closed
The deploy checklist is locked from the moment it is created, so pull requests are not deployed to staging when they are merged. OSBotify comments on the merged PR, and it is deployed to staging together with everything else merged since the previous checklist when the current checklist is closed. If a change must reach staging sooner, it has to be cherry-picked.

### - StagingDeployCash MUST be used to track deployment progress
Every time a PR is deployed to staging, it is added to a [special tracking issue](https://github.com/Expensify/App/issues?q=is%3Aopen+is%3Aissue+label%3AStagingDeployCash) with the label `StagingDeployCash` (there will only ever be one open at a time). This tracking issue contains information about the new application version, a list of recently deployed pull requests, and any issues found on staging that are not present on production.

### - QA team MUST lock deploys during testing cycles
Every weekday at 9am PST, our QA team adds the `🔐LockCashDeploys🔐` label to that tracking issue, and that signifies that they are starting their daily QA cycle. They will perform both regular regression testing and the QA steps listed for every pull request on the `StagingDeployCash` checklist.
### - Staging deploys are locked during testing cycles
The `🔐LockCashDeploys🔐` label is added to the tracking issue by OSBotify when it is created, so staging deploys are locked for the whole QA cycle. Our QA team performs both regular regression testing and the QA steps listed for every pull request on the `StagingDeployCash` checklist.

### - Deploy blockers MUST prevent production deployment
Once the `StagingDeployCash` is locked, we won't run any staging deploys until it is either unlocked, or we run a production deploy. If severe issues are found on staging that are not present on production, a new issue (or the PR that caused the issue) will be labeled with `DeployBlockerCash`, and added to the `StagingDeployCash` deploy checklist.

### - A hotfix MAY be deployed directly to staging using CP Staging label
If we want to resolve a deploy blocker by reverting a pull request or deploying a hotfix directly to the staging environment, we can merge a pull request with the `CP Staging` label.
### - A hotfix MAY be deployed directly to staging with a cherry-pick
If we want to resolve a deploy blocker by reverting a pull request or deploying a hotfix directly to the staging environment, a member of [@Expensify/mobile-deployers](https://github.com/orgs/Expensify/teams/mobile-deployers) can run the [`cherryPick` workflow](https://github.com/Expensify/App/actions/workflows/cherryPick.yml) on the merged pull request. The workflow applies the `CP Staging` label itself; adding the label manually does not trigger a cherry-pick.

### - Production deployment MUST be triggered by closing StagingDeployCash
Once we have confirmed to the best of our ability that there are no deploy-blocking issues and that all our new features are working as expected on staging, we'll close the `StagingDeployCash`. That will automatically trigger a production deployment, open a new `StagingDeployCash` checklist, and deploy to staging any pull requests that were merged while the previous checklist was locked.
Expand All @@ -44,29 +44,22 @@ The [preDeploy workflow](https://github.com/Expensify/App/blob/main/.github/work
- Otherwise:
- Create a new version by triggering the [`createNewVersion` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/createNewVersion.yml)
- Update the `staging` branch from main.
- Also, if the pull request has the `CP Staging` label, it will execute the [`cherryPick` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/cherryPick.yml) to deploy the pull request directly to staging, even if the `StagingDeployCash` is locked.

### deploy
The [`deploy` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/deploy.yml) is really quite simple. It runs when code is pushed to the `staging` or `production` branches, and:

- If `staging` was updated, it creates a tag matching the new version, and pushes tags.
- If `production` was updated, it creates a GitHub Release for the new version.

### platformDeploy
The [`platformDeploy` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/platformDeploy.yml) is what actually runs the deployment on all three platforms (iOS, Android, Web). It runs a staging deploy whenever a new tag is pushed to GitHub, and runs a production deploy whenever a new release is created.
The [`deploy` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/deploy.yml) runs when code is pushed to the `staging` or `production` branches. It creates a tag matching the new version, runs the deployment on all three platforms (iOS, Android, Web), creates or updates the `StagingDeployCash` checklist (staging only), and creates a GitHub Release for the new version.

### lockDeploys
The [`lockDeploys` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/lockDeploys.yml) executes when the `StagingDeployCash` is locked, and it waits for any currently running staging deploys to finish, then gives Applause the :green_circle: to begin QA by commenting in the `StagingDeployCash` checklist.
The [`lockDeploys` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/lockDeploys.yml) executes when a person re-adds the lock label to the `StagingDeployCash` after removing it (it does not run for the label OSBotify adds at creation), and it waits for any currently running staging deploys to finish, then gives Applause the :green_circle: to begin QA by commenting in the `StagingDeployCash` checklist.

### finishReleaseCycle
The [`finishReleaseCycle` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/finishReleaseCycle.yml) executes when the `StagingDeployCash` is closed. It updates the `production` branch from `staging` (triggering a production deploy), deploys `main` to staging (with a new `PATCH` version), and creates a new `StagingDeployCash` deploy checklist.
The [`finishReleaseCycle` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/finishReleaseCycle.yml) executes when the `StagingDeployCash` is closed. It updates the `production` branch from `staging` (triggering a production deploy), deploys `main` to staging (with a new `PATCH` version), which creates a new `StagingDeployCash` deploy checklist.

### testBuild
The [`testBuild` workflow](https://github.com/Expensify/App/blob/main/.github/workflows/testBuild.yml) builds ad-hoc staging apps (hybrid iOS, hybrid Android, and web) from pull requests submitted to the App and Mobile-Expensify repositories. This process enables testers to review modifications before they are merged into the main branch and deployed to the staging environment. This workflow accepts up to two inputs:
- A PR number from the App repository for testing New Dot (ND) changes.
- A PR number from the Mobile-Expensify repository for testing Old Dot (OD) changes.
- A PR URL from the App repository for testing New Dot (ND) changes.
- A PR URL from the Mobile-Expensify repository for testing Old Dot (OD) changes.

Both PR numbers can be entered simultaneously if the changes from both repositories need to be combined and tested. Additionally, contributors can explicitly link related PRs from the Mobile-Expensify repository in the App repository PR description if required. Guidance on linking PRs can be found [in PR template](https://github.com/Expensify/App/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L25-L30)
Both PR URLs can be entered simultaneously if the changes from both repositories need to be combined and tested. Additionally, contributors can explicitly link related PRs from the Mobile-Expensify repository in the App repository PR description if required. Guidance on linking PRs can be found [in PR template](https://github.com/Expensify/App/blob/main/.github/PULL_REQUEST_TEMPLATE.md?plain=1#L25-L30)

## Local Production Builds

Expand Down
Loading