← Back to Pull requests

feat(release): pass the release VERSION to image builds #90

Closed
unknown closed this pull request without merging on Oct 09, 2026 12:22 UTC
View on GitHub
unknown unknown commented on Oct 09, 2026 12:13 UTC
Author

Why

compliance-framework/agent builds its images with ARG VERSION=dev and reports that value to the API. Its old release workflow passed --build-arg VERSION=X.Y.Z, but the shared publish-image.yml (v1.4.0) passes no build args. So every image built through release-go-image.yml reports dev, and mock-agent's images already do. This has to be fixed here before agent onboards; agent's Dockerfiles stay as they are.

What

Every image build now gets exactly one build arg, VERSION. The shared workflows compute it from trusted data. Callers can't pass build args of their own: build args are kept in the image's history and provenance, and a free-form list would let a caller override VERSION.

  • publish-image.yml has a new required input, version. The build job checks it against ^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$, reading it from env:, and fails if it doesn't match. The value is handed to docker/build-push-action as data (build-args: VERSION=${{ inputs.version }}), never through a run: line. It applies to every image and to both platforms.

  • Releases (release-go-image.yml, and so release-ui.yml, which calls it) use the release tag without its prefix: v1.2.3 → 1.2.3, v1.2.3-rc1 → 1.2.3-rc1. The value comes from the tags job: cmd/release release-tags now also outputs version from internal/release.ReleaseVersion, which is the validation ReleaseTags already did, moved out so both use it.

  • Previews (preview.yml, kind image): main-<sha7> on a push to the default branch, pr-<number>-<sha7> on a labelled PR. These come from cmd/release preview-tags, which uses the new internal/release.PreviewVersion.

  • - <sha7> is from GITHUB_SHA, the commit the image is built from, which is also its revision label.
    - The repo had no 0.0.0-<kind>.<id> convention, so this uses the spec's fallback. It is deliberately not semver, so a preview never looks like a release.
  • The tags job is a single shared copy across release-go-image.yml, release-go-plugin.yml and release-policies.yml (TestReleaseCopies enforces this). So the version output is added to all three, though only the image workflow uses it.

  • A Dockerfile without ARG VERSION ignores the arg: docker warns about the unused build arg and the build continues. The README says so.
  • No repo in the org calls publish-image.yml directly; only this repo's preview.yml and release-go-image.yml do. I checked every repo's workflows on its default branch. So making the new input required breaks no caller.

    Tests

  • internal/ciworkflows:

  • - TestImageVersion: publish-image.yml has the required version input, and its single build step passes only VERSION=${{ inputs.version }}. release-go-image.yml and preview.yml pass the tags job's version output, and release-ui.yml still goes through release-go-image.yml.
    - TestNoBuildArgsInput: no workflow has a build-args-like input. No run: script in the image workflows interpolates ${{ }}.
    - TestCheckVersion: the version check accepts release and preview values. It rejects empty values, spaces, newlines, $(...), a leading -, /, and anything over 128 characters.
    - TestReleaseTagsStep: v1.2.3 gives version 1.2.3 and v1.2.3-rc1 gives 1.2.3-rc1.
    - TestPreviewTagsStep: push gives main-0123456, PR gives pr-12-0123456.
  • internal/release: TestPreviewVersion, TestReleaseVersion. cmd/release: the version output of release-tags and preview-tags.

  • Local gate: go test -race ./... (and internal/ciworkflows in a golang:1.26 container), go vet ./..., gofmt -l ., actionlint v1.7.12, and go run ./cmd/manifest on both manifests.
  • The live proof comes after release: an rc on mock-agent whose image reports that rc's version instead of dev.

    Task: W1-S2-PRE-IMAGE-VERSION (local-dev/docs/release-automation/workstream-1-foundations.md)

    🤖 Generated with Claude Code

    Diff: 498 lines (+373 / -125) across 6 files Reviewer: gusfcarvalho Review duration: 9m
    All Vouch review confidence checks passed
    Residual risk 0.22 = Change Risk (0.47) × (1 − Review Confidence (0.55)). Review depth and reviewer attention state are adequate.
    Model 1 · Change Risk (XGBoost)
    Score: 0.47 · 498 lines diff across 6 files
    0.47
    Model 2 · Review Depth (DistilBERT)
    Depth Score: 0.17 · 1 substantive comment(s)
    0.17
    Model 3 · Review Timing & Attention
    Session adequacy: 76% · Reviewer familiarity: 35%
    54%
    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.372
    Shallow Review Depth shallow_review_depth
    0.289
    Real PR Conversation Timeline
    1 comments
    "Review active on #90"
    general weight: 0.35
    Reviewers
    Assignees
    Unassigned
    Labels
    risk: low confidence: 54.6% 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: 47.5% (MEDIUM) · Higher = larger blast radius
    47.5%
    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: 54.6% · Lower = rushed or shallow review
    54.6%
    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: 21.6% · Safe to merge
    21.6%