Skip to content

feat: auto-detect CI builder field in provenance.json (fixes #30) - #33

Merged
SoundMatt merged 2 commits into
mainfrom
fix/issue-30
Jul 25, 2026
Merged

feat: auto-detect CI builder field in provenance.json (fixes #30)#33
SoundMatt merged 2 commits into
mainfrom
fix/issue-30

Conversation

@SoundMatt

Copy link
Copy Markdown
Owner

Summary

  • Adds release.DetectBuilder(override) which resolves the builder identity in priority order: explicit override (from --builder flag), FUSA_BUILDER env var (non-GitHub CI), and GITHUB_ACTIONS + GITHUB_WORKFLOW_REF (producing github-actions:<ref>).
  • Adds a Builder field to the Provenance struct with omitempty so local builds omit it cleanly.
  • BuildProvenance calls DetectBuilder("") automatically; the new --builder flag in cmd_release.go calls DetectBuilder(*builder) to apply an explicit override.
  • Updates the IEC 62443 CR-1.4 gap-report note to name the detection mechanism.
  • Registers REQ-RELEASE010 in .fusa-reqs.json with four unit tests covering all detection paths.

Closes #30

Test plan

  • go test ./release/... ./iec62443/... passes with new unit tests for all four DetectBuilder paths
  • gofusa release run locally omits the builder field (no env vars set)
  • gofusa release run with GITHUB_ACTIONS=true and GITHUB_WORKFLOW_REF=refs/heads/main produces "builder": "github-actions:refs/heads/main"
  • gofusa release run with FUSA_BUILDER=my-ci produces "builder": "my-ci"
  • gofusa release --builder explicit-id produces "builder": "explicit-id"
  • gofusa iec62443 -sl SL-2 no longer flags CR-1.4 as a gap when builder is present in provenance.json

…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>
@SoundMatt
SoundMatt merged commit cd2a751 into main Jul 25, 2026
16 checks passed
@SoundMatt
SoundMatt deleted the fix/issue-30 branch July 25, 2026 22:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gofusa release: provenance.json omits 'builder' field even in CI — blocks IEC 62443 CR-1.4

1 participant