Skip to content

build: package the Helm chart in releases - #95

Merged
AnonymousXC merged 15 commits into
devfrom
build/94-chart-release
Nov 16, 2026
Merged

AnonymousXC merged 15 commits into
devfrom
build/94-chart-release

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 15, 2026 •

Copy link
Copy Markdown
Member

Summary

The release workflow now packages the Helm chart and attaches it to the GitHub release, following cloud-registry's pattern.

#92, which this PR was stacked on, is squash-merged into dev. dev is merged into this branch (no rebase). Where the merge conflicted in #92's files, the resolution takes dev's version and re-applies this PR's own changes on top. The diff against dev now has exactly the files and changed lines of this PR's own diff before the merge.

  • prepare packages deployment/ with scripts/package-chart.sh:
    • version and appVersion both come from the tag.
    • The default image is IMAGE_NAME, so a fork with DOCKERHUB_ORG packages a chart that deploys its own image.
    • The package is checked with helm lint --strict and a render with the CI values (version, appVersion, krini.image, rendered image).
    • The job records the chart's file name and SHA-256 and uploads it as an artifact.
  • release-image checks the artifact against those records (scripts/check-chart-artifact.sh) before it signs anything. After signing the image, it attests the chart's provenance and signs it with cosign sign-blob (Sigstore bundle). It tags the image only after that, so a failed signing leaves the image untagged. It records the bundle's SHA-256.
  • publish (still only contents: write) checks the chart and the bundle against the recorded checksums. It then attaches both via the new assets input of the shared publish-release action.
  • Immutable releases: assets can't be added after publishing. The action therefore passes the files to gh release create, which creates a draft, uploads them, publishes the release, and deletes the draft if anything fails.
  • deployment/Chart.yaml keeps its placeholders (0.0.0 / dev). The tag is the only source of the version.
  • CI: the chart job also runs deployment/tests/test-package.sh. Its 41 tests cover packaging, forks, invalid arguments, a package that fails the script's own checks, and the artifact check.
  • Docs:
    • The operator guide installs and upgrades from the release asset, without a checkout or krini.tag, and has a new section "Verifying the chart" (gh attestation verify, cosign verify-blob).
    • releasing.md describes the packaging, adds it to the pre-tag checks, and notes the placeholders.
    • The README quick start, Upgrading, the chart README and the comments in values.yaml are updated.

Closes #94

Uses elixir-cloud-aai/.github v1.2.0

