Fix deploy concurrency and slim frontend SSR image - #1286
Closed
daveearley wants to merge 2 commits into
Closed
Conversation
Contributor
Author
|
Superseded by #1287, which drops the temporary |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Test branch for validating the staging deploy path.
feature/deploy-testingis temporarily added to thedeploy.ymlpush triggers so merges here exercise the workflow end to end.deploy.yml
Concurrency. Added a workflow-level
concurrencygroup keyed on target environment,cancel-in-progress: false. Back-to-back merges previously ran two overlapping deploys, so whichevervapor deployfinished last won β not whichever merged last. Runs now queue. Keying on environment rather thangithub.refalso closes the case where a dispatched production deploy from a non-mainbranch could run alongside amainpush.Deployment phase handling. The poll loop checked for a
FAILEDphase, which does not exist in the DigitalOcean API. Real phases areUNKNOWN, PENDING_BUILD, BUILDING, PENDING_DEPLOY, DEPLOYING, ACTIVE, SUPERSEDED, ERROR, CANCELED. Consequences:ERROR(a genuinely broken build) fell through and burned the full timeout, reporting "Deployment timed out" instead of the real failure.SUPERSEDED(what happens on back-to-back merges) did the same, producing a red X on a deploy that was fine.Now handled explicitly:
ACTIVEβ pass,SUPERSEDEDβ pass with a note,ERROR/CANCELEDβ fail and name the state. Timeout raised 10 β 15 min so a slow cold build doesn't report a false failure.frontend image
Dockerfile.ssrrebuilt as a 4-stage build: pinnednode:22-alpine, BuildKit yarn cache mounts,--frozen-lockfile, production-only runtime deps,messages:extractdropped from the build.2.84 GB β 412 MB (β85%). Build time unchanged (~53s).
Two things this surfaced:
node:alpinenow resolves to Node 26, which no longer bundles yarn, soapk add yarnwas pulling Alpine's ownnodejs 24.17.0in as a dependency β the image shipped two Node runtimes, on a version nobody develops against. Pinning to 22 fixes both.server.jsimportedvite(a devDependency) at the top level, blocking any production-only install. Moved to a dynamic import inside the existing dev branch.dependencies
Five packages were imported at SSR runtime but declared nowhere, surviving only via hoisting.
lodashwas the live bug: it reached the app through@lingui/vite-pluginβ@lingui/cliβinquirer, all dev-only.NumberSelectorimports it, and that renders on the tiered ticket-selection page β so a production-only install would have crashed SSR on the ticket-buying page while the homepage stayed green.Promoted to
dependencies:lodash,@lingui/core,invariant,react-fast-compare,shallowequal.@lingui/cliadded todevDependenciesβyarn builddepends on that same fragile chain.Pinned to exact versions deliberately:
^4.17.21resolves to lodash 4.18.1, and this change should not carry a silent upgrade. All six resolve to exactly the previously-hoisted versions, so the change is behaviour-neutral.Testing
Full E2E suite against the new image: 123 passed, 4 failed.
The 4 failures are pre-existing on
developβ verified by rebuilding the frontend from the original Dockerfile and re-running the same specs, which fails identically:All four sit in per-order promo allocation and look like a genuine gap worth its own issue.
E2E only covers production mode, so the dev SSR path was verified separately β
NODE_ENV=development node server.jsboots and serves 200 through the dynamic vite import.Notes
environment_slug: node-js), notDockerfile.ssr. It affects the E2E suite, released images, and self-hosters β and materially de-risks a future container platform, where cold start scales with image size.feature/deploy-testingshould come out of the push triggers before merge.feature/vapor-env-updatesis also still listed and looks stale.deploy_on_pushis set on the real staging/production DO apps. If it is, every push triggers a DO deploy and the workflow triggers a second one, which will now surface asSUPERSEDEDrather than a red X.