Skip to content

ci!: release from signed version tags - #230

Merged
uniqueg merged 12 commits into
devfrom
ci/release-workflow
Oct 23, 2026
Merged

uniqueg merged 12 commits into
devfrom
ci/release-workflow

Conversation

@uniqueg

@uniqueg uniqueg commented Oct 22, 2026 •

Copy link
Copy Markdown
Member

Summary

proTES releases from signed version tags, as cloud-registry does: the version comes only from the tag, and a release workflow publishes the image, the Helm chart and the GitHub release (prereleases until 1.0.0).

  • .github/workflows/release.yaml (on v* tags), with the jobs of cloud-registry's workflow, minus the supply-chain steps:
    • prepare: checks that the tag is a canonical release version (scripts/release_version.py), annotated and signed (verified by GitHub), on main; that CITATION.cff has the release version and date (scripts/citation.py check, from docs: add citation metadata #244); that curated notes (docs/releases/<version>.md) have no TODO; that dependencies are releases (scripts/check_release_pins.py, from build!: require FOCA 0.17 and Python 3.13 #245, so FOCA's dev pin blocks a release); and that CI passed for a push of the commit. Packages the chart with version and appVersion from the tag and versioned README links (scripts/chart_readme.py).
    • push (environment release): builds the image once, pushes it by digest (untagged) and checks that the app reports the release version.
    • publish (environment release): tags exactly that digest X.Y.Z (and latest for the highest stable release on main) and creates or completes the GitHub release with the chart.
    • The push/publish split is the structure of cloud-registry's workflow, so ci: attest, sign and scan published images #234 can add the scan job between them and the attestations and signatures without restructuring.
    • Image name docker.io/${{ vars.DOCKERHUB_ORG || 'elixircloud' }}/protes (a variable, no longer the secret DOCKERHUB_ORG).
  • Dev images (checks.yaml): dev and sha-<commit> instead of latest and the date, only for the head of dev, in the dev-images environment. Breaking: latest is the highest stable release from now on.
  • Chart: version: 0.0.0 and appVersion: "dev" placeholders. The app image is protes.image (default elixircloud/protes) with protes.tag, which defaults to appVersion (helper protes.image). The Celery worker runs the app's image unless celeryWorker.image is set. Images with a tag or digest (e.g. the old elixircloud/protes:latest) still work as they are.
  • release-pins.yaml removed: the release workflow runs the check before publishing, as ci: release from signed version tags #44's comment from build!: require FOCA 0.17 and Python 3.13 #214 asked. The docstrings now refer to the release workflow.
  • Docs: "Versioning and releases" in docs/development.md (release steps, image tags, pre-releases, repository settings), "Image" in the chart README, upgrade notes, and the citation note in docs/contributing.md.

Closes #44

How it was verified

Locally (Python 3.13.15, FOCA 0.16.1.dev16+g29af8a64a, after merging origin/dev with #245):

  • coverage run -m pytest: 416 passed, 1 skipped (test_release_checkout, not a release checkout); coverage report: 100%.
  • pre-commit run --all-files: passed. mkdocs build --strict: passed. actionlint 1.7.12 on all workflows: no findings.
  • python scripts/check_release_pins.py: fails, as intended, on the FOCA dev pin and the dated base image of build!: require FOCA 0.17 and Python 3.13 #245, so no release is possible until FOCA 0.17.0 is pinned.
  • Helm 3.22.1: helm lint deployment passes (only the existing Ingress API deprecation warnings, build(chart)!: use the FOCA library chart #216). helm template checked with the default values (elixircloud/protes:dev for app and worker), protes.tag, images with a tag, a digest or a registry port, the worker's own image and tag, tag: null, and the failures: a tag together with an image that has one, celeryWorker.tag without celeryWorker.image, and unquoted numeric or boolean tags. helm package --version 1.2.3-rc1 --app-version 1.2.3rc1 renders elixircloud/protes:1.2.3rc1. scripts/chart_readme.py versions the README links (rc 0).
  • The release and dev-image publishing paths can only run on tags and dev pushes with the environments configured, so they were not run. No tags were pushed.

Sourcery's findings: the chart artifact is now overwritten on re-runs of all jobs (5a46223); the others are under declined findings.

CI: all checks passed (Static code analysis, Run tests (mongomock), Run tests (MongoDB 7.0), Run tests, Build documentation, Run app with Docker Compose, CodeQL); the image job is skipped for pull requests.

Declined review findings

  • Split the long release paragraph in docs/development.md into a list or sub-headings, and move the compare-link paragraph next to the notes (quality, low). Declined: the section deliberately follows cloud-registry's text and order, so the two stay easy to compare and update together.
  • stable output of release_version.py is unused (quality, low). Kept for consistency with cloud-registry, where it is the same.
  • Build in an unlocked job, so a superseded dev-image job doesn't cancel the CI run that the release check needs (adversarial, low). That split (push by digest, then tag under the lock) comes with ci: attest, sign and scan published images #234, as in cloud-registry. For now, the release workflow's error and the docs say to re-run CI if its run was cancelled.
  • Add a Helm job (lint, template) to checks.yaml (adversarial, low). Left to build(chart)!: use the FOCA library chart #216, which adds the chart tests and helm lint --strict in CI with the new chart.
  • Recheck the head right before pushing dev (Sourcery). Declined: if the newer commit passes CI, its job overwrites dev after the lock; if it fails, the older image is the latest good build. The push-by-digest split comes with ci: attest, sign and scan published images #234, as in cloud-registry.
  • Default the packaged chart's image to DOCKERHUB_ORG (Sourcery). Declined: the chart stays the same as in the repository. Forks change protes.image, which the docs now say.
  • Retag or remove the old latest on Docker Hub (Sourcery). A one-time manual step, added to the setup list below.

Open questions

None.

Repository setup before the first release (admin)

  • Branch main for releases (from the release commit on dev), protected against non-fast-forward pushes; the stale master can be retired.
  • Environment release with a required reviewer, and environment dev-images limited to branch dev, each with the Docker Hub secrets DOCKERHUB_LOGIN and DOCKERHUB_TOKEN (only there, not as repository secrets). Until dev-images has them, the dev image job fails on pushes to dev.
  • Optional repository variable DOCKERHUB_ORG (default elixircloud).
  • A tag ruleset for v* that restricts who may create tags and prevents updating or deleting them.
  • On Read the Docs, an automation rule that activates the versions of v* tags.
  • On Docker Hub, remove the old latest tag of elixircloud/protes (it points to the last date-tagged dev build), or leave it until the first stable release overwrites it.

🤖 Generated with Claude Code

Work in progress (paused): release.yaml, scripts/release_version.py and
scripts/chart_readme.py with their tests, adapted from cloud-registry;
unignore /scripts/. Chart placeholders, dev image publishing and the
docs are still to do.

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

sourcery-ai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

This PR replaces date/manual release publishing with a signed version-tag pipeline that validates repository state and release metadata, builds and verifies a single image by digest, packages and publishes a versioned Helm chart and GitHub release, reserves latest for the highest stable release, and updates development images, chart configuration, documentation, and tests to match the new lifecycle.

Sequence diagram for the signed version-tag release pipeline

sequenceDiagram
    participant Maintainer
    participant GitHub
    participant Prepare
    participant Push
    participant Publish
    participant DockerHub

    Maintainer->>GitHub: Push signed annotated vX.Y.Z tag
    GitHub->>Prepare: Trigger release workflow
    Prepare->>Prepare: parse_tag(TAG)
    Prepare->>Prepare: citation.py check VERSION
    Prepare->>Prepare: check_release_pins.py
    Prepare->>GitHub: Check successful CI run for SHA
    Prepare->>Prepare: Package Helm chart with VERSION
    Prepare-->>Push: version, SHA, chart artifact
    Push->>DockerHub: Build and push image by digest
    Push->>Push: Check app version of image
    Push-->>Publish: DIGEST
    Publish->>Publish: is_latest(TAG, main tags)
    Publish->>DockerHub: Tag DIGEST as VERSION
    Publish->>DockerHub: Tag DIGEST as latest if highest stable
    Publish->>GitHub: Create or update release with chart
Loading

Flow diagram for development and release image tags

flowchart LR
    DevPush["Push to dev"] --> HeadCheck["Check commit is still dev head"]
    HeadCheck --> BuildDev["Build image"]
    BuildDev --> DevTags["Publish dev and sha-commit"]

    SignedTag["Signed vX.Y.Z tag"] --> ReleaseBuild["Build image once by digest"]
    ReleaseBuild --> VersionTag["Publish X.Y.Z"]
    VersionTag --> StableCheck{"Highest stable release?"}
    StableCheck -->|Yes| Latest["Publish latest"]
    StableCheck -->|No| NoLatest["Do not publish latest"]
Loading

File-Level Changes

Change Details Files
Add a gated release workflow that derives all release artifacts from an annotated, GitHub-verified version tag.
  • Validate canonical tags, signed annotations, main ancestry, citation metadata, curated notes, dependency pins, and successful commit CI.
  • Package a versioned Helm chart and release-specific README, then build and verify one Docker image by digest.
  • Publish the exact digest under the release version and conditional latest tag, and create or update the GitHub release with chart assets and notes.
  • Use protected release environments, immutable-tag assumptions, Docker Hub organization variables, and rerun-safe concurrency.
.github/workflows/release.yaml
.github/workflows/release-pins.yaml
scripts/release_version.py
scripts/chart_readme.py
Change development image publishing so mutable development tags are isolated from release images.
  • Publish only current dev branch heads as dev and full-SHA tags.
  • Move publishing credentials into the dev-images environment and use the DOCKERHUB_ORG repository variable.
  • Stop publishing latest and date-based tags, preserving latest exclusively for stable releases.
.github/workflows/checks.yaml
Revise Helm image configuration to support release defaults, development placeholders, and shared worker images.
  • Replace hard-coded latest images with image-plus-tag values defaulting to chart appVersion.
  • Fall back to the application image for Celery unless a worker image is configured.
  • Validate tag types and reject conflicting image/tag combinations, including unconfigured worker tags.
deployment/Chart.yaml
deployment/values.yaml
deployment/templates/_helpers.tpl
deployment/templates/protes/protes-deployment.yaml
deployment/templates/protes/celery-deployment.yaml
deployment/README.md
Document the tag-based release process, image lifecycle, chart behavior, repository configuration, and upgrade implications.
  • Describe signed-tag release steps, prerelease semantics, CI gates, release environments, and latest-tag rules.
  • Document release chart links, dev image tags, image overrides, dependency pin requirements, and citation handling.
  • Update upgrade and contributing guidance and remove documentation references to the deleted standalone pin-check workflow.
docs/development.md
docs/contributing.md
docs/upgrading.md
scripts/check_release_pins.py
tests/test_check_release_pins.py
Add focused coverage for release-version derivation and chart README link versioning.
  • Test canonical and invalid release tags, chart SemVer conversion, prerelease/latest selection, and CLI output.
  • Test rewriting moving documentation/repository links, detecting leftovers, invalid tags, and script behavior.
tests/test_release_version.py
tests/test_chart_readme.py

Assessment against linked issues

Issue Objective Addressed Explanation
#44 Release only from canonical signed version tags on main whose commits have successful CI, publishing the versioned image, Helm chart, and GitHub release with the required release checks and review gate. ✅
#44 Publish development images only for the current head of dev, tagged dev and sha-, without date tags or latest. ✅
#44 Document the tag-based release and image-versioning process, including chart behavior and required repository setup. ✅

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

@uniqueg

uniqueg commented Oct 23, 2026

Copy link
Copy Markdown
Member Author

Note from #244 (citation metadata, #235): Zenodo archives each release with the CITATION.cff of the tagged commit, so the release workflow should check it, as Cloud Registry's does (elixir-cloud-aai/cloud-registry#180). When this PR lands (after #244), please add to release.yaml, after the version is determined and before the release notes check:

      # Zenodo archives the release with the citation metadata of the tagged
      # commit, so they must have the release version (see "Versioning and
      # releases" in `docs/development.md`)
      - name: Check citation metadata
        env:
          VERSION: ${{ steps.version.outputs.version }}
        run: python scripts/citation.py check "${VERSION}"

and mention scripts/citation.py in the comment of the Python setup step. In the docs, "Citation metadata" in docs/contributing.md can then say again that the release workflow fails if version and date-released don't match the release, and the release steps in docs/development.md (citation.py set before the release, check on the release commit) can be merged into the workflow's steps as in Cloud Registry.

uniqueg and others added 10 commits October 23, 2026 12:36
As in cloud-registry: check the citation metadata
(`scripts/citation.py check`) and that dependencies are releases
(`scripts/check_release_pins.py`) before publishing. Split publishing
into `push` (build, push by digest, untagged, and check the app
version) and `publish` (tag exactly that digest, create the GitHub
release), so that scanning, attesting and signing can be added between
them. The image name comes from the repository variable
`DOCKERHUB_ORG` (default `elixircloud`), not a secret; Python 3.13.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Publish images of commits on `dev` in the `dev-images` environment, only
for the branch head, tagged `dev` and `sha-<commit>` instead of `latest`
and the date, as in cloud-registry.

BREAKING CHANGE: `latest` on Docker Hub is the highest stable release,
no longer the latest commit on `dev`; date tags are no longer pushed.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Released charts set `version` and `appVersion` from the tag; in the
repository they are placeholders (`0.0.0`, `dev`). The app image is
`protes.image` with `protes.tag`, which defaults to `appVersion`, and
the Celery worker runs the same image unless `celeryWorker.image` is
set. Images with a tag or digest are used as they are.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Release steps, image tags, pre-releases, the checks of the release
workflow and the repository settings it relies on, as in
cloud-registry; the chart's image values and upgrade notes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
The release workflow checks the pins before publishing, so the interim
workflow `release-pins.yaml` from #214 is removed; the script, its tests
and the docs now refer to the release workflow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Unquoted numbers in values files (e.g., `tag: 20250101`) were rendered
as floats (`2.0250101e+07`); fail with a hint to quote them or use
`--set-string`. Document how the helper tells a registry port from a
tag.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- Chart README: install the chart attached to a release; the chart in
  the repository deploys the `dev` image unless `protes.tag` is set;
  the worker follows the app's image.
- Release workflow and docs: re-run CI if its run for the release
  commit failed or was cancelled (e.g., a superseded image job).
- Only commits that are still the head of `dev` get images.
- Upgrading: released chart versions restart below 3.0.0.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`default` turned falsy tags (`0`, `false`) into an empty tag, so they
fell back to `appVersion` instead of failing; check the kind first,
also for `celeryWorker.tag` without `celeryWorker.image`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg uniqueg changed the title ci: release from signed version tags ci!: release from signed version tags Oct 23, 2026
@codecov

codecov Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (ec95fec) to head (5a46223).
⚠️ Report is 1 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff            @@
##               dev      #230   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           22        24    +2     
  Lines         1097      1180   +83     
=========================================
+ Hits          1097      1180   +83     

☔ 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 October 23, 2026 11:31

@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 4 issues

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

## Individual Comments

### Comment 1
<location path=".github/workflows/checks.yaml" line_range="240" />
<code_context>
+        run: |
+          head=$(git ls-remote "https://github.com/${REPOSITORY}.git" "${REF}" | cut -f1)
+          [ -n "${head}" ] || { echo "::error::Could not look up ${REF}"; exit 1; }
+          if [ "${head}" = "${SHA}" ]; then
+            echo "current=true" >> "$GITHUB_OUTPUT"
+          else
</code_context>
<issue_to_address>
**Stale commit overwrites dev**

When `dev` advances after the head check but before the old image push completes, and the newer commit does not publish successfully, `steps.head.outputs.current` stays true, so the guarded build and push still publish the old commit under the mutable `dev` tag; users pulling `dev` get a stale image.

Recheck that the commit is still the `dev` head immediately before pushing the mutable tag.

Also at `.github/workflows/checks.yaml:290-297`.
</issue_to_address>

### Comment 2
<location path="deployment/values.yaml" line_range="50" />
<code_context>
+  # Image and tag; the tag defaults to the chart's `appVersion`. An image
+  # with a tag or digest (e.g., `elixircloud/protes:0.3.0`) is used as it
+  # is (then `tag` must be empty)
+  image: elixircloud/protes
+  tag: ""
   initResources:
</code_context>
<issue_to_address>
**Fork chart pulls upstream image**

When a fork sets `DOCKERHUB_ORG` to a non-default organization and installs its release chart without overriding `protes.image`, the packaged chart keeps `elixircloud/protes` as its default while the release workflow pushes to the fork's organization, so deployments pull the upstream image instead of the fork's release image.

Set the packaged chart's `protes.image` default to the image in the configured `DOCKERHUB_ORG`.

Also at `.github/workflows/checks.yaml:229`, `.github/workflows/release.yaml:32`.
</issue_to_address>

### Comment 3
<location path=".github/workflows/checks.yaml" line_range="283-286" />
<code_context>
+        uses: docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302 # v6.2.0
+        with:
+          images: ${{ env.IMAGE_NAME }}
+          flavor: latest=false
+          tags: |
+            type=raw,value=dev
+            type=sha,format=long
+          labels: |
+            org.opencontainers.image.version=${{ steps.version.outputs.version }}
</code_context>
<issue_to_address>
**Old dev image remains latest**

When the PR is merged and a deployment pulls `latest` before the first release workflow publishes a stable image, the updated dev-image job publishes only `dev` and `sha-<commit>`, while the release workflow writes `latest` only when a release is published. Docker Hub keeps the existing `latest` tag, so it continues to point at the pre-change dev image until a release updates it; users pulling `latest` during that interval get dev code rather than a stable release.

As part of the transition, retag `latest` to the highest existing stable release image, or remove the old `latest` tag until a stable release is published.

Also at `.github/workflows/release.yaml:298`.
</issue_to_address>

### Comment 4
<location path=".github/workflows/release.yaml" line_range="160" />
<code_context>
+          package="dist/protes-${CHART_VERSION}.tgz"
+          # The packaged README is the checked one
+          tar -xzOf "${package}" protes/README.md | cmp - "${chart}/README.md"
+      - name: Upload chart
+        uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
+        with:
</code_context>
<issue_to_address>
**Full reruns cannot re-upload chart**

When all jobs are rerun after a previous attempt successfully uploaded the chart artifact, `prepare` uploads an artifact named `chart` on every run attempt. Re-running all jobs reuses the same workflow run and artifact name, so `upload-artifact` rejects the existing artifact and the release cannot rebuild and publish as documented.

Allow the chart artifact to be overwritten on reruns or give each attempt a unique artifact name and download the artifact for that attempt.
</issue_to_address>

Sourcery assessment

Needs a human reviewer. 4 findings to address first, and a faulty release run could publish an incorrect image digest under a version tag and attach an incorrect chart or release notes; consumers may deploy or retain those artifacts. Reverting the workflow would not undo what was already published, though the tags and release can be corrected.

Blocking findings: .github/workflows/checks.yaml:240, deployment/values.yaml:50, .github/workflows/checks.yaml:286, .github/workflows/release.yaml:160


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

Comment thread .github/workflows/checks.yaml Resolved
Comment thread deployment/values.yaml Resolved
Comment thread .github/workflows/checks.yaml Resolved
Comment thread .github/workflows/release.yaml Resolved
Re-running all jobs of the release workflow uploads the chart again
under the same name; replace the artifact of the earlier attempt. Docs:
forks also change the chart's default image.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@uniqueg
uniqueg merged commit e0957fe into dev Oct 23, 2026
11 checks passed
@uniqueg
uniqueg deleted the ci/release-workflow branch October 23, 2026 11:40
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 from signed version tags

1 participant