Skip to content

fix(greffer-updater): buildx-version-robust resolve_digest + 0.3.7 - #95

Merged
omarsy merged 1 commit into
mainfrom
fix/greffer-resolve-digest-robust
Jun 18, 2026
Merged

omarsy merged 1 commit into
mainfrom
fix/greffer-resolve-digest-robust

Conversation

@omarsy

@omarsy omarsy commented Jun 18, 2026

Copy link
Copy Markdown
Member

provenance.resolve_digest used docker buildx imagetools inspect --format '{{.Manifest.Digest}}', which on buildx ≥ ~0.35 silently falls back to the verbose listing instead of the bare digest. resolve_digest then returns None → verify_and_pull refuses every remote update.

The mocked unit tests never caught it (they stub the stdout). Found via local testing against the real updater image: buildx 0.34.1 (the current updater) emits the digest correctly, but a newer local buildx emits the verbose listing — so a future alpine docker-cli-buildx bump in the updater image would silently break all self-updates.

Fix: parse --format '{{json .Manifest}}' and read its digest (the image-index digest CI cosign-signs). Verified the JSON form returns the same digest on both buildx 0.34.1 and newer → behavior-preserving on the current updater, robust to a bump. Added a regression test for the verbose-fallback (non-JSON) path. Bumps 0.3.6 → 0.3.7.

CLI 253 + app 46 green.

🤖 Generated with Claude Code

…p 0.3.7

provenance.resolve_digest used `docker buildx imagetools inspect --format
'{{.Manifest.Digest}}'`, which on buildx >= ~0.35 silently falls back to the
verbose listing instead of the bare digest -> resolve_digest returns None ->
verify_and_pull refuses EVERY remote update ("cannot resolve digest"). The
mocked unit tests never caught it (they stubbed the stdout); confirmed live: the
updater's buildx 0.34.1 emits the digest, but a newer local buildx emits the
listing -> a future alpine buildx bump in the updater image would silently break
all self-updates.

Parse `--format '{{json .Manifest}}'` and read its `digest` instead (the
image-index digest CI cosign-signs). Verified the JSON form returns the SAME
digest on both buildx 0.34.1 (current updater) and newer, so it is
behavior-preserving now and robust to a bump. Regression test added for the
verbose-fallback (non-JSON) case. Bump 0.3.6 -> 0.3.7.
@omarsy
omarsy merged commit 981f39e into main Jun 18, 2026
6 checks passed
@omarsy
omarsy deleted the fix/greffer-resolve-digest-robust branch June 18, 2026 06:34

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 8563d236dc

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

res = compose._run(
["docker", "buildx", "imagetools", "inspect", ref,
"--format", "{{.Manifest.Digest}}"],
"--format", "{{json .Manifest}}"],

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Apply the robust digest lookup to the release workflow

This only updates the updater's resolver; the release workflow still resolves the updater pin and all signing targets with docker buildx imagetools inspect ... --format '{{.Manifest.Digest}}' in .github/workflows/docker-publish.yml:141 and .github/workflows/docker-publish.yml:225. In the buildx versions this patch is meant to tolerate, the 0.3.7 publish path can still fail before baking GREFFER_UPDATER_IMAGE or signing the images, so the runtime fix cannot be shipped. Docker's CLI reference documents formatting .Manifest and the JSON function with a top-level digest, so the workflow needs the same JSON parsing used here.

Useful? React with 👍 / 👎.

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