Repository navigation
Ship the commit the build produced, not whatever inputs.ref points at now - #86
Merged
Merged
Conversation
… now The ship job checked out inputs.ref. The binary reaches it as an artifact built from a specific commit, but deploy.sh ships static/ and monitoring/ from the checkout, so the two only agree while that ref holds still. It need not: a workflow_dispatch rollback can name a branch, a release tag can be moved, and the gap spans the whole Rust cross-build plus however long the job waits on the environment's approval gate — potentially hours. The post-deploy check does not cover this. It asserts GET /version against the build job's SHA, and the binary reports that correctly however stale the assets shipped beside it are, so the run goes green on a mixed deployment. Check out needs.build.outputs.sha instead. The build job still resolves inputs.ref, so the ref is interpreted exactly once and everything shipped comes from that one commit — which is also what makes the /version assertion mean what it claims. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01R8ZshwKmjD5fZ4Hs9dS6zh
There was a problem hiding this comment.
Pull request overview
This PR fixes a deploy correctness hazard in the reusable native deploy workflow by ensuring the ship job checks out the exact commit that produced the built binary artifact, preventing mixed deployments where static/ and monitoring/ come from a different (moved) ref than the binary.
Changes:
- Update
.github/workflows/deploy-native.ymlso theshipjob checks out${{ needs.build.outputs.sha }}instead of${{ inputs.ref }}. - Add an in-file comment explaining the failure mode (ref movement during build/approval gate) and why the
/versionpost-deploy check would not detect asset skew.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
4 of 7 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
The
shipjob indeploy-native.ymlchecked outinputs.ref. The binary reaches it as an artifact built from one specific commit, butdeploy.shships two of the three payloads straight from that checkout:Those agree only while the ref holds still, and it need not. A
workflow_dispatchrollback can name a branch rather than a tag, and a release tag can be moved. The window is not small either — it spans the whole Rust cross-build plus however longshipwaits on the environment's approval gate, which is unbounded when required reviewers are configured.What makes this worth fixing rather than noting: the post-deploy check cannot catch it. The
Verify deployed versionstep assertsGET /versionagainstneeds.build.outputs.sha, and the binary reports that SHA correctly no matter how stale thestatic/andmonitoring/trees shipped beside it are. A mixed deployment goes green.Checking out
needs.build.outputs.shacloses it. Thebuildjob still resolvesinputs.ref, so the ref is interpreted exactly once, at one point in time, and everything that reaches the host comes from that single commit — which is also what makes the/versionassertion mean what it claims to.Found by Copilot review on #84 (#84 (comment)), which merged before the comment could be addressed there. Split out rather than folded into #81 so a correctness fix to shared deploy mechanics gets its own review and its own revert handle.
Related issues
None. Separately tracked deploy-mechanics follow-up: #85.
Changes
shipchecks outneeds.build.outputs.shainstead ofinputs.ref, with a comment recording why, including why the/versionassertion does not cover the case.Testing
deploy-native.ymlparses as YAML; verified structurally thatshipdeclaresneeds: build, thatbuildexports theshaoutput the new ref consumes, and that no reference toinputs.refremains anywhere in theshipjob.mainor a release tag. The staging deploy that follows this merge is what exercises it.cargo build/cargo test/clippy— no Rust source changed.npm test --prefix monitoring/mcp-status— no dashboard code changed; the workflow runs it anyway.Checklist
Generated by Claude Code