Skip to content

fix(compose): keep default images pinned after a weekly pin bump - #628

Merged
acamarata merged 3 commits into
mainfrom
fix/image-pin-defaults-from-lock
Oct 11, 2026
Merged

acamarata merged 3 commits into
mainfrom
fix/image-pin-defaults-from-lock

Conversation

@acamarata

@acamarata acamarata commented Oct 11, 2026 •

Copy link
Copy Markdown
Collaborator

Unblocks the weekly image-pin bump (#617). Found by an independent second-opinion review: with #617's lock, internal/compose fails TestLockIsSound and TestGeneratedImagesLockModeEqualsLockedRef, and lock mode emits hasura/graphql-engine:v2.44.0 and nhost/hasura-auth:0.36.0 with no digest.

Cause

compose.ImageRef treated every version other than the lock version as a user override and emitted it unpinned. The config defaults (HASURA_VERSION, AUTH_VERSION, ELASTICSEARCH_VERSION) and the .env files that nself setup writes still carry the pre-lock versions. So any bump of those pins turned the shipped default into an unpinned tag.

The preferred fix, deriving the config defaults from compose.LockedRef, is not possible: compose imports config, so config importing compose would be an import cycle. It would also miss the HASURA_VERSION=v2.44.0 lines already written into users' .env files.

Fix

  • ImageRef: in lock mode, the legacy_ref tag (the pre-lock default) also resolves to repository:version@digest. Legacy mode is unchanged. Any other version is still an unpinned override.
  • One rule for legacy_ref: it stays frozen, and a bump moves version only. That is what Image-Lock.md already said and what tools/imagebump already does. TestLockIsSound now checks that legacy_ref names the same repository with a tag, instead of requiring legacy_ref == repo:version.
  • New tests: TestImageForAfterPinBump covers a synthetic bumped entry in both modes. TestConfigDefaultVersionsStayPinned checks that every documented *_VERSION default and every ApplyDefaults version for hasura, auth and elasticsearch resolves to the locked ref in lock mode.
  • Image-Lock.md (Overrides, How pins move) explains the rule. The config defaults are untouched: they equal the legacy_ref tags, and TestConfigDefaultVersionsStayPinned guards them.

Verification

  • go test ./internal/compose/ ./tools/imagebump/... passes, plus ./internal/config/... ./internal/backup/... ./tools/..., go vet, and NSELF_V15=1 compose.
  • With chore(images): weekly image pin bump #617's images.yaml and images.lock.json overlaid on this branch, internal/compose, internal/config, tools/imagebump and tools/imagelock pass and imagelock -check is current.
  • Negative control: the same overlay on origin/main's images_lock.go and its test fails TestLockIsSound and TestGeneratedImagesLockModeEqualsLockedRef, as reported.

Once this merges, rerun image-pin-bump.yml so chore/image-pins regenerates on the new main.

… bump

ImageRef treated any version other than the lock version as a user override.
Config defaults and nself setup .env files carry the pre-lock version
(legacy_ref's tag), so a weekly pin bump (cli#617) turned the default
hasura and auth images into unpinned tags in lock mode. The legacy_ref
version now resolves to the locked digest too. legacy_ref stays frozen, as
Image-Lock.md says and tools/imagebump does; TestLockIsSound checks the
repository instead of requiring legacy_ref == repo:version.
…as the default

Image-Lock.md now states the one rule the tool, test and resolver share:
a pin bump moves version only. The config default sites say why they do
not move with a bump.
Comments under internal/config trip the doc-sync env-var rule. The rule
they described lives in Image-Lock.md and TestConfigDefaultVersionsStayPinned.
@acamarata
acamarata force-pushed the fix/image-pin-defaults-from-lock branch from bbb9d63 to b5398e1 Compare October 11, 2026 01:13
@acamarata
acamarata merged commit a7f9d65 into main Oct 11, 2026
32 checks passed
@acamarata
acamarata deleted the fix/image-pin-defaults-from-lock branch October 11, 2026 02:38
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.

1 participant