feat: auto-detect CI builder field in provenance.json (fixes #30) - #33
Merged
Conversation
…nance.json (#30) Add release.DetectBuilder which reads GITHUB_ACTIONS/GITHUB_WORKFLOW_REF (producing "github-actions:<ref>"), FUSA_BUILDER (for non-GitHub CI), or an explicit --builder flag on gofusa release. The builder field is emitted in provenance.json only when a builder can be determined; local builds omit it. Adds REQ-RELEASE010 with four unit tests and updates the IEC 62443 CR-1.4 gap-report note to name the detection mechanism. Signed-off-by: SoundMatt <SoundMatt@users.noreply.github.com> Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
…macOS 26 Signed-off-by: Matt Jones <47545907+SoundMatt@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
release.DetectBuilder(override)which resolves the builder identity in priority order: explicit override (from--builderflag),FUSA_BUILDERenv var (non-GitHub CI), andGITHUB_ACTIONS+GITHUB_WORKFLOW_REF(producinggithub-actions:<ref>).Builderfield to theProvenancestruct withomitemptyso local builds omit it cleanly.BuildProvenancecallsDetectBuilder("")automatically; the new--builderflag incmd_release.gocallsDetectBuilder(*builder)to apply an explicit override.REQ-RELEASE010in.fusa-reqs.jsonwith four unit tests covering all detection paths.Closes #30
Test plan
go test ./release/... ./iec62443/...passes with new unit tests for all fourDetectBuilderpathsgofusa releaserun locally omits thebuilderfield (no env vars set)gofusa releaserun withGITHUB_ACTIONS=trueandGITHUB_WORKFLOW_REF=refs/heads/mainproduces"builder": "github-actions:refs/heads/main"gofusa releaserun withFUSA_BUILDER=my-ciproduces"builder": "my-ci"gofusa release --builder explicit-idproduces"builder": "explicit-id"gofusa iec62443 -sl SL-2no longer flags CR-1.4 as a gap whenbuilderis present inprovenance.json