Skip to content

fix(ci): capture stderr when parsing helm push output#249

Merged
lockwobr merged 1 commit into
mainfrom
fix/release-helm-push-stderr
May 22, 2026
Merged

fix(ci): capture stderr when parsing helm push output#249
lockwobr merged 1 commit into
mainfrom
fix/release-helm-push-stderr

Conversation

@ayuskauskas
Copy link
Copy Markdown
Collaborator

Summary

The chart-publish step in `release.yml` failed for `chart/v0.16.0` with:

```
Pushed: ghcr.io/nvidia/nodewright/charts/nodewright:v0.16.0
Digest: sha256:e487043f621145fe7dc6b21eb48cf560d2357beb6ff459d88bfb448657096b12

Error: failed to parse Helm chart digest from helm push output
```

The push itself succeeded — the parser bailed. Root cause: `helm push` (3.16+) writes the `Pushed:` and `Digest:` lines to stderr, while the workflow only captured stdout via `$(helm push ...)`. The GHA runner displays both streams in the job log, which is why the lines were visible above the error.

Fix: redirect stderr into stdout for the command substitution. The subsequent `sha256:[a-f0-9]{64}` regex check is unchanged, so malformed input still fails fast.

Test plan

  • Re-run the failed chart release workflow with this fix applied — `Push chart to ghcr.io` step now produces a parsed digest, downstream cosign sign + provenance attestation steps proceed.

`helm push` (3.16+) writes the human-readable "Pushed:" and "Digest:"
lines to stderr, so the existing `$(helm push ...)` only captured an
empty stdout and the awk that extracts the digest produced no match.
Redirect stderr into stdout for the command substitution so the
digest-parser sees the same output that's already visible in the
runner log. The follow-up `sha256:[a-f0-9]{64}` regex check still
guards against malformed input.

Surfaced when publishing chart/v0.16.0 to oci://ghcr.io/nvidia/nodewright/charts:
the push itself succeeded, but the subsequent attestation steps failed
because no digest was extracted.

Signed-off-by: Alex Yuskauskas <ayuskauskas@nvidia.com>
@lockwobr lockwobr merged commit 046fe2e into main May 22, 2026
7 of 8 checks passed
@lockwobr lockwobr deleted the fix/release-helm-push-stderr branch May 22, 2026 21:39
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 22, 2026

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: d067b55e-1d7b-4a00-a2aa-019a96a5348b

📥 Commits

Reviewing files that changed from the base of the PR and between 30b3e1a and 800f495.

📒 Files selected for processing (1)
  • .github/workflows/release.yml

📝 Walkthrough

Walkthrough

The PR updates the Helm chart push step in the release workflow by redirecting stderr to stdout during output capture. This ensures that when Helm 3.16+ emits "Pushed:" and "Digest:" messages to stderr, they are included in the captured push_output variable so that subsequent parsing logic can reliably extract the sha256 digest.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: capturing stderr when parsing helm push output, which is the core fix in the changeset.
Description check ✅ Passed The description is directly related to the changeset, explaining the root cause (helm 3.16+ writes to stderr), the fix applied (stderr redirection), and the test plan to verify it works.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/release-helm-push-stderr

Comment @coderabbitai help to get the list of available commands and usage tips.

lockwobr pushed a commit that referenced this pull request May 22, 2026
* fix(ci): capture stderr when parsing helm push output (#249)

`helm push` (3.16+) writes the human-readable "Pushed:" and "Digest:"
lines to stderr, so the existing `$(helm push ...)` only captured an
empty stdout and the awk that extracts the digest produced no match.
Redirect stderr into stdout for the command substitution so the
digest-parser sees the same output that's already visible in the
runner log. The follow-up `sha256:[a-f0-9]{64}` regex check still
guards against malformed input.

Surfaced when publishing chart/v0.16.0 to oci://ghcr.io/nvidia/nodewright/charts:
the push itself succeeded, but the subsequent attestation steps failed
because no digest was extracted.

Signed-off-by: Alex Yuskauskas <ayuskauskas@nvidia.com>

* fix(chart): agent container path pointing to skyhook not nodewright

---------

Signed-off-by: Alex Yuskauskas <ayuskauskas@nvidia.com>
lockwobr pushed a commit that referenced this pull request May 22, 2026
…253)

`helm registry login` writes to helm's own config
(~/.config/helm/registry/config.json), which cosign doesn't read.
After `helm push` succeeds, the subsequent `cosign sign` against the
just-published OCI subject fails with `UNAUTHORIZED: unauthenticated`
because cosign reads ~/.docker/config.json instead.

Add a docker/login-action step alongside the helm registry login (same
pattern operator-ci.yaml uses for signing operator images) so cosign
can upload the .sig layer and the cyclonedx SBOM attestation to the
same ghcr.io repository.

Surfaced when publishing chart/v0.16.0 once the prior `helm push` stderr
parsing fix (PR #249) let the workflow reach the cosign step.

Signed-off-by: Alex Yuskauskas <ayuskauskas@nvidia.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.

2 participants