The assets input comes from elixir-cloud-aai/.github v1.2.0 (elixir-cloud-aai/.github#77, elixir-cloud-aai/.github#79). release.yml (2×), the readiness checker in ci.yml and docs/development/releasing.md pin its release commit bf3840c9c072aaf37d6cafe199aaa1994087d1ef # v1.2.0.

Relation to #99

#99 (end-to-end tests on the image, #79) also changes release.yml and docs/development/releasing.md: it adds an e2e job that release-image needs. In a test merge, the jobs and needs merge cleanly (needs: [prepare, push, smoke, e2e, scan]). Two text conflicts remain: the header comment of release.yml and the paragraph on approving the release jobs in releasing.md. Whichever PR merges second resolves them by naming both changes: the end-to-end tests next to the smoke test, and the chart signing before the image tag.

Verification

  • After merging dev, with Helm 3.22.1:
    • deployment/tests/test-package.sh → 41 tests, 0 failures.
    • deployment/tests/test-chart.sh → 99 tests, 0 failures.
    • helm lint deployment --strict -f deployment/ci/test-values.yaml → passed.
    • deployment/tests/install-chart.sh on a kind cluster, with the image built from the merged commit → ready, helm test passed, upgraded to 2 replicas.
  • Static checks:
    • actionlint (with shellcheck) and shellcheck on the scripts → clean.
    • mkdocs build --strict → clean.
    • Biome, tsc --noEmit and the unit tests (259 passed, 100% coverage) → clean.
  • Local dry run of the chart steps (before the merge, from a git archive of the commit):
    • Package chart with 0.1.0 and elixircloud, then 0.1.0-rc1 with a fork image.
    • Then the release-image and publish artifact checks, with a stand-in bundle.
    • The packaged chart renders the right image, and the repository's Chart.yaml stays 0.0.0 dev.
  • Fork dry run on a test tag (v0.0.1-rc1 in uniqueg/krini): in progress with the maintainer, from a bundle rebuilt on dev at 0363f87. It is the only way to test the workflow wiring between jobs and the release created with assets.
  • Reviews: adversarial and quality review before and after the merge, with no high findings. After the merge, the quality review's medium findings were fixed (negative packaging test) or declined (below). The low findings are fixed: the krini.tag note in Upgrading, and sha256sum in the pre-tag prerequisites.
  • Sourcery:
    • A cancelled Publish release leaves a draft of the tag, and a re-run then fails on it. That behaviour is in the shared action, so 49357d2 documents the recovery in releasing.md: delete the draft without --cleanup-tag, then re-run the failed jobs.
    • Declined: the README placeholder <version>, because the quick start uses angle-bracket placeholders throughout.
  • CI: green on 63cef63 (the first run into dev) and on 49357d2, including Chart (with test-package.sh), Chart install and CI passed.

Declined review findings

  • Version regex in three places (release.yml, scan.yml, scripts/package-chart.sh; medium). prepare in release.yml is the authority. scan.yml already had a copy before this PR, and the script checks again as defence in depth, which its header says. A shared snippet would change scan.yml, which is beyond build: package the Helm chart in releases #94.
  • Workflow wiring untested locally (medium). The fork dry run above covers it, before the first release.
  • Release the .github change before this PR (medium, earlier round). Resolved: v1.2.0 is released and the pins point to it.
  • Docs name 0.1.0 as the first release with a chart. 0.1.0 is the planned first release, so this is accurate.
  • The Helm version is named in releasing.md besides ci.yml and release.yml. Kept, because the pre-tag checks need the same version.
  • The releasing.md pre-tag command names docker.io/elixircloud/krini. Forks are told right next to it to use their own image.
  • Merge assert_check and assert_fails in test-package.sh. Kept separate: they run different commands and are short.

🤖 Generated with Claude Code

uniqueg and others added 10 commits November 15, 2026 18:25
Add a chart in deployment/ for Kubernetes and OpenShift: Deployment,
Service, and an Ingress, Gateway API HTTPRoute or OpenShift Route, with
an optional NetworkPolicy and PodDisruptionBudget. Settings come from
camelCase values, the login providers only from an existing Secret;
rendering fails without host, registry or Secret. The pod runs
non-root with a read-only root file system; on OpenShift, user IDs and
the seccomp profile are left to the cluster.

CI lints and tests the chart (job chart) and installs it on kind with
helm test (job chart-install); both are in the gate's needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Add "Helm chart" to the operator guide: installation from a release's
checkout, the login providers' Secret and its fields, all values,
exposing Krini, security on Kubernetes and OpenShift, upgrades and the
chart tests. Link it from the README's quick start, the deployment and
upgrade pages.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Admit the helm test pod through the NetworkPolicy.
- No default ClusterIssuer: it's specific to a cluster.
- Standard labels on pods; the version label follows krini.tag.
- One helper for the port; value checks in their own template.
- Run the ERR trap of the install script inside functions too.
- Document that OpenShift needs the Ingress disabled for the Route,
  and the annotations and security contexts; more chart tests.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Allow `global` again, so that the chart works as a subchart.
- Take the version label from krini.tag or the tag in krini.image,
  leave it out for digests, and keep it a valid label value.
- Warn in the notes when OpenShift would serve the Ingress without TLS.
- Check all labels of the test pod against the NetworkPolicy; rewrap.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Reject NetworkPolicy peers without selectors, and drop the label-based
  exception for the helm test pod (labels can be forged).
- APP_ORIGIN must be an https origin, the privacy URLs https URLs, and
  /tmp's limit positive.
- Document that several replicas need sticky sessions (refresh guard is
  per pod), the service prerequisites, the test pod after uninstall, and
  a provider example in the README.
- Wait for the namespace deletion in the install script.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
scripts/package-chart.sh packages deployment/ for a release: version
and appVersion are the release version, and the default image is the
release workflow's image (also for forks with DOCKERHUB_ORG). The
chart in the repository keeps its placeholders. The package is checked
with helm lint --strict and a render with the CI values, and the script
prints its file name and SHA-256 for GITHUB_OUTPUT.

deployment/tests/test-package.sh tests it, and the chart job of CI
runs the tests. The readiness job's checker moves to the commit of
the publish-release action that release.yml pins next.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
prepare packages the chart with the version from the tag
(scripts/package-chart.sh) and records its file name and SHA-256;
release-image checks the artifact against them before it signs the
image, and attests and signs the chart (Sigstore bundle) after
tagging the image; publish checks the chart and the bundle and
attaches both to the GitHub release.

Immutable releases can't get assets after publishing, so publish
uses the new assets input of the shared publish-release action, which
creates a draft, uploads the files and publishes it last. The action
is pinned to an unreleased commit until its next release.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The operator guide installs and upgrades from the chart attached to
the release (no checkout, no krini.tag), and describes how to verify
it with gh attestation verify and cosign verify-blob. releasing.md
describes the packaging, runs it in the pre-tag checks, and says that
Chart.yaml keeps its placeholders. The README quick start, Upgrading,
the chart README and the comments in Chart.yaml and values.yaml
follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review fixes: scripts/check-chart-artifact.sh replaces the two copies
of the artifact check in release-image and publish, with tests in
test-package.sh (also new: alpha/beta versions, a registry port, an
upper-case image). release-image now attests and signs the chart
before it tags the image, so that a signing failure leaves no tagged
image without a signed chart. The publish-release pin moves to the
action's commit with the asset name and digest checks; docs wording.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Second review round: the workflow header and releasing.md say that
the chart is signed before the image is tagged; two more tests of the
artifact check; the publish-release pin moves to the action's latest
commit.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel

vercel Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
krini Ready Ready Preview Nov 16, 2026 10:30am UTC

@sourcery-ai

sourcery-ai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Uses of the API

Package and validate a versioned Helm chart, then verify the chart and signature artifacts across the release jobs before publishing them.

  • .github/workflows/release.yml L176-200, L436-459, L541-568 (+7 small edits)
  • scripts/check-chart-artifact.sh L1-47
  • scripts/package-chart.sh L1-82

UI

Switch operator installation and upgrades to release chart assets and document how to verify their attestation and Sigstore signature.

  • README.md L66-71, L76-81
  • docs/operator-guide/helm-chart.md L84-99, L344-353, L360-387 (+6 small edits)
  • docs/operator-guide/upgrading.md L13-17

Configuration

Keep repository chart metadata as development placeholders and make the image-tag default clearly distinguish release packages from the development chart.

  • deployment/Chart.yaml L7-11
  • deployment/values.yaml L71-73

Add packaging and artifact-integrity checks to CI and pin the release-note checker to the shared action version used by releases.

  • .github/workflows/ci.yml L336-338, L358-360, L666

Documentation

Explain release chart packaging, pre-tag validation, signing and publication, including recovery from a leftover draft.

  • docs/development/releasing.md L8-20, L145-152, L169-176 (+4 small edits)

Update the deployment README to distinguish the release package from the placeholder development chart and list the packaging test.

  • deployment/README.md L11-14, L20-21

Tests

Exercise release packaging, fork image defaults, invalid inputs, package validation, and exact artifact integrity checks.

  • deployment/tests/test-package.sh L1-177

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@read-the-docs-community

read-the-docs-community Bot commented Nov 15, 2026 •

Copy link
Copy Markdown

Documentation build overview

📚 krini | 🛠️ Build #35923673 | 📁 Comparing 49357d2 against latest (b610d7e)

  🔍 Preview build  

6 files changed · + 1 added · ± 5 modified

+ Added

± Modified

Move the four pins of the shared publish-release action from the
unreleased branch commit to the released v1.2.0 of
elixir-cloud-aai/.github.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – krini November 15, 2026 23:40 Inactive
Base automatically changed from feat/52-helm-chart to dev November 16, 2026 04:30
@codecov

codecov Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (0363f87) to head (49357d2).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev       #95   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           20        20           
  Lines          566       566           
  Branches       161       161           
=========================================
  Hits           566       566           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

uniqueg and others added 3 commits November 16, 2026 10:43
#92 is squash-merged into dev. Conflicts in its files are resolved to
dev's version, with this branch's own changes re-applied on top, so the
diff against dev holds only the changes of #94.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A fake helm on PATH packages the chart with another appVersion than
asked for, so the test covers the checks of the package in
scripts/package-chart.sh, not only its arguments and success.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Upgrading says that a krini.tag in the values pins the old image, and
the local pre-tag checks list sha256sum, which package-chart.sh needs.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – krini November 16, 2026 10:20 Inactive
@uniqueg
uniqueg marked this pull request as ready for review November 16, 2026 10:24
@uniqueg
uniqueg requested a review from AnonymousXC as a code owner November 16, 2026 10:24
@sourcery-ai

sourcery-ai Bot commented Nov 16, 2026 •

Copy link
Copy Markdown

Linked issues

Checked at commit 49357d2

#94 build: package the Helm chart in releases · 4 of 5 met · 1 to check by hand

# Requirement Status Notes
1 Package deployment/ with chart version and appVersion from the tag, and check the packaged chart with lint and render. ✅ Met scripts/package-chart.sh sets both versions from the supplied tag version, then runs helm lint --strict and checks the rendered image.
2 Attach the packaged chart to the GitHub release, following the org's release pattern. ✅ Met The publish job passes the chart and its Sigstore bundle as assets to the shared publish-release action.
3 Keep Chart.yaml placeholders valid for development builds. ✅ Met deployment/Chart.yaml retains version 0.0.0 and appVersion dev; the packaging tests check those repository values.
4 Describe installing from the release asset in the operator docs and docs/development/releasing.md. ✅ Met The operator guide documents downloading, verifying, and installing the release asset; releasing.md documents the packaged chart and pre-tag checks.
5 Dry-run the changed workflow end to end in a fork on a test tag before the 0.1.0 tag. 👀 Check by hand (runtime) The PR description says the fork test-tag dry run is still in progress; confirm that it completed successfully and exercised the release workflow end to end before the 0.1.0 tag.

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path=".github/workflows/release.yml" line_range="566" />
<code_context>
         with:
           notes: docs/releases/${{ needs.prepare.outputs.version }}.md
           commit: ${{ needs.prepare.outputs.sha }}
+          assets: |
+            dist/${{ needs.prepare.outputs.chart_file }}
+            dist/${{ needs.prepare.outputs.chart_file }}.sigstore.json
</code_context>
<issue_to_address>
**Interrupted publishes strand drafts**

When the publish job is canceled or its runner is lost after draft creation but before publication, the publish action leaves the draft behind, and a retry fails on that existing draft instead of completing the release; the release remains unpublished until someone deletes the draft manually.

Make retries detect and safely resume or remove a draft created by the interrupted workflow attempt.
</issue_to_address>

### Comment 2
<location path="README.md" line_range="76-78" />
<code_context>
 kubectl create secret generic krini-login-providers -n <namespace> \
     --from-file=login-providers=login-providers.json
-helm install krini deployment -n <namespace> \
+gh release download v<version> --repo elixir-cloud-aai/krini \
+    --pattern 'krini-<version>.tgz*'
+helm install krini krini-<version>.tgz -n <namespace> \
     --set hostName=krini.example.org \
     --set config.cloudRegistryUrl=https://registry.example.org \
</code_context>
<issue_to_address>
**Quick-start commands fail literally**

When a reader copies the commands without replacing the angle-bracket placeholder, bash treats `<version>` as input redirection rather than part of the release tag or filename, so the download and install commands do not use the chart asset shown in the example.

Define `version` in the snippet and interpolate it in the download pattern and chart filename.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 1 finding to address first, and a packaging or artifact-check error could publish a publicly downloadable, officially signed chart that deploys the wrong image or configuration. Reverting the workflow won't retract a chart already attached to a release; the bounded issue would need a corrected release or asset remediation.

Blocking findings: .github/workflows/release.yml:566


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread .github/workflows/release.yml Resolved
Comment thread README.md Resolved
If Publish release is cancelled after it created the draft, a re-run
fails on the draft. Releasing says to delete the draft without
--cleanup-tag and re-run the failed jobs. Found by Sourcery.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@vercel
vercel Bot temporarily deployed to Preview – krini November 16, 2026 10:30 Inactive
@uniqueg

uniqueg commented Nov 16, 2026

Copy link
Copy Markdown
Member Author

Fork dry run of this release workflow passed (2026-11-16) in uniqueg/krini, with test tag v0.0.1-rc1 and images pushed to docker.io/uniqueg/krini. It ran this PR's workflow merged with dev at 0363f87 (commit 7b71478); the commits since then touch only tests and docs. Run: https://github.com/uniqueg/krini/actions/runs/43850874158

Every job succeeded, through to Publish release. The release, chart package, attestation and signature were checked, and then everything in the fork was cleaned up.

An earlier run (43848394136) pushed the wrong tag because of a mistake in our local commands. The workflow's version check refused it before anything was built or published, which tests that check as well.

From our side this PR is ready for your review, @AnonymousXC.

@AnonymousXC
AnonymousXC merged commit 44da7eb into dev Nov 16, 2026
58 checks passed
@AnonymousXC
AnonymousXC deleted the build/94-chart-release branch November 16, 2026 13:50
uniqueg added a commit that referenced this pull request Nov 19, 2026
Set date-released to 2026-11-19 and reorder the CITATION.cff authors
by lines added on dev (without lock files, public/ and
src/components/ui/, as in #74). Add everything merged since the first
draft to the release notes: TES tasks with the user's token (#90),
the WES run details (#100), the minimal dashboard (#108), the Helm
chart (#92, #95), the image end-to-end tests (#99), the deployment
docs (#101), the Next.js update (#102) and the fixes #109 and #110.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

This branch was previously deployed

1 inactive deployment
Preview – krini — 49357d25 Deployed Nov 16, 2026 by vercel[bot]
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.

build: package the Helm chart in releases

2 participants