Repository navigation
[No QA] Deploy production web builds to the production Cloudflare Worker - #104759
Conversation
Tabs still running an older production build can then load its chunks after a deploy, as on staging.
The Worker deploy job now runs for production too: it uploads the build to the production previous builds bucket, deploys the production Worker and checks the version on WEB_PRODUCTION_WORKER_HOST. Until that variable is set to WEB_PRODUCTION_HOST at switchover, webDeploy keeps checking WEB_PRODUCTION_HOST, so each host is checked once, by the job that serves it.
Both jobs have deployed by the time the Worker job runs, so checking new.expensify.com there works before and after it is routed to the Worker, without a separate host for the production Worker.
|
@thelullabyy Please copy/paste the Reviewer Checklist from here into a new comment on this PR and complete it. If you have the K2 extension, you can simply click: [this button] |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
| if: ${{ env.DEPLOY_ENV == 'production' }} | ||
| run: | | ||
| APP_VERSION=$(jq -r .version < package.json) | ||
| ./.github/scripts/verifyDeploy.sh "$HOST" "$APP_VERSION" |
There was a problem hiding this comment.
If this script is not used anymore, should we delete it?
There was a problem hiding this comment.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b875dbcb67
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…worker [No QA] Deploy production web builds to the production Cloudflare Worker (cherry picked from commit b88098c) (cherry-picked to staging by roryabraham)
…worker [No QA] Deploy production web builds to the production Cloudflare Worker (cherry picked from commit b88098c) (cherry-picked to production by roryabraham)
|
🚧 roryabraham has triggered a test Expensify/App build. You can view the workflow run here. |
|
🧪🧪 Use the links below to test this adhoc build on Android, iOS, and Web. Happy testing! 🧪🧪
|
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.5.16-3 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.5.17-0 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.5.18-0 🚀
|
|
🚀 Deployed to production by https://github.com/grgia in version: 9.5.18-1 🚀
Bundle Size Analysis (Sentry): |
|
🚀 Cherry-picked to staging by https://github.com/roryabraham in version: 9.5.20-0 🚀
|
|
🚀 Deployed to production by https://github.com/jasperhuangg in version: 9.5.20-5 🚀
Bundle Size Analysis (Sentry): |
Explanation of Change
Production deploys now deploy the web build to the production Static Assets Worker (
new-expensify-assets) too, as staging deploys already do, so new.expensify.com can be pointed at it.wrangler.jsonc: the production Worker gets thePREVIOUS_BUILDSbinding tonew-expensify-web-assets-production, so tabs on older production builds can still load their chunks. The bucket already holds the production releases from the last 60 days.deploy.yml:webDeployStagingWorkerbecomeswebDeployWorkerand runs for staging and production. It uploads the build to that environment's bucket, runswrangler deploy --env <staging|production>, and is required for both, so a production deploy fails if the Worker deploy fails.webDeployto this job, as staging's did. It runs after both jobs have deployed, so checkingWEB_PRODUCTION_HOSTworks before and after new.expensify.com is routed to the Worker. If the check stayed inwebDeploy, after the switch it would run before the Worker had the new build.new-expensify-assetsexists andCLOUDFLARE_WORKERS_DEPLOY_TOKENcan edit it, so the first production deploy with this change deploys it. Nothing routes to it yet, so that deploy doesn't change what users get.Fixed Issues
$ https://github.com/Expensify/Expensify/issues/688126
PROPOSAL:
Tests
web/cloudflare-worker, runnpm testandnpm run typecheck, and verify all 24 tests and the typecheck pass.dist/and runnpx wrangler deploy --dry-run --env production; verify the bindings includeenv.PREVIOUS_BUILDS (new-expensify-web-assets-production).Deploy Web to the Cloudflare Workerjob deploys the staging Worker and passes, and https://staging.new.expensify.com/version.json reports the new version.new-expensify-assets, and passes its version check on new.expensify.com.Offline tests
None. This only changes how web builds are deployed.
QA Steps
// TODO: These must be filled out, or the issue title must include "[No QA]."
No QA. This changes the deploy workflow, which is verified by the deploys themselves.
PR Author Checklist
### Fixed Issuessection aboveTestssectionOffline stepssectionQA stepssectionAvatar, I verified the components usingAvatarare working as expected)npm run compress-svg)Avataris modified, I verified thatAvataris working as expected in all cases)Designlabel and/or tagged@Expensify/designso the design team can review the changes.mainbranch was merged into this PR after a review, I tested again and verified the outcome was still expected according to theTeststeps.Screenshots/Videos
Android: Native
Android: mWeb Chrome
iOS: Native
iOS: mWeb Safari
MacOS: Chrome / Safari