Repository navigation
ci: release the chart from version tags - #234
Conversation
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]>
Reviewer's GuideIntroduces 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 releasesequenceDiagram
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
State diagram for draft and immutable chart releasesstateDiagram-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 --> [*]
Flow diagram for the Helm chart release pipelineflowchart 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]
File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
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]>
There was a problem hiding this comment.
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. |
Summary
Adds
.github/workflows/release.yml(Release). It releases the Helm chart fromv*tags, with tagvX.Y.Zreleasing chart version X.Y.Z, as decided. There are notesk-<version>orchart-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-pagesindex.The
gh-pagesbranch, the Helm repository at https://elixir-cloud-aai.github.io/TESK/, and the old releasestesk-0.1.0andtesk-0.1.1are left untouched. The new workflow does not update that index.docs/development.mdsays 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 onmain(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:vX.Y.Z, or-alpha.N,-beta.N,-rc.N).versionincharts/tesk/Chart.yamlandversionanddate-releasedinCITATION.cff.It then lints, renders and installs the chart through the composite actions that CI uses, and packages the chart.
Publish release (
publish), in environmentreleaseafter approval:cosign sign-blob --bundle).v0.2. Publish jobs of different tags run one at a time, so each sees the releases published before it.latest: only if it is the highest stablev*tag onmain.docs/development.mdgets a "Releases" section:Closes #222
Verification
actionlinton all workflows: pass.mkdocs build --strict: pass.latestchoice over paginated release lists.Review
Full review, because this is a release workflow: adversarial-reviewer and quality-reviewer, 2 rounds, no high findings.
Fixed:
--signer-workflow,--source-ref, exact cosign identity).latestonly for the highest stable tag onmain.git tagfailures fail the step.gh-pagesrepository.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.2is a published release, so no hard-coded fallback is needed; a failing list request fails the step underbash -e; there is no OCI publishing, by decision (#222's text now says so).Declined review findings
development.md. The rewritten deployment guide in docs: revise the documentation content #225 covers released charts and links to this section.User actions
releasewith required reviewers, limited tov*tags. The environment exists already; I didn't change it.github-pagesenvironment isn't needed by this workflow.v0.0.1tov0.2exist and are immutable.gh-pages(index.yamlwith 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