feat(release): pass the release VERSION to image builds #90
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
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 76% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
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
gusfcarvalho
Why
compliance-framework/agent builds its images with
ARG VERSION=devand reports that value to the API. Its old release workflow passed--build-arg VERSION=X.Y.Z, but the sharedpublish-image.yml(v1.4.0) passes no build args. So every image built throughrelease-go-image.ymlreportsdev, 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 overrideVERSION.publish-image.ymlhas a new required input,version. The build job checks it against^[A-Za-z0-9][A-Za-z0-9_.-]{0,127}$, reading it fromenv:, and fails if it doesn't match. The value is handed todocker/build-push-actionas data (build-args: VERSION=${{ inputs.version }}), never through arun:line. It applies to every image and to both platforms.release-go-image.yml, and sorelease-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-tagsnow also outputsversionfrominternal/release.ReleaseVersion, which is the validationReleaseTagsalready did, moved out so both use it.preview.yml, kindimage):main-<sha7>on a push to the default branch,pr-<number>-<sha7>on a labelled PR. These come fromcmd/release preview-tags, which uses the newinternal/release.PreviewVersion.-
<sha7>is fromGITHUB_SHA, the commit the image is built from, which is also itsrevisionlabel.- 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.release-go-image.yml,release-go-plugin.ymlandrelease-policies.yml(TestReleaseCopiesenforces this). So theversionoutput is added to all three, though only the image workflow uses it.ARG VERSIONignores 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.ymldirectly; only this repo'spreview.ymlandrelease-go-image.ymldo. 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.ymlhas the requiredversioninput, and its single build step passes onlyVERSION=${{ inputs.version }}.release-go-image.ymlandpreview.ymlpass the tags job'sversionoutput, andrelease-ui.ymlstill goes throughrelease-go-image.yml.-
TestNoBuildArgsInput: no workflow has abuild-args-like input. Norun: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.3gives version1.2.3andv1.2.3-rc1gives1.2.3-rc1.-
TestPreviewTagsStep: push givesmain-0123456, PR givespr-12-0123456.internal/release:TestPreviewVersion,TestReleaseVersion.cmd/release: theversionoutput ofrelease-tagsandpreview-tags.go test -race ./...(andinternal/ciworkflowsin agolang:1.26container),go vet ./...,gofmt -l ., actionlint v1.7.12, andgo run ./cmd/manifeston 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