Skip to content

ci: release the chart from version tags - #234

Merged
uniqueg merged 4 commits into
devfrom
ci/release
Nov 6, 2026
Merged

uniqueg merged 4 commits into
devfrom
ci/release

Conversation

@uniqueg

@uniqueg uniqueg commented Nov 6, 2026 •

Copy link
Copy Markdown
Member

Summary

Adds .github/workflows/release.yml (Release). It releases the Helm chart from v* tags, with tag vX.Y.Z releasing chart version X.Y.Z, as decided. There are no tesk-<version> or chart-v* tags any more.

Where the chart is published

The chart is attached to the GitHub release of its tag, with a Sigstore bundle and a GitHub artifact attestation, the same way cloud-registry and proTES attach theirs. There is no OCI registry and no gh-pages index.

The gh-pages branch, the Helm repository at https://elixir-cloud-aai.github.io/TESK/, and the old releases tesk-0.1.0 and tesk-0.1.1 are left untouched. The new workflow does not update that index. docs/development.md says so.

Jobs

  • Prepare release (prepare). It first checks the tag, before any file of the tagged commit is read or run: annotated, named as pushed, with a signature GitHub verified, pointing to the checked-out commit, and on main (step "Check release tag and commit", the only one with the token). This is the order of Pubgrade-Sidecar, not the older one of cloud-registry and proTES. It then checks:

    • The tag is SemVer (vX.Y.Z, or -alpha.N, -beta.N, -rc.N).
    • It matches version in charts/tesk/Chart.yaml and version and date-released in CITATION.cff.
    • CI passed for a push of that commit.

    It then lints, renders and installs the chart through the composite actions that CI uses, and packages the chart.

  • Publish release (publish), in environment release after approval:

    • Attests provenance and signs the chart (cosign sign-blob --bundle).
    • Finds the previous release: the highest published version in the commit's history, for a stable release among stable ones only. For the first release, that is v0.2. Publish jobs of different tags run one at a time, so each sees the releases published before it.
    • Decides whether this release becomes latest: only if it is the highest stable v* tag on main.
    • Creates the GitHub release as a draft, uploads the chart and the bundle, then publishes it with generated notes.
    • On a re-run, it completes a leftover draft. If the release is already published, it only checks that both files are present.

docs/development.md gets a "Releases" section:

  • The version scheme.
  • The repository settings the workflow relies on.
  • The release steps, with commands.
  • How to verify and install a released chart. The verification pins the release workflow and tag.

Closes #222

Verification

  • actionlint on all workflows: pass.
  • mkdocs build --strict: pass.
  • Scratch tests of the shell logic:
    • Release lookup, duplicate and asset checks, and the latest choice over paginated release lists.
    • Choice of the previous release in a scratch git repository: stable after a release candidate, release candidates, and first release.
  • Not tested end to end. Before the first release, a dry run in a fork on a test tag is recommended. It would cover the environment approval, the attestation, the signing, and the draft, upload and publish sequence under immutable releases.
  • CI: all jobs pass; the Read the Docs preview builds.

Review

Full review, because this is a release workflow: adversarial-reviewer and quality-reviewer, 2 rounds, no high findings.

Fixed:

  • Exact verification identity (--signer-workflow, --source-ref, exact cosign identity).
  • Lookup of the tag's release among all releases, drafts included, with a duplicate check.
  • An asset check on an already published release.
  • Notes since an explicit previous release, decided after approval.
  • Stable releases take their notes since the last stable release.
  • latest only for the highest stable tag on main.
  • Title, flags and current notes are applied when a draft is completed.
  • git tag failures fail the step.
  • Timeout and wording fixes, and documented repository settings and the old gh-pages repository.

Sourcery

