← Back to Pull requests

fix(release): publish plugin and policy artifacts once, tag the rest to the same digest #85

Closed
unknown closed this pull request without merging on Oct 09, 2026 10:06 UTC
View on GitHub
unknown unknown commented on Oct 09, 2026 09:36 UTC
Author

Why

release-go-plugin.yml and release-policies.yml ran gooci upload / gooci upload-single once per tag (vX.Y.Z, then latest for a final release). Each gooci upload builds a new manifest (its index carries an org.opencontainers.image.created annotation), so the two tags held identical files under different digests. Seen in the rc tests on 2026-10-09:

  • mock-plugin-2: v0.1.1 is sha256:7c7f…, latest is sha256:e2b9…

  • mock-plugin-policies-1: v0.1.0 is sha256:c0ff…, latest is sha256:2d5d…
  • The agent records _plugin_digest and _policy_digest on evidence, so one build reported two digests depending on which tag an agent config pulled. That breaks provenance. preview.yml had the same loop for :main + :sha-<7>.

    What

    In every job that uploads a gooci artifact (release-go-plugin.yml publish, release-policies.yml publish, preview.yml plugin and policies):

    1. Upload once, to the first (most specific) tag from the tags job: vX.Y.Z, main or pr-<N>.
    2. Tag the rest (new step, identical in all four jobs): read the uploaded digest with crane digest, point each other tag at repo@<digest> with crane tag (a registry-side manifest PUT of the same bytes, no re-upload), then check that every tag resolves to that digest and fail if any differs. A single-tag run (rc, pr-N) does no tagging but still runs the check.
    3. Install crane with go install github.com/google/go-containerregistry/cmd/crane@v0.20.7. It reuses the docker/login-action login the job already has.

    Why crane (not oras)

  • gooci is built on go-containerregistry, and crane is that library's CLI. crane tag fetches the manifest and PUTs its raw bytes under the new tag, so the digest is preserved for gooci's manifests.

  • It reads the same Docker keychain gooci already uses, so no new login is needed.

  • It installs the same way gooci does (go install at an exact version, checked against the Go checksum DB), so there's no new action and no binary download to verify.

  • Why v0.20.7 and not the newest (v0.22.1). setup-go exports GOTOOLCHAIN=local, and release-go-plugin.yml runs the caller's go.mod Go version. v0.20.7 is the newest crane whose go directive (1.24.0) is no newer than gooci v0.0.7's (1.24), so it can't break a plugin repo that installs gooci today. v0.21.0 and later need Go 1.25.
  • Local check with real gooci v0.0.7 output against go-containerregistry's in-memory registry. Before: two upload-single calls gave v0.1.0=sha256:6ac6… and latest=sha256:decd…. After: crane tag repo@sha256:6ac6… latest gave both tags sha256:6ac6….

    Workflows changed


  • .github/workflows/release-go-plugin.yml (publish)

  • .github/workflows/release-policies.yml (publish)

  • .github/workflows/preview.yml (plugin, policies)
  • Checked and left alone


  • publish-image.yml: a single docker buildx imagetools create with every --tag already makes one index for all tags.

  • release-helm.yml: one helm push per release.

  • plugin-release.yml: legacy. The README says it stays unchanged until it is removed, and it is excluded from these tests like the existing ones.
  • Tests (internal/ciworkflows/oci_test.go)


  • TestGoociUpload: a final release (v1.2.3 latest) now makes exactly one gooci call, for both plugin and policies.

  • TestTagTheRest (fake crane backed by a tag→digest file):

  • - a final release moves a stale latest to the upload's digest;
    - an rc makes no tag calls;
    - a preview tags sha-<7>;
    - a tag that doesn't move fails with an ::error::;
    - a missing upload fails;
    - empty tags fail.
  • TestUploadOnceTagTheRest, a structural test that fails if the old loop comes back. Every workflow job running gooci upload must:

  • - have exactly one upload, outside any loop;
    - follow it immediately with the one shared Tag the rest step;
    - have the same pinned Install crane step.

    The test also pins the set of such jobs.

    README (preview and release-workflow tables plus a paragraph on the single digest) and the header comments of the three workflows are updated.

    Gate: in golang:1.26 with bash 5, jq and yq, go test -race ./..., go vet ./..., gofmt -l ., actionlint v1.7.12, and go run ./cmd/manifest on both manifests all pass.

    Live proof comes after release. Once this ships as v1.3.1 and ccf-bump moves the mocks, a final release on mock-plugin-2 and on mock-plugin-policies-1 should show the latest digest equal to the vX.Y.Z digest.

    Task: W1-S3-FIX-OCI-ONE-DIGEST (local-dev/docs/release-automation/workstream-1-foundations.md)

    🤖 Generated with Claude Code

    Diff: 582 lines (+436 / -146) across 7 files Reviewer: gusfcarvalho Review duration: 29m
    All Vouch review confidence checks passed
    Residual risk 0.20 = Change Risk (0.50) × (1 − Review Confidence (0.60)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.50 · 582 lines diff across 7 files
    0.50
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 100% · Reviewer familiarity: 35%
    60%
    Bedrock Claude 3 · Risk Narration
    (disconnected)
    Groq
    Groq Risk Narration
    AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
    Model 1 · Change Risk Attribution
    SHAP Weights
    Diff Size diff_size
    0.381
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #85"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 60.5% reviewed
    Vouch Risk Breakdown
    AI-powered review risk analysis
    Change Risk
    Change Risk · Model 1 (XGBoost)
    Predicted defect probability (0.00–1.00) based on diff churn, modified sensitive files, and author risk history.
    Score: 49.9% (MEDIUM) · Higher = larger blast radius
    49.9%
    Review Confidence
    Review Confidence · Models 2 & 3
    Scrutiny score (0.00–1.00) combining DistilBERT semantic review depth with reviewer familiarity and session dwell time.
    Score: 60.5% · Lower = rushed or shallow review
    60.5%
    Residual Risk
    Residual Risk · Core Equation
    Residual = Change × (1 − Confidence)
    Unmitigated risk surviving review. ≥ 0.65 triggers an automated re-queue to protect production.
    Score: 19.7% · Safe to merge
    19.7%