Skip to content

ci(release): hardcode KO_DOCKER_REPO + publish chart as OCI artifact#339

Merged
trilamsr merged 3 commits into
mainfrom
ci/release-ko-repo-and-oci-chart
Jun 1, 2026
Merged

ci(release): hardcode KO_DOCKER_REPO + publish chart as OCI artifact#339
trilamsr merged 3 commits into
mainfrom
ci/release-ko-repo-and-oci-chart

Conversation

@trilamsr

@trilamsr trilamsr commented Jun 1, 2026

Copy link
Copy Markdown
Contributor

Summary

Two rc1-prep issues that both touch .github/workflows/release.yml.

#316 — Hardcode KO_DOCKER_REPO at the step level

SLSA L3 §parameterless-build requires that the build invocation cannot
be influenced by operator-supplied parameters. Previously
KO_DOCKER_REPO lived on the ko-publish job's env: block, which
SLSA's verifier treats as a job-level input that could be overridden.
Moved onto the single step that actually invokes ko build. Nothing
higher in the workflow can redirect the image push target without
editing this file.

Acceptance check: grep KO_DOCKER_REPO .github/workflows/release.yml
returns only the one step-scoped assignment (line 493) — all other
matches are comments.

#317 — Publish chart as OCI artifact + cosign keyless sign

Air-gapped operators previously had to git clone to get the chart.
Added a chart-publish job that runs on every release tag:

  • helm package install/kubernetes/tracecore
  • helm push oci://ghcr.io/tracecoreai/charts (resolves to
    oci://ghcr.io/tracecoreai/charts/tracecore:<chart-version>)
  • cosign sign --yes by digest, keyless, under the same workflow
    identity regex as the binary archives and container image — so one
    cosign verify invocation covers every artifact the workflow
    produces
  • cosign verify smoke check before the job exits
  • mirror the .tgz onto the GitHub Release for UI-discovery

The pushed chart version is Chart.yaml.version (NOT the release tag)
— the chart is independently versioned from the binary per RFC-0013
§chart-versioning, and scripts/chart-appversion-check.sh already
asserts Chart.appVersion ↔ binary version lockstep at release-prep
time.

Job permissions: contents: write (GitHub Release upload),
id-token: write (OIDC for keyless cosign), packages: write
(ghcr.io push). Helm registry login uses GITHUB_TOKEN against
ghcr.io; cosign uses the workflow's OIDC token against Fulcio.

Chart README now documents the helm install oci://... path.
docs/RELEASE-CHECKLIST.md adds a tag-cut verification step that
pulls the chart on a fresh host and verifies the cosign signature.

Test plan

  • actionlint .github/workflows/*.yml clean
  • python3 -c "import yaml; yaml.safe_load(...)" clean for release.yml
  • grep KO_DOCKER_REPO .github/workflows/release.yml shows only
    one step-scoped assignment ([rc1-prep] Hardcode KO_DOCKER_REPO step-level for parameterless build #316 acceptance)
  • Chart README still has every required H2 the chart.yml
    workflow asserts (Install, Upgrade, Uninstall, Values reference,
    Troubleshooting)
  • First post-merge release tag verifies the full chain:
    • helm pull oci://ghcr.io/tracecoreai/charts/tracecore --version <chart-version>
      on a fresh host (no prior helm registry login)
    • cosign verify oci://ghcr.io/tracecoreai/charts/tracecore:<chart-version>
      with the workflow identity regex
    • grep KO_DOCKER_REPO .github/workflows/release.yml | grep -v '#'
      returns exactly one line, scoped to the ko build + push step

Notes

  • helm push parses Digest: sha256:... from stdout (Helm 3.16 has
    no --output json); falls back to a hard error if the digest line
    is missing, so a silent regression on a future Helm upgrade fails
    loudly rather than skipping the cosign signing step.
  • The setup-ko action's auto-login behavior was verified against
    the pinned commit (d006021bd0): when KO_DOCKER_REPO is unset at
    setup-ko execution time, the action runs ko login ghcr.io itself
    using GITHUB_TOKEN and writes a derived value to $GITHUB_ENV.
    Setting KO_DOCKER_REPO at step-level later still wins (step env

    job env), so the SLSA-correct path is preserved.

Closes #316, #317.

Tri Lam added 3 commits June 1, 2026 01:27
SLSA L3 §parameterless-build requires that the build invocation cannot
be influenced by operator-supplied parameters. Moving KO_DOCKER_REPO
from the ko-publish job env onto the single step that calls `ko build`
removes the env-line attack surface — nothing higher in the workflow
can now redirect the image push target without editing this file.

Closes #316.
Add a chart-publish job that runs on every release tag:

  - helm package install/kubernetes/tracecore
  - helm push oci://ghcr.io/tracecoreai/charts (resolves to .../tracecore)
  - cosign sign --yes by digest (keyless; same workflow-identity
    binding as the binary archives and container image)
  - cosign verify smoke check before the job exits
  - mirror the .tgz onto the GitHub Release for UI-discovery

Operators on air-gapped clusters can now `helm pull oci://...` without
cloning the repo; chart and binary share one cosign identity regex.

Chart README: documents the OCI install path.
RELEASE-CHECKLIST: adds a tag-cut verification step pulling the chart
on a fresh host and verifying the cosign signature.

Closes #317.
Signed-off-by: Tri Lam <tri@maydow.com>
@trilamsr

trilamsr commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

Addressed reviewer nit: digest extraction now pipes through tail -1 to bind cosign to the final successful push line when helm retries. cosign verify was already positioned between sign and Release upload — no move needed.

@trilamsr trilamsr merged commit af031d3 into main Jun 1, 2026
17 checks passed
@trilamsr trilamsr deleted the ci/release-ko-repo-and-oci-chart branch June 1, 2026 08:55
trilamsr added a commit that referenced this pull request Jun 1, 2026
## Summary

- Cross-cut audit of 27 PRs merged this session (#339-#374) per repo
memory `feedback_review_discipline` (cross-cut at wave-end) +
`feedback_pr_review_simplicity` (bias deletion).
- 15 findings tabulated in `docs/v1-rc1-post-wave-audit.md` with
severity + proposed fix.
- 9 follow-up issues filed: #375-#383 (labeled `post-wave-audit`).

## Headline finding

**#377** (k8s pod/ns/node attribute scope helper) is the single largest
deletion opportunity in the wave — 82 sites x ~4 lines of duplicated
`resAttrs.Get -> attrs.Get` fallback ladder, replaceable by a ~10-line
helper. ~80 LOC net delete with zero behavior change.

## Bundled refactor opportunity (named loudly for dispatch)

Issues **#377 + #378 + #375 + #376** land as one refactor PR drop ~400
LOC across `module/processor/patterndetectorprocessor/` with zero
behavior change. Suggested title: `refactor(patterndetector): hoist k8s
scope helper + relocate per-pattern projectors`.

## Findings by severity

| Severity | Count | Issues |
|---|---|---|
| high | 1 | #377 |
| medium | 4 | #375, #376, #379, #382 |
| low | 5 | #378, #380, #381, #383, (#9 historical) |
| none | 5 | clean |

## Test plan

- [x] `make lint` (golangci-lint, vet, mod verify) ran via pre-commit
hook; 0 issues.
- [x] attribute-namespace-check: 100 attributes, 100 documented.
- [x] no-autoupdate-check: all assertions passed.
- [x] hit-line-format-stable: ok.
- [ ] Reviewer: confirm the 9 filed issues (#375-#383) cover the
dispatchable findings; flag any that should be closed as out-of-scope.

Signed-off-by: Tri Lam <tri@maydow.com>
Co-authored-by: Tri Lam <tri@maydow.com>
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.

[rc1-prep] Hardcode KO_DOCKER_REPO step-level for parameterless build

1 participant