There were nine threads, all answered and resolved. Fixed in f46fef3: serialized publish jobs, an explicit refresh of origin/main, previous release by version rather than date, a paginated release list. Answered: v0.2 is a published release, so no hard-coded fallback is needed; a failing list request fails the step under bash -e; there is no OCI publishing, by decision (#222's text now says so).

Declined review findings

  • Install and verify instructions belong in the deployment guide, not only in development.md. The rewritten deployment guide in docs: revise the documentation content #225 covers released charts and links to this section.

User actions

  • Configure environment release with required reviewers, limited to v* tags. The environment exists already; I didn't change it.
  • Repository settings stay as they are: the tag rulesets and immutable releases are already in place. The github-pages environment isn't needed by this workflow.
  • The next chart version must be above 0.2 (for example 0.3.0), because tags v0.0.1 to v0.2 exist and are immutable.
  • The Helm repository on gh-pages (index.yaml with 0.1.0 and 0.1.1) is no longer updated. Decide whether to keep it as is, or to note on it that newer charts are on GitHub releases.

Open questions

None.

🤖 Generated with Claude Code

uniqueg and others added 3 commits November 6, 2026 06:43
Add release.yml: on v* tags, check the tag (SemVer, annotated, signed,
on main), that it matches the chart version and CITATION.cff, and that
CI passed for the commit; test, install and package the chart; after
approval in the release environment, attest and sign it and attach it
to a GitHub release, created as a draft and then published. Document
the release steps in docs/development.md.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Find the release of the tag among all releases, drafts included, and
fail on duplicates or on a published release that lacks its files.
Generate the notes since the previous published release, set latest
only for the highest stable version, and cut the prepare timeout to
30 minutes. Document pre-release tags, the old gh-pages Helm repo,
the required repository settings, and verification that pins the
release workflow and tag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Find the previous release and whether the release becomes latest in
the publish job, after the approval: stable releases take the notes
since the last stable release, latest compares with the stable tags
on main, and a resumed draft gets current notes, title and flags.
Read the tags into a file so that a failing git fails the step, and
restore the 45-minute timeout of prepare (chart and install).

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

sourcery-ai Bot commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Reviewer's Guide

Introduces a controlled release pipeline for Helm charts published as immutable GitHub release assets from signed SemVer tags, with CI validation, maintainer approval, provenance and Sigstore verification, resilient draft handling, and comprehensive release documentation.

Sequence diagram for publishing a Helm chart release

sequenceDiagram
    participant Tag as Signed release tag
    participant Prepare as prepare job
    participant Maintainer
    participant Publish as publish job
    participant GitHub as GitHub Releases
    participant Sigstore

    Tag->>Prepare: Trigger Release workflow
    Prepare->>Prepare: Validate tag, metadata, main, and CI
    Prepare->>Prepare: Test, install, and package chart
    Prepare-->>Publish: Upload chart artifact
    Publish->>Maintainer: Request release environment approval
    Maintainer-->>Publish: Approve release
    Publish->>Sigstore: Attest provenance and sign chart
    Publish->>GitHub: Create or resume draft release
    Publish->>GitHub: Upload chart and Sigstore bundle
    Publish->>GitHub: Publish release with generated notes
Loading

State diagram for draft and immutable chart releases

stateDiagram-v2
    [*] --> Prepared: prepare succeeds
    Prepared --> AwaitingApproval: publish starts
    AwaitingApproval --> Draft: approval granted
    Draft --> Draft: rerun completes leftover draft
    Draft --> Published: assets uploaded and release published
    Published --> Published: rerun verifies chart and bundle
    Published --> [*]
Loading

Flow diagram for the Helm chart release pipeline

flowchart LR
    Tag[Signed annotated vX.Y.Z tag] --> Prepare[Prepare release]
    Prepare --> Checks[Validate SemVer, versions, main, and CI]
    Checks --> Tests[Test, install, and package chart]
    Tests --> Approval{Release environment approval}
    Approval --> Publish[Attest provenance and sign chart]
    Publish --> Draft[Create or resume GitHub release draft]
    Draft --> Assets[Upload chart and Sigstore bundle]
    Assets --> Release[Publish immutable GitHub release]
Loading

File-Level Changes

Change Details Files
Add a tag-driven, gated GitHub Actions workflow that validates, tests, packages, signs, attests, and publishes Helm chart releases.
  • Trigger releases from SemVer v* tags and verify annotation, GitHub signature, main ancestry, chart/Citation versions, and successful CI.
  • Reuse chart lint/render/install composite actions, then package and checksum the chart as a job artifact.
  • Require approval through the release environment before provenance attestation, Sigstore signing, and GitHub release publication.
  • Handle previous-release note generation, stable/latest selection, immutable draft upload/publish flow, reruns, duplicate releases, and asset validation.
.github/workflows/release.yml
.github/actions/test-chart/action.yml
.github/actions/install-chart/action.yml
Document the new GitHub-release distribution model and maintainer release procedure.
  • Define supported chart/tag versions, legacy gh-pages behavior, required repository settings, and the prepare/publish workflow.
  • Document version preparation, signed tag creation, approval, reruns, released-chart installation, attestation verification, and Sigstore verification.
docs/development.md

Possibly linked issues


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

@codecov

codecov Bot commented Nov 6, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (e1ec1db) to head (f46fef3).

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #234   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files            1         1           
  Lines          199       199           
=========================================
  Hits           199       199           

☔ 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.

@uniqueg
uniqueg marked this pull request as ready for review November 6, 2026 05:46

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hey - I've found 9 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="243-247" />
<code_context>
+          fi
+          latest=false
+          if [[ "${PRERELEASE}" != "true" ]]; then
+              highest="$(git tag -l 'v*' --merged origin/main \
+                  | { grep -E "${stable_re}" || true; } \
+                  | { cat; echo "${TAG}"; } | sort -V | tail -n 1)"
+              if [[ "${highest}" == "${TAG}" ]]; then
+                  latest=true
+              fi
+          fi
</code_context>
<issue_to_address>
**Older release is marked latest**

When a higher stable tag reaches `main` after the latest check but before this release is edited, `LATEST` keeps the result of the earlier tag snapshot, so `gh release edit` marks this lower version as latest even though the higher stable tag is on `main`.

Recheck the highest stable tag and apply the latest status in a way that prevents another version run from publishing a higher tag between that check and the edit.

Also at `.github/workflows/release.yml:30`, `.github/workflows/release.yml:303`, `.github/workflows/release.yml:340-341`.
</issue_to_address>

### Comment 2
<location path=".github/workflows/release.yml" line_range="219-220" />
<code_context>
+          git fetch --tags --force origin main
+          published="$(mktemp)"
+          tags="$(mktemp)"
+          gh release list --limit 1000 --exclude-drafts --json tagName --jq '.[].tagName' > "${published}"
+          git tag -l 'v*' --merged HEAD --sort=-creatordate > "${tags}"
+          stable_re='^v[0-9]+\.[0-9]+\.[0-9]+$'
+          # Tags of pre-releases; older tags such as `v0.2` count as stable
</code_context>
<issue_to_address>
**Release notes repeat covered changes**

When publish jobs for two versions in the same release history overlap and the later job scans releases before the earlier one is published, `previous` is selected from a list that omits the earlier release, so the later release's notes include changes already covered by that release.

Serialize these publish jobs or refresh the published-release list before selecting `previous` for the later release.

Also at `.github/workflows/release.yml:30-31`, `.github/workflows/release.yml:227`, `.github/workflows/release.yml:325`.
</issue_to_address>

### Comment 3
<location path=".github/workflows/release.yml" line_range="220" />
<code_context>
+          published="$(mktemp)"
+          tags="$(mktemp)"
+          gh release list --limit 1000 --exclude-drafts --json tagName --jq '.[].tagName' > "${published}"
+          git tag -l 'v*' --merged HEAD --sort=-creatordate > "${tags}"
+          stable_re='^v[0-9]+\.[0-9]+\.[0-9]+$'
+          # Tags of pre-releases; older tags such as `v0.2` count as stable
</code_context>
<issue_to_address>
**Release notes use an older baseline**

When an older patch tag has a later tagger timestamp than a newer stable tag in the release commit's ancestry, `git tag --sort=-creatordate` puts the older tag first, so the loop selects it as `previous` and the notes repeat changes covered by the newer release.

Order candidate tags by their position in commit history rather than by tagger timestamp.

Also at `.github/workflows/release.yml:230`.
</issue_to_address>

### Comment 4
<location path=".github/workflows/release.yml" line_range="227-239" />
<code_context>
+          previous=""
+          pre=""
+          while IFS= read -r tag; do
+              if [[ "${tag}" == "${TAG}" ]] || ! grep -qxF -- "${tag}" "${published}"; then
+                  continue
+              fi
+              if [[ "${PRERELEASE}" == "true" || ! "${tag}" =~ ${pre_re} ]]; then
+                  previous="${tag}"
+                  break
+              fi
+              if [[ -z "${pre}" ]]; then
+                  pre="${tag}"
+              fi
+          done < "${tags}"
+          if [[ -z "${previous}" ]]; then
+              previous="${pre}"
+          fi
+          latest=false
</code_context>
<issue_to_address>
**Release notes use the wrong baseline**

When the `v0.2` tag exists but has no published GitHub release, the loop leaves `previous` empty because its fallback only uses a pre-release tag, so the notes request omits `previous_tag_name` and GitHub chooses its own baseline instead of `v0.2`.

Use `v0.2` as the fallback baseline when no published release provides `previous`.

Also at `.github/workflows/release.yml:328-330`.
</issue_to_address>

### Comment 5
<location path=".github/workflows/release.yml" line_range="230" />
<code_context>
+              if [[ "${tag}" == "${TAG}" ]] || ! grep -qxF -- "${tag}" "${published}"; then
+                  continue
+              fi
+              if [[ "${PRERELEASE}" == "true" || ! "${tag}" =~ ${pre_re} ]]; then
+                  previous="${tag}"
+                  break
</code_context>
<issue_to_address>
**Pre-release notes use the wrong baseline**

When a new pre-release is published after a stable release that itself followed an earlier published pre-release, the condition accepts the newest published tag regardless of whether it is a pre-release, so `previous` can point to a stable release instead of the most recent pre-release. GitHub then generates notes from that stable tag, omitting changes since the pre-release baseline from the stored release notes.

For pre-releases, select the most recent published pre-release tag, falling back to the first-release baseline when none exists.
</issue_to_address>

### Comment 6
<location path=".github/workflows/release.yml" line_range="219" />
<code_context>
+          git fetch --tags --force origin main
+          published="$(mktemp)"
+          tags="$(mktemp)"
+          gh release list --limit 1000 --exclude-drafts --json tagName --jq '.[].tagName' > "${published}"
+          git tag -l 'v*' --merged HEAD --sort=-creatordate > "${tags}"
+          stable_re='^v[0-9]+\.[0-9]+\.[0-9]+$'
</code_context>
<issue_to_address>
**Transient API failures produce wrong notes**

When the release-list API request fails transiently while later GitHub API requests succeed, `gh release list` exits nonzero, but the script does not check its status or validate the output before selecting `previous`; if the later notes request succeeds, it generates and publishes notes without the intended previous-release boundary.

Retry the release-list request or fail the job when it fails, before calculating release notes.
</issue_to_address>

### Comment 7
<location path=".github/workflows/release.yml" line_range="219" />
<code_context>
+          git fetch --tags --force origin main
+          published="$(mktemp)"
+          tags="$(mktemp)"
+          gh release list --limit 1000 --exclude-drafts --json tagName --jq '.[].tagName' > "${published}"
+          git tag -l 'v*' --merged HEAD --sort=-creatordate > "${tags}"
+          stable_re='^v[0-9]+\.[0-9]+\.[0-9]+$'
</code_context>
<issue_to_address>
**Stable notes use the wrong base**

When more than 1,000 newer releases push the previous stable release outside the list, such as after an unusually long pre-release cycle, the 1,000-item list omits older published releases; if more than 1,000 newer pre-releases exist since the last stable release, the stable-release scan cannot find that stable base and falls back to a pre-release, so generated notes omit changes since the last stable release.

Paginate through published releases until the required previous stable release is found.
</issue_to_address>

### Comment 8
<location path=".github/workflows/release.yml" line_range="216" />
<code_context>
+          PRERELEASE: ${{ needs.prepare.outputs.prerelease }}
+        run: |
+          set -o pipefail
+          git fetch --tags --force origin main
+          published="$(mktemp)"
+          tags="$(mktemp)"
</code_context>
<issue_to_address>
**Older release can become latest**

When a higher stable tag reaches `main` after the publish job checks out the repository but before this step runs, `git fetch origin main` fetches `main` to `FETCH_HEAD` without refreshing `origin/main`, which the `latest` calculation reads at line 243. The calculation can therefore miss a higher stable tag and mark this release as latest.

Fetch `main` explicitly into `refs/remotes/origin/main` before calculating the latest release.
</issue_to_address>

### Comment 9
<location path="docs/development.md" line_range="178-190" />
<code_context>
+completes a draft that a failed run left. If the tagged commit is wrong,
+release a new version instead.
+
+To install a released chart, download it from the release, check that the
+release workflow built and signed it from the release tag, and install it:
+
+```bash
+gh release download vX.Y.Z --repo elixir-cloud-aai/TESK --pattern 'tesk-*'
+gh attestation verify tesk-X.Y.Z.tgz --repo elixir-cloud-aai/TESK \
+    --signer-workflow elixir-cloud-aai/TESK/.github/workflows/release.yml \
+    --source-ref refs/tags/vX.Y.Z
+cosign verify-blob tesk-X.Y.Z.tgz --bundle tesk-X.Y.Z.tgz.sigstore.json \
+    --certificate-identity https://github.com/elixir-cloud-aai/TESK/.github/workflows/release.yml@refs/tags/vX.Y.Z \
+    --certificate-oidc-issuer https://token.actions.githubusercontent.com
+helm install tesk tesk-X.Y.Z.tgz --namespace tesk --create-namespace
+```
</code_context>
<issue_to_address>
**OCI install docs missing**

The issue asks for OCI installation instructions in the deployment docs. These added instructions instead download and install a chart from a GitHub release, and the deployment guide is not updated with OCI instructions.
</issue_to_address>

Linked issues

#222 ci: release charts from v* tags · 3 of 6 met · 1 to check by hand

# Requirement Status Notes
1 Release only from signed v* tags, after approval in the release environment. 👀 Check by hand (external system) Verify that the repository's release environment actually requires reviewers and is restricted to v* tags; the workflow names the environment but those protections are repository settings.
2 Validate the tag, chart version, main branch, and successful CI run, then lint, render, and install the chart. ✅ Met The prepare job checks these conditions and uses the chart test and install composite actions.
3 Package and publish the chart to the OCI registry, attest and sign it, and attach it to the GitHub release. 🟡 Partly met The workflow packages, attests, signs, and attaches the chart to a GitHub release, but does not publish it to an OCI registry.
4 Document the release process in development docs. ✅ Met The new Releases section describes versioning, repository settings, release steps, and verification.
5 Document installing from the OCI registry in deployment docs. ❌ Not addressed The deployment guide has no OCI install instructions; the added install example downloads a chart from a GitHub release instead.
6 Leave the existing gh-pages Helm repository and its published charts as they are. ✅ Met The workflow does not update the gh-pages index, and the new documentation says the existing releases remain unchanged.

Sourcery assessment

Needs a human reviewer. 9 findings to address first, and if the workflow packages or publishes the wrong chart, it can become an immutable, signed release that consumers download and install; reverting the workflow will not withdraw that artifact or undo installations. CI checks and required approval reduce the chance, but do not reverse a published release.

Blocking findings: .github/workflows/release.yml:247, .github/workflows/release.yml:220, .github/workflows/release.yml:220, .github/workflows/release.yml:239, .github/workflows/release.yml:230, and 4 more


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

Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread .github/workflows/release.yml Resolved
Comment thread docs/development.md Resolved
Check that the tag is annotated, signed, verified and on main before
any file of the tagged commit is read; derive the version from the tag
and the chart in a following step without the token. Pick the previous
release by version among published releases (all pages), run publish
jobs one at a time, and refresh origin/main before deciding latest
(Sourcery review, coordinator).

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

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Linked issues

#222 ci: release charts from v* tags · 2 of 5 met · 1 to check by hand

# Requirement Status Notes
1 Run chart checks only from signed, annotated v* tags on main that match the chart version and have passing CI. ✅ Met The prepare job validates the tag signature, commit, version, and CI status, then runs the chart test and install actions.
2 Release in the release environment after approval. 👀 Check by hand (external system) Verify that the repository's release environment requires reviewer approval and is restricted to v* tags; the workflow names the environment, but those protections are configured outside this diff.
3 In the release environment, check that the version is not already published, package the chart, push it to OCI, attest and sign it, and attach it to a GitHub release. 🟡 Partly met The workflow checks for an existing GitHub release, packages the chart before the approval-gated publish job, and attests, signs, and attaches it; it does not push the chart to the requested OCI registry.
4 Document the release process in the development docs. ✅ Met The new Releases section documents the version scheme, settings, and release steps.
5 Document installing from the OCI registry in the deployment docs. ❌ Not addressed The added installation instructions download the chart from a GitHub release; they do not document installing from OCI in the deployment docs.

Comment thread .github/workflows/release.yml Resolved
@uniqueg
uniqueg merged commit c20e666 into dev Nov 6, 2026
28 checks passed
@uniqueg
uniqueg deleted the ci/release branch November 6, 2026 06:00
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.

ci: release charts from v* tags

1 participant