Skip to content

fix(docker): pin the compose-spec source (#1146) - #1151

Merged
lex00 merged 1 commit into
mainfrom
fix/1146-docker-spec-pin
Jul 28, 2026
Merged

lex00 merged 1 commit into
mainfrom
fix/1146-docker-spec-pin

Conversation

@lex00

@lex00 lex00 commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

COMPOSE_SPEC_URL (lexicons/docker/src/codegen/versions.ts) fetched compose-spec/compose-spec's master branch directly. That branch name is a legacy alias — the repo's default branch is main (confirmed via git 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_URL in the same file was already pinned to the v27.3.1 tag; 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:

  • Added COMPOSE_SPEC_COMMIT = "11296e387ba76c77db1db768b9153a4304a3c9bd" — the current main HEAD of compose-spec/compose-spec at the time of this PR.
  • COMPOSE_SPEC_URL now interpolates that commit instead of master.
  • COMPOSE_SPEC_CACHE now 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 is hashFiles('lexicons/*/src/**/fetch.ts', 'lexicons/*/src/**/versions.ts'). lexicons/docker/src/codegen/versions.ts matches the lexicons/*/src/**/versions.ts glob (** spans the codegen/ 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 is main'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

  • Cold-cache generate against the pin: cleared ~/.chant's docker cache entries, ran npm 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.

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.
@lex00
lex00 merged commit ec1cc3b into main Jul 28, 2026
6 checks passed
@lex00
lex00 deleted the fix/1146-docker-spec-pin branch August 3, 2026 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

docker: COMPOSE_SPEC_URL fetches compose-spec master unpinned — same drift shape as azure #1144

1 participant