Let the seed-file guard skip where config/ does not exist - #104
Merged
Conversation
The ADR-0021 guard added in #103 scans config/, which lives outside service/. The production image is built with service/ as its whole context and runs `npm test` in the Dockerfile, so the seed files genuinely are not there and the build died on `ENOENT: scandir '/config/'` — after a fully green DoD, which runs against a complete checkout. deploy-ds1 has been red on main since. tests/deploy-env-passthrough.ts already solved this exact seam, so this borrows its `hasRepoTree` idiom: skipped inside the image, enforced in the DoD job where the files actually exist. The readdir moves to module scope with it. `describe.skipIf` still evaluates the factory to register its tests, so a scandir inside the body throws during collection and fails the file before the skip can apply — which is why the first pass at this still broke the build. Verified by building service/Dockerfile locally, the same way the deploy does: 16 passed | 1 skipped in-image, 229 passed against the full tree. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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.
Fixes the red
deploy-ds1on main (run 31160910710).What broke
The ADR-0021 guard added in #103 scans
config/to prove no seed file reintroduces asecret: ${VAR}. Butconfig/lives outsideservice/, and the production image is built withservice/as its entire context while runningnpm testin the Dockerfile. So inside that build the seed files genuinely do not exist and the image build died on:DoD was fully green on #103 because it runs against a complete repo checkout — the two environments differ exactly where this test reads.
The fix
tests/deploy-env-passthrough.tsalready hit this same seam and solved it, so this borrows itshasRepoTreeidiom: skipped inside the image, enforced in the DoD job where the files exist and the check is meaningful. Nothing in an image can attest to seed files it was never given.The
readdirSyncalso moves to module scope.describe.skipIfstill evaluates the factory in order to register its tests, so a scandir inside the body throws during collection and fails the file before the skip can apply — my first pass at this fix kept the read inside the describe and still broke the build. Worth knowing for the next test that reaches outsideservice/.Verification
Built
service/Dockerfilelocally, the same way the deploy does:Test Files 16 passed | 1 skipped,Tests 210 passed | 7 skipped,docker build exit=0Test Files 17 passed,Tests 229 passed— the guard still runs and still enforces🤖 Generated with Claude Code