Repository navigation
fix(greffer-updater): buildx-version-robust resolve_digest + 0.3.7 - #95
Conversation
…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.
There was a problem hiding this comment.
💡 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}}"], |
There was a problem hiding this comment.
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 👍 / 👎.
provenance.resolve_digestuseddocker buildx imagetools inspect --format '{{.Manifest.Digest}}', which on buildx ≥ ~0.35 silently falls back to the verbose listing instead of the bare digest.resolve_digestthen returnsNone→verify_and_pullrefuses 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-buildxbump in the updater image would silently break all self-updates.Fix: parse
--format '{{json .Manifest}}'and read itsdigest(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