fix(deploy): add frontend build-SHA verification#105
Merged
Conversation
The deploy pipeline's correctness gate (`Verify build SHA matches the running container`, PR #54) only checked the backend /build_info. A frontend-only PR (e.g. ROA-264) had NO deploy-time verification: the backend check passes trivially when the backend didn't change, and the frontend's only gate was "returns HTTP 200" — which a stale frontend image also satisfies. So a frontend image that failed to rebuild could ride through a fully green deploy unnoticed ("deployed but the change isn't there"). Close the gap by mirroring the backend pattern on the frontend: - apps/web/app/build_info/route.ts — App Router route handler returning {commit, version}; force-dynamic so it reads the runtime ENV, not a build-time-frozen value. - Dockerfile.web — ARG/ENV BUILD_COMMIT in the runner stage (re-declared because ARGs don't cross stages). - docker-compose.selfhost.build.yml — pass BUILD_COMMIT from MULTICA_BUILD_COMMIT to the frontend build, mirroring the backend COMMIT arg. - deploy-production.yml — new "Verify frontend build SHA" step after the backend one, identical logic against the frontend port; commit='unknown' or mismatch is a hard deploy failure. Net: every deploy now verifies BOTH containers serve the SHA that was built. Frontend-only changes can no longer pass green while serving stale code. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
4 tasks
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes the frontend-only-deploy verification gap surfaced by ROA-264 ("deployed but the change isn't there").
The deploy pipeline's correctness gate (
Verify build SHA matches the running container, PR #54) only checked the backend/build_info. A frontend-only PR has no real deploy-time verification: the backend check passes trivially when the backend didn't change, and the frontend's only gate is "returns HTTP 200" — which a stale frontend image also satisfies. So a frontend image that failed to rebuild could ride through a fully green deploy unnoticed.Fix — mirror the backend pattern on the frontend
apps/web/app/build_info/route.ts— App Router route handler returning{commit, version}.force-dynamicso it reads the container's runtime ENV, not a value frozen atnext build.Dockerfile.web—ARG/ENV BUILD_COMMITin the runner stage (re-declared because ARGs don't cross build stages).docker-compose.selfhost.build.yml— passBUILD_COMMITfromMULTICA_BUILD_COMMITto the frontend build, mirroring the backend'sCOMMITarg.deploy-production.yml— new "Verify frontend build SHA" step after the backend one; identical logic against the frontend port.commit='unknown'or a mismatch is a hard deploy failure.Net: every deploy now verifies both containers serve the SHA that was built.
Test plan
@multica/webtypecheck clean (tsc --noEmit)deploy-production.yml+docker-compose.selfhost.build.ymlvalid YAMLVerified: running frontend serves <sha>🤖 Generated with Claude Code