Repository navigation
ci!: release from signed version tags - #230
Conversation
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]>
Reviewer's GuideThis 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 pipelinesequenceDiagram
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
Flow diagram for development and release image tagsflowchart 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"]
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
|
Note from #244 (citation metadata, #235): Zenodo archives each release with the # 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 |
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]>
# Conflicts: # docs/development.md
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]>
Codecov Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
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
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]>
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(onv*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), onmain; thatCITATION.cffhas the release version and date (scripts/citation.py check, from docs: add citation metadata #244); that curated notes (docs/releases/<version>.md) have noTODO; that dependencies are releases (scripts/check_release_pins.py, from build!: require FOCA 0.17 and Python 3.13 #245, so FOCA'sdevpin blocks a release); and that CI passed for a push of the commit. Packages the chart withversionandappVersionfrom the tag and versioned README links (scripts/chart_readme.py).push(environmentrelease): builds the image once, pushes it by digest (untagged) and checks that the app reports the release version.publish(environmentrelease): tags exactly that digestX.Y.Z(andlatestfor the highest stable release onmain) and creates or completes the GitHub release with the chart.push/publishsplit 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.docker.io/${{ vars.DOCKERHUB_ORG || 'elixircloud' }}/protes(a variable, no longer the secretDOCKERHUB_ORG).checks.yaml):devandsha-<commit>instead oflatestand the date, only for the head ofdev, in thedev-imagesenvironment. Breaking:latestis the highest stable release from now on.version: 0.0.0andappVersion: "dev"placeholders. The app image isprotes.image(defaultelixircloud/protes) withprotes.tag, which defaults toappVersion(helperprotes.image). The Celery worker runs the app's image unlessceleryWorker.imageis set. Images with a tag or digest (e.g. the oldelixircloud/protes:latest) still work as they are.release-pins.yamlremoved: 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/development.md(release steps, image tags, pre-releases, repository settings), "Image" in the chart README, upgrade notes, and the citation note indocs/contributing.md.Closes #44
How it was verified
Locally (Python 3.13.15, FOCA
0.16.1.dev16+g29af8a64a, after mergingorigin/devwith #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.actionlint1.7.12 on all workflows: no findings.python scripts/check_release_pins.py: fails, as intended, on the FOCAdevpin 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 lint deploymentpasses (only the existing Ingress API deprecation warnings, build(chart)!: use the FOCA library chart #216).helm templatechecked with the default values (elixircloud/protes:devfor 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.tagwithoutceleryWorker.image, and unquoted numeric or boolean tags.helm package --version 1.2.3-rc1 --app-version 1.2.3rc1renderselixircloud/protes:1.2.3rc1.scripts/chart_readme.pyversions the README links (rc 0).devpushes 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
docs/development.mdinto 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.stableoutput ofrelease_version.pyis unused (quality, low). Kept for consistency with cloud-registry, where it is the same.checks.yaml(adversarial, low). Left to build(chart)!: use the FOCA library chart #216, which adds the chart tests andhelm lint --strictin CI with the new chart.dev(Sourcery). Declined: if the newer commit passes CI, its job overwritesdevafter 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.DOCKERHUB_ORG(Sourcery). Declined: the chart stays the same as in the repository. Forks changeprotes.image, which the docs now say.lateston Docker Hub (Sourcery). A one-time manual step, added to the setup list below.Open questions
None.
Repository setup before the first release (admin)
mainfor releases (from the release commit ondev), protected against non-fast-forward pushes; the stalemastercan be retired.releasewith a required reviewer, and environmentdev-imageslimited to branchdev, each with the Docker Hub secretsDOCKERHUB_LOGINandDOCKERHUB_TOKEN(only there, not as repository secrets). Untildev-imageshas them, the dev image job fails on pushes todev.DOCKERHUB_ORG(defaultelixircloud).v*that restricts who may create tags and prevents updating or deleting them.v*tags.latesttag ofelixircloud/protes(it points to the last date-taggeddevbuild), or leave it until the first stable release overwrites it.🤖 Generated with Claude Code