Skip to content

fix(hash): repair main after #14093/#14215 merged in reverse order - #14253

Merged
glours merged 1 commit into
docker:mainfrom
ndeloof:fix-hash-test-layering
Sep 22, 2026
Merged

glours merged 1 commit into
docker:mainfrom
ndeloof:fix-hash-test-layering

Conversation

@ndeloof

@ndeloof ndeloof commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

What this PR does, in one sentence

Repairs main after #14093 and #14215 merged in the reverse of their documented order: pkg/compose tests compile again, the transient continuity test is deleted as planned, and the frozen key list learns the one attribute the compose-go layering added.

Context

Both PRs documented the same plan: #14215 (the pinned-historical-order hash) lands first, then #14093's compose-go bump deletes TestServiceHashContinuity — a test true by construction only while compose-go's struct order matches the frozen list, whose whole purpose was to prove the pinned serializer reproduced the historical bytes and then die with the reorder. They merged in the opposite order, and #14215 was never re-tested against the post-jobs main: on today's main, go test ./pkg/compose does not even compile (richServiceFixture sets fields the container-spec layering turned into promoted embeds — struct literals require go1.27 for that), and once compilable, two tests fail exactly as the design predicted.

What the PR brings

The fixture is built by assignment; TestServiceHashContinuity is deleted, its proof duty done — and the decisive check holds: TestHashGoldenValues passes unchanged on the layered compose-go, confirming the pinning preserved every historical hash through the reorder and closed the window between the two merges where main produced moved hashes (no release shipped in that window). pull_refresh_after, newly exposed at the service root by the layering, is appended at the end of serviceHashKeyOrder: the unknown-keys fallback already emitted it in that exact position, so no hash moves — listing it only freezes the layout and satisfies the coverage walker.

One follow-up question deliberately NOT taken here (this PR is a zero-decision repair): pull_refresh_after is a sibling of pull_policy, which is excluded from the hash — it may deserve the same exclusion, but that is a semantic choice for its own change.

🤖 Generated with Claude Code

…d in reverse order

The plan documented in both PRs had docker#14215 land first, then docker#14093's
compose-go bump delete the transient TestServiceHashContinuity. Merged
in the opposite order, main's pkg/compose tests no longer even compile:
richServiceFixture sets fields the container-spec layering turned into
promoted embeds (struct literals require go1.27 for that), and once
compilable two tests fail by construction.

- richServiceFixture is built by assignment;
- TestServiceHashContinuity is deleted, exactly as its own comment
  prescribes: the layered compose-go is the reorder it existed to
  outlive, its proof duty (pinned == historical bytes) is done, and
  TestHashGoldenValues carries the continuity contract alone — it
  PASSES on the layered compose-go, confirming the pinning preserved
  every historical hash through the layering;
- pull_refresh_after, newly exposed at the service root, is appended
  to serviceHashKeyOrder: the fallback already emitted it in that
  exact position, so no hash moves — listing it only freezes the
  layout and satisfies the coverage walker.

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
@ndeloof
ndeloof requested review from a team as code owners September 22, 2026 08:55

@glours glours left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@glours
glours enabled auto-merge (rebase) September 22, 2026 08:58

@docker-agent docker-agent left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assessment: 🟢 APPROVE

@glours
glours merged commit 6b419bc into docker:main Sep 22, 2026
60 of 61 checks passed
@codecov

codecov Bot commented Sep 22, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@ndeloof
ndeloof deleted the fix-hash-test-layering branch September 22, 2026 09:04
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.

3 participants