Deploy wrapper: drop node dependency so the systemd unit can restart - #116
Merged
Merged
Conversation
The first v2.1.4 production deploy failed closed at restart: validate_v2_server_config ran a node heredoc, but the service runs under systemd where node is not on PATH, so the unit exited 127 and production rolled back. The runtime-key validation (shape, kid pattern, canonical base64 of >=32 bytes, pairwise kid/secret distinctness) is now expressed in jq and coreutils — the same dependencies the wrapper already requires — with identical fail-closed semantics. Constraint: systemd unit PATH provides no node; the wrapper must not gain runtime dependencies beyond bash, jq, coreutils, aws, git, and docker. Rejected: resolving node by absolute path or via docker run | node is not guaranteed installed on the host at all, and pulling an image at unit start adds a network dependency to a boot-time validation. Confidence: high — every existing HMAC/key rejection test exercises the rewritten validator and still fails closed. Scope-risk: narrow — one function in the wrapper plus its test fixture. Directive: compose-up.sh may only assume bash, jq, and coreutils beyond the stubbed service commands; the new regression test runs the whole wrapper under a stripped systemd-like PATH with a failing node stub. Tested: node --test infra/test/deploy-assets.test.mjs (29/29 incl. new systemd-PATH test); root npm test (625 workspace + 36 infra); git diff --check clean. Not-tested: the real unit restart on the box — that is the next deploy.
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
validate_v2_server_configran anodeheredoc, but systemd's unit PATH has no node, so the unit exited 127 and production was rolled back todc004c7+ the v2.1.3 pin.nodestub that exits 127, so any future barenodecall fails the suite.Test plan
node --test infra/test/deploy-assets.test.mjs— 29/29 including the new systemd-PATH testnpm test— 625 workspace + 36 infra, 0 failgit diff --checkcleanGenerated with Devin