Repository navigation
fix(docker): pin the compose-spec source (#1146) - #1151
Merged
Merged
Conversation
COMPOSE_SPEC_URL fetched compose-spec/compose-spec's master branch directly (a legacy alias GitHub redirects to the actual default branch, main) — the same unpinned-moving-branch shape that made azure's codegen nondeterministic depending on cache state (#1144). Pin to the current main HEAD commit and carry that pin in the cache filename (docker-compose-spec-<sha>.json) so a stale pre-pin cache entry can never satisfy the new pin, mirroring azure's AZURE_SCHEMA_COMMIT fix. Verified: cold-cache generate against the pin succeeds; the generated artifacts (entities/properties/index.d.ts) are byte-identical to a pre-pin generate, since the pinned commit is the branch's current HEAD — no composite or source drift. docker's versions.ts falls under the chant.yml lexicon-schema cache key glob (lexicons/*/src/**/versions.ts), so this change rotates the CI cache key on its own.
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
COMPOSE_SPEC_URL(lexicons/docker/src/codegen/versions.ts) fetchedcompose-spec/compose-spec'smasterbranch directly. That branch name is a legacy alias — the repo's default branch ismain(confirmed viagit ls-remote --symref) — but either way it's a moving pointer, the exact shape that made azure's codegen nondeterministic depending on which cache state a CI runner had (#1144, fixed in #1145).ENGINE_API_URLin the same file was already pinned to thev27.3.1tag; compose-spec has no tagged releases, so this pins to a commit SHA instead, the same way #1145 did for azure (which also has no tags).Fixed the same way:
COMPOSE_SPEC_COMMIT = "11296e387ba76c77db1db768b9153a4304a3c9bd"— the currentmainHEAD ofcompose-spec/compose-specat the time of this PR.COMPOSE_SPEC_URLnow interpolates that commit instead ofmaster.COMPOSE_SPEC_CACHEnow embeds the pin (docker-compose-spec-<sha>.json) instead of a static filename, so a stale pre-pin cache entry (e.g. a CI partial-key cache restore, or a developer's existing~/.chant) can never satisfy the new pin — it just misses the name and re-downloads.Cache-key rotation
.github/workflows/chant.yml's lexicon-schema cache key ishashFiles('lexicons/*/src/**/fetch.ts', 'lexicons/*/src/**/versions.ts').lexicons/docker/src/codegen/versions.tsmatches thelexicons/*/src/**/versions.tsglob (**spans thecodegen/segment), so this edit changes that hash and rotates the CI cache key on its own — no workflow change needed.Drift check
Regenerated the docker lexicon against the pin and diffed the output (
lexicon-docker.json,index.d.ts,index.ts) against a generate from the pre-pin code. Byte-identical — zero drift. Expected: the pinned commit ismain's current HEAD, so pinned vs. unpinned currently fetch the same bytes (confirmed matching ETags too). No composite/source name changes were needed.Test plan
~/.chant's docker cache entries, rannpm run generate -w @intentius/chant-lexicon-docker— succeeds, produces the new pinned cache filename, 6 entities / 48 property types / 0 enums (unchanged count).npm run build -w @intentius/chant-lexicon-docker— clean.just build— clean (tsc, packages/core).just lint— clean (eslint).just test— 774 passed | 1 skipped (775 files), 9057 passed | 5 skipped (9062 tests) — matches the pre-change baseline exactly.just check-lexicons— docker 17/17 tier-1 checks passing (matches baseline); 2 known/tracked failures elsewhere (github, bug(github): 'expression' intrinsic is registered but never exported from src/index.ts #1069), unchanged.just fold-differential— 104 tests passed. Corpus: fold 55 / run-fallback 46 / empty 0 / drift 0 / isolated-retry 0 — matches the measured pre-change baseline exactly (same numbers, no growth).Closes #1146.