Skip to content

feat: resolve tag-pinned cloud-run digests through the Artifact Registry API - #1381

Draft
mbevc1 wants to merge 4 commits into
mainfrom
20261113_cloud-run-tags-get
Draft

mbevc1 wants to merge 4 commits into
mainfrom
20261113_cloud-run-tags-get

Conversation

@mbevc1

@mbevc1 mbevc1 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

kosli snapshot cloud-run now reads a tag-pinned image's digest from the Artifact Registry API, a metadata read, and keeps the registry manifest read as the fallback. The manifest read needs the permission that also pulls image layers, which an inventory tool such as Cloud Capture should not hold. --resolve-names now handles nested image paths and gcr.io images, so both lookups cover the same hosts.

Existing setups keep their digests. The one visible change is behind --resolve-names: digest-pinned gcr.io images are now reported under their tag.

Fixes #1376

Checklist

@github-actions github-actions Bot added go Pull requests that update go code feat labels Nov 13, 2026
@mbevc1
mbevc1 force-pushed the 20261113_cloud-run-tags-get branch from b5da537 to fc1b3ed Compare November 13, 2026 22:09
@claude

claude Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Claude finished @mbevc1's task in 3m 24s —— View job


Follow-up review

  • Fetch previous review comments and findings
  • Diff BEFORE..AFTER (182a8728..625e84b6) — this pair is diverged (ahead_by 4, behind_by 4, ancestry not reachable in a plain clone), so per the fallback rule I reviewed the full gh pr diff output, scoped to the hunks introduced by the four commits in git log --oneline -n 20 for this branch
  • Check status of each previous finding touched by new commits
  • Flag new bugs/security issues/regressions in changed lines only
  • Post summary comment
    · branch 20261113_cloud-run-tags-get

dockerImages.get takes the image as a single path segment, so an image
such as repo/team/app@sha256:... answered 404 and kept its digest-pinned
name. The slashes in the image path are now sent as %2F.
…try API

kosli snapshot cloud-run read a tag-pinned image's manifest from the
registry's OCI Distribution endpoint, which Artifact Registry authorises
with the same permission that pulls image layers. An inventory tool then
needs a grant that can pull every image in the project.

The digest now comes from the Artifact Registry API's tags.get, a
metadata read, for *-docker.pkg.dev images and for the gcr.io hosts that
Artifact Registry serves. The manifest read stays as the fallback when
the API lookup fails, so callers holding only the pull permission keep
their digests.
The help asked for roles/artifactregistry.reader, which can pull every
image in the repository. Digest and tag resolution now go through
metadata reads, so the help names the two permissions they need and
says that gcr.io hosts are covered as well.
…ve-names

--resolve-names skipped digest-pinned images on the gcr.io hosts because
Container Registry had no reverse lookup. Artifact Registry serves those
hosts now, through repositories named after the host, and its
dockerImages.get answers for them. The digest-pinned parser shares the
host mapping the digest lookup uses, so both directions cover the same
hosts.
@mbevc1
mbevc1 force-pushed the 20261113_cloud-run-tags-get branch from 182a872 to 625e84b Compare November 13, 2026 22:32
@claude

claude Bot commented Nov 13, 2026

Copy link
Copy Markdown
Contributor

Claude follow-up review

Previous findings: none found. There is no prior Claude review, review comment, or PR review on this PR (checked gh api repos/kosli-dev/cli/pulls/1381/comments, gh api repos/kosli-dev/cli/pulls/1381/reviews, and gh api repos/kosli-dev/cli/issues/1381/comments — all empty/absent before this run). So there is nothing to mark resolved/partially-addressed/not-addressed.

Diff scoping note: BEFORE=182a8728 and AFTER=625e84b6 have diverged histories (ahead_by 4, behind_by 4 — not a simple fast-forward, consistent with a force-push/rebase), so I fell back to gh pr diff and reviewed the full set of hunks introduced by this branch's four commits (7934a19, c0a2b1f, 4042a0c, 625e84b).

New findings: none. I read through the artifactRegistryRepoFor refactor, the digestFromTag/manifest-fallback logic in registry.go, and the escaping fixes for nested image paths, and cross-checked them against the new table-driven tests in registry_test.go / registry_http_test.go — the edge cases (empty segments, too-few segments, unsupported hosts, GCR host mapping, nested parent/child/img paths) are covered and consistent with the implementation. No bugs, security issues, or regressions found in the changed lines.

Note: I was unable to run go build/go test in this sandboxed session (commands required interactive approval that wasn't available), so this is a static read-through rather than a verified test run — worth confirming CI is green before merge.

View job run

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat go Pull requests that update go code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: resolve a tag-pinned Cloud Run image's digest through the Artifact Registry API

1 participant