Development¶
Setup¶
proWES is packaged with
pyproject.toml;
all dependencies are locked in
uv.lock. You
need uv and Git; uv also
provides the Python version that proWES targets (see requires-python in
pyproject.toml, currently Python 3.13, the version of the base image in the
Dockerfile).
Clone the repository and install the app with its development tools (the
dev extra) from the lock into a virtual environment (.venv):
Install the pre-commit hooks, so that the checks run on every commit, and run them on all files once:
The hooks
(.pre-commit-config.yaml)
format and lint the code with ruff (Google
style docstrings), check types with mypy, check the
project's semgrep (security) and ast-grep (anti-patterns) rules (see Static
analysis rules), lint the GitHub Actions workflows
with actionlint, scan for hardcoded secrets with gitleaks and check that
uv.lock matches pyproject.toml. CI runs the same hooks.
Run the tests:
The version of the package comes from Git tags (vX.Y.Z) via
setuptools-scm; there is no version
to edit in the code.
Run from source¶
To run proWES from the source code, e.g., to debug it or to try changes
without rebuilding the image, start the app and the Celery worker in the dev
environment set up as above. They need MongoDB and RabbitMQ; without the
broker, the app starts and serves the API, but POST /runs fails after it
has forwarded the run to the remote WES, so that the run isn't tracked.
-
Start MongoDB and RabbitMQ, e.g., those of Docker Compose, with their ports published on the host's loopback interface by a
docker-compose.override.yaml(ignored by Git), which Docker Compose merges overdocker-compose.yaml:Or install them locally (MongoDB 7.0 and RabbitMQ 4.3, as in
docker-compose.yaml). RabbitMQ 4.3 then needs the setting thatdocker-compose.yamlgives it, as Celery declares transient non-exclusive queues, which RabbitMQ denies by default: adddeprecated_features.permit.transient_nonexcl_queues = trueto its configuration (e.g., in/etc/rabbitmq/conf.d/90-foca.conf). -
Write a configuration overlay, e.g.,
local/config.yaml(the directorylocal/is ignored by Git), that keeps the runs in the repository instead of/data(relative paths are relative to the working directory): -
Point the app and the worker to the services, with the overlay and the credentials of RabbitMQ (
prowes:prowes, the defaults ofdocker-compose.yaml, or yourRABBITMQ_DEFAULT_USERandRABBITMQ_DEFAULT_PASS, if you set them on the first start; URL-encode other characters than letters, digits,-,.,_and~in the URL), in each shell that runs one of them (see Configuration for these and further variables):export FOCA_CONFIG_OVERLAY=local/config.yaml export MONGO_HOST=localhost export CELERY_BROKER_URL='pyamqp://prowes:prowes@localhost:5672//'With a locally installed RabbitMQ, use its default user
guest, which can connect from the same host only:pyamqp://guest:guest@localhost:5672//. -
From the repository root, start the app with Flask's development server, on the host and port of the config (
server.hostandserver.port,127.0.0.1:8080: the loopback interface only), and the Celery worker in another shell:To serve the app with Gunicorn, as the image does (
pro_wes/gunicorn.py), instead of the development server:
The WES API is then served at http://localhost:8080/ga4gh/wes/v1/, with a
Swagger UI at http://localhost:8080/ga4gh/wes/v1/ui/. For Flask's debugger
and reloader, set server.debug: True in the overlay, only with the loopback
host, as the debugger allows executing arbitrary code. Runs are forwarded to
the WES instances of custom.wes.backends (see WES
instances), none by default; to try runs
without a real WES, use the smoke test instead.
Static analysis rules¶
Besides ruff's security rules (S, from bandit), pre-commit runs
project-specific rules, each with tests:
- semgrep, security rules in
.semgrep/pro-wes.yml, shared with FOCA and the other FOCA apps (keep their patterns, messages and severities identical):flask-debug-enabled: debug mode in the app config or the Helm chartjwt-decode-without-verification: JWTs decoded without verifying the signaturejwt-decode-unsafe-algorithms: JWTs verified with the algorithmnoneor the one the token's header namesyaml-unsafe-load: YAML loaded with PyYAML's full or unsafe loadertls-verification-disabled: certificate verification turned off
- ast-grep, anti-patterns in
.ast-grep/rules/(configured insgconfig.yml); all butpydantic-v1-dict,root-logger-callandstring-status-codecheck the package (pro_wes/) only:foca-config-attribute: untyped access to the FOCA config (app.config.foca)framework-free-tasks: Flask, Werkzeug, Connexion or Starlette imported outside the app, the controllers and the exceptionsgeneric-exception-raised:ExceptionorBaseExceptionraisedhard-coded-url: string literals that start with a URL (not docstrings or other strings that stand alone as a statement); backends and other services come from the configprint-call: output withprint()instead of a loggerpydantic-v1-dict: Pydantic v1's.dict()instead of.model_dump()root-logger-call: messages logged with the root loggerstring-status-code: HTTP status codes returned as strings
pre-commit runs the rule tests when the rules change; run it with uv run
pre-commit ..., as the ast-grep hooks use the ast-grep of the dev
dependencies. To run the rule tests by hand: uv run ast-grep test
--skip-snapshot-tests, and semgrep --test . in .semgrep/ (semgrep is not
a dev dependency: pre-commit installs its own, so install it separately for
this).
Add a rule together with its test cases: for semgrep in
.semgrep/pro-wes.py (Python rules) or .semgrep/pro-wes.test.yaml (YAML
rules), marked with # ruleid: <rule-id> and # ok: <rule-id>; for
ast-grep in .ast-grep/rule-tests/<rule-id>-test.yml, with valid and
invalid snippets. The tests can't check which files a rule applies to
(files and ignores of ast-grep rules, paths of semgrep rules): check
the scoping by hand, e.g., with a finding planted in pro_wes/.
Suppress a finding only if it is a false positive or can't be avoided yet,
with a suppression comment on its line: # nosemgrep: <rule-id>,
# ast-grep-ignore: <rule-id>, # noqa: <code> (ruff),
# type: ignore[<code>] (mypy) or # gitleaks:allow. Give the reason in a
comment on the line before, as most suppression comments can't hold it.
Continuous integration¶
CI
(.github/workflows/ci.yml,
workflow CI) runs on pull requests and on pushes to dev. Its jobs, and
how to run them locally:
| Job | Name | Locally |
|---|---|---|
title |
PR title | Pull request titles follow Conventional Commits, at most 50 characters |
lint |
Lint | uv run pre-commit run --all-files, pipx run --spec cffconvert==2.0.0 cffconvert --validate -i CITATION.cff, uv build |
docs |
Docs | uv run --extra docs mkdocs build --strict (see Documentation) |
test |
Test | uv run coverage run -m pytest && uv run coverage report |
chart |
Chart | helm dependency build deployment, (cd deployment && sha256sum -c charts.sha256), helm lint deployment --strict -f deployment/ci/test-values.yaml (also with -f deployment/ci/optional-values.yaml and with MongoDB auth off; see the job), uv run pytest tests/test_chart.py |
chart-install |
Chart install | tests/chart/install.sh on a kind cluster chart-testing (see Testing the chart) |
smoke |
Smoke test | tests/smoke/check.sh (see Smoke test) |
integration |
Integration (Sapporo), Integration (WESkit), Integration (Conquest) | tests/integration/check.sh, tests/integration/weskit/check.sh, tests/integration/conquest/setup.sh and check.sh (see Integration test) |
readiness |
Release readiness | The release workflow's checks of the curated notes and the pins (see Releasing), for the version in CITATION.cff while it has no tag: the curated notes (present, no TODO, publish.py check of the pinned publish-release), python scripts/check_action_pins.py, python scripts/check_release_pins.py |
push |
Push image | Pushes to dev only (and fork dry runs, see below): builds the image and pushes it by digest |
scan |
Scan image | Where nothing is pushed (pull requests, forks): docker build -t prowes:scan ., then Trivy on prowes:scan with .trivyignore.yaml; otherwise the pushed digest |
publish |
Publish image | Pushes to dev only (and fork dry runs), after all other checks passed: attests, signs and tags the scanned digest (dev, sha-<commit>) |
passed |
CI passed | Passes if all other jobs passed or were skipped as intended |
CI passed is the only required check. Add every new job to its needs.
push and publish run on pushes to dev of this repository (and of forks
that set DOCKERHUB_ORG, see below), in the environment dev-images (Docker
Hub secrets, branch dev only); they are skipped on pull requests and in
other forks, which the gate allows. A fork can dry
run them by setting the repository variable DOCKERHUB_ORG to its own
Docker Hub organization (and the secrets DOCKERHUB_LOGIN and
DOCKERHUB_TOKEN, in an environment dev-images): the image is then
published there instead of to elixircloud. DOCKERHUB_ORG is a
repository variable (before: a secret, which the workflow no longer reads).
publish signs and tags only commits that are still the head of dev. See
Verifying images and charts for what the image jobs
publish.
Smoke test¶
The smoke test
(tests/smoke/)
deploys proWES with Docker Compose, as docker-compose.yaml does (app,
Celery worker, MongoDB, RabbitMQ), against a fake WES (fake_wes.py)
instead of a real one. It creates runs, which proWES forwards to the fake
WES, waits until the Celery worker has tracked them to their final state,
and checks the run list, the run logs, the run status, the cancellation of
a run and that the fake WES got the runs as sent. The fake WES is also the
identity provider whose access tokens proWES requires: the test checks that
requests without a valid token are rejected and that users see only their
own runs. It needs Docker Compose, curl and jq. Run it from the repository
root:
It builds the image as prowes:smoke and starts the services in the
Compose project prowes-smoke (set COMPOSE_PROJECT_NAME to change it),
so that the image and data of other local deployments are left alone;
proWES is published on 127.0.0.1:8090, as by docker-compose.yaml, so
stop other deployments that publish that port first. On failure, it shows
the logs of the services. The deployment keeps running after the test, for
inspection, and the test can run again on it; remove it with:
COMPOSE_FILE=docker-compose.yaml:tests/smoke/compose.yaml \
COMPOSE_PROJECT_NAME=prowes-smoke docker compose down --volumes
The fake WES is the one WES instance of the smoke test's config overlay
(custom.wes.backends in tests/smoke/config.yaml), at its service name in
the Compose network (https://fake-wes), with a certificate of its own
certificate authority, which proWES trusts instead of the public ones
(REQUESTS_CA_BUNDLE), so that runs are forwarded with TLS verification on
and no run leaves the Compose network.
Integration test¶
The integration tests run proWES as the smoke test does, but against real
WES implementations, one per test (and per entry of the CI job): Sapporo,
WESkit and Conquest. The test against Sapporo
(tests/integration/)
runs proWES against
Sapporo, a real WES
implementation (the image of tests/integration/compose.yaml, pinned by
digest and updated by Dependabot), instead of the fake WES, which
stays the identity provider. It creates runs of the CWL workflows of
tests/integration/workflows/, which proWES forwards to Sapporo: one that
completes (its run log, with the engine's output, and the run list), one
that fails (EXECUTOR_ERROR) and one that is canceled while it runs (also
at Sapporo, whose engine container must be gone). It also prints the WES
version of Sapporo's service info (to the job summary in CI). Sapporo runs
cwltool in containers through the host's Docker socket, and access to the
socket amounts to control of the host, so run the test locally only where
that is acceptable. It needs Docker Compose, curl and jq; run it from the
repository root:
export COMPOSE_FILE=docker-compose.yaml:tests/smoke/compose.yaml:tests/integration/compose.yaml
export COMPOSE_PROJECT_NAME=prowes-integration
docker compose up -d --build --wait --wait-timeout 300
tests/integration/check.sh
docker compose down --volumes
The first run pulls the images of Sapporo and cwltool, so the waits are
long (each up to FINAL_WAIT polls, about one a second, by default 300).
As in the smoke test, the image is prowes:smoke and proWES is published
on 127.0.0.1:8090, so stop the smoke test's deployment first. Sapporo
keeps its runs in SAPPORO_RUN_DIR (default .integration/sapporo of the
repository root, ignored by Git), at the same path in its container and on
the host, so that the engine containers it starts find them. The files
belong to root and stay after docker compose down; remove them without
root with a container, from the repository root:
The engine containers join the Compose network, which therefore has the
fixed name prowes-integration (also if COMPOSE_PROJECT_NAME is
changed), and fetch the workflows over HTTP from the service workflows.
The run that is canceled starts its engine container before the cancel,
and the test checks that Sapporo stopped it. On failure, the script cancels
that run and shows the logs of the services; the deployment keeps
running, for inspection, and the test can run again on it.
Where Sapporo 2.4.2 differs from WES 1.1.0, the test accommodates it:
- Sapporo requires the field
workflow_enginein run requests, which WES 1.1.0 makes optional: the test sendsworkflow_engine=cwltool, which proWES forwards. It also checks that Sapporo rejects runs without the field: so each run that Sapporo accepts proves that proWES forwarded it. - Its run logs list the outputs as an array of files, not as an object: proWES leaves them out of the run log, as it does with any invalid field, so the test checks the output file in the engine's standard output (cwltool's output object).
- Its service info reports the WES version
sapporo-wes-2.1.0(Sapporo's extension of WES 1.1.0) intype.versionandsupported_wes_versions, not a version of the WES specification, so it would count as WES 1.0, which can't choose the engine: its entry has the labelwes.version: "1.1"(tests/integration/config.yaml).
WESkit¶
The integration test against
WESkit
(tests/integration/weskit/,
job Integration (WESkit)) runs the same way, with a Compose override,
config overlay and script of its own; the scripts share their functions
(tests/integration/lib.sh). It creates runs of the workflows of
tests/integration/weskit/workflows/, for each workflow type that WESkit
runs (Snakemake and Nextflow, each workflow in both languages): one that
completes (its run log, its output file at WESkit with the run's
parameter, and the run list), one that fails (EXECUTOR_ERROR), and one
that WESkit can't cancel (see below). Run it from the repository root:
export COMPOSE_FILE=docker-compose.yaml:tests/smoke/compose.yaml:tests/integration/weskit/compose.yaml
export COMPOSE_PROJECT_NAME=prowes-integration-weskit
docker compose up -d --build --wait --wait-timeout 600
tests/integration/weskit/check.sh
docker compose down --volumes
WESkit publishes no images of its releases (its registry has images of
2023 and older), so Compose builds WESkit 1.0.0 from the commit of its tag
v1.0.0 (a95ec25), on WESkit's base image, pinned by digest, which holds
its Conda environment with Snakemake 9.16.3 and Nextflow 25.04.3 (whose
framework the image holds, so it runs offline); WESkit's own CI builds its
image the same way. Dependabot updates neither: to move to another
WESkit release, set the commit of its tag in the build context of
tests/integration/weskit/compose.yaml, and the digest of the base image
that WESkit's CI uses for it
(registry.gitlab.com/one-touch-pipeline/weskit/api/base, tag master).
The first build pulls the base image (about 1 GB). WESkit's REST API
(uWSGI) and its Celery worker use proWES's MongoDB (database WES) and a
Redis of their own; the worker runs Snakemake in its own container
(executor: local), so no container is started through the Docker socket.
WESkit's configuration (tests/integration/weskit/weskit.yaml) follows
the example of WESkit's Compose deployment, without login.
Where WESkit 1.0.0 differs from WES 1.1.0, the test accommodates it:
- It cancels no runs:
POST /runs/{run_id}/cancelfails with500(NotImplementedErrorin WESkit'sManager.cancel()). The test checks that proWES passes the error on (500, "The remote WES service answered with an error.") and that the run goes on, at WESkit and in proWES, until it completes. - It takes only relative workflow URLs (of its directory of installed
workflows,
WESKIT_WORKFLOWS, or of attachments) andtrs://URIs;https://URLs are refused. The test's workflows are installed in that directory, and the runs name them relative to it (e.g.,hello/Snakefile). - It runs Snakemake and Nextflow workflows (
SMK,NFL) only, and takes the version of the engine as the version of the workflow type (SMK9.16.3,NFL25.04.3), which proWES must accept too: the config overlay adds them to proWES'sworkflow_type_versions. - Its run logs list the outputs as
{"filesystem": [<paths>]}, not as an object of output names, andstdoutandstderras paths in the run directory, not as URLs; the test checks the output file in WESkit's run log. - Its service info reports the WES version that its configuration sets
(
static_service_info):1.1.0here, so proWES routes runs to it as a WES 1.1 instance without the labelwes.version.
Conquest¶
The integration test against
Conquest
(tests/integration/conquest/,
job Integration (Conquest)) runs Conquest on a kind cluster, as Conquest
runs only on Kubernetes: its runner and the jobs of the workflows (tasks of
its own TES) are Pods there. setup.sh applies cluster.yaml (namespace
conquest, PostgreSQL, an S3 server, versitygw, and their Secrets, with
fixed test credentials) and installs Conquest's chart from the commit of
its master branch that setup.sh names (Conquest publishes no chart and
no releases), with the images of that commit, pinned by digest
(values.yaml). Conquest's API is served at a node port of the cluster's
node; proWES, its worker and the fake WES join kind's Docker network
(kind) to reach it. For each of the workflow types Snakemake (SMK,
the Snakefiles of the WESkit test) and WDL (the workflows of
tests/integration/conquest/workflows/), the test creates a run that
completes (its run log, its task at Conquest, the run list and, for WDL,
its output file), one that fails (EXECUTOR_ERROR), and one that is
canceled while it runs (also at Conquest, whose runner and task Pods must
be gone). Run it from the repository root, with kind, kubectl and helm,
and a kubeconfig of its own outside the repository (so that the cluster's
credentials can't be committed):
export KUBECONFIG="${TMPDIR:-/tmp}/prowes-conquest.kubeconfig"
kind create cluster --name prowes-conquest
tests/integration/conquest/setup.sh
export COMPOSE_FILE=docker-compose.yaml:tests/smoke/compose.yaml:tests/integration/conquest/compose.yaml
export COMPOSE_PROJECT_NAME=prowes-integration-conquest
docker compose up -d --build --wait --wait-timeout 300
tests/integration/conquest/check.sh
docker compose down --volumes
kind delete cluster --name prowes-conquest
Both scripts refuse to run unless the current context is kind's context of
the cluster prowes-conquest and points to its API server
(tests/integration/conquest/kind.sh), so check.sh needs kind too.
The first run pulls Conquest's Snakemake runner and task images (about
900 MB each) and its WDL runner image (miniwdl), which takes a few
minutes; the WDL tasks run in a Debian image pinned by digest in the
workflows (miniwdl runs task commands with bash). Dependabot updates none
of Conquest's images, nor PostgreSQL's and versitygw's in cluster.yaml,
nor the Debian image of the WDL workflows: to move to another Conquest
commit, set it in setup.sh and the digests of its sha-<commit> images
in values.yaml; a new Debian image takes a change of the workflows (see
WORKFLOW_REVISION below).
Where Conquest differs from WES 1.1.0, the test accommodates it:
- It runs workflows only from GitHub repositories
(
https://github.com/<org>/<repo>), which it clones, and checks out the commit of the workflow engine parameterrevision;snakefile(SMK) ormain_workflow_path(WDL) names the workflow file in the repository. The test's runs name this repository and a commit of itsdevbranch with the workflows (WORKFLOW_REVISIONofcheck.sh): commits of pull requests, e.g., of forks, aren't in a clone of the repository. A change to the workflows therefore takes two pull requests: one that changes them, and, once it's merged, one that movesWORKFLOW_REVISIONto its commit. - Its service info has none of the fields of the GA4GH service info (
id,name,type,organization,version), only the WES fields; it reportssupported_wes_versions: ["1.1.0"]but notype.version. Its entry in the config overlay states the version with the labelwes.version: "1.1.0"(see WES versions). - It takes the version of Snakemake as the version of the workflow type
(
SMK,9.17.3), which the config overlay adds to proWES'sworkflow_type_versions, with WDL1.0. - Its run logs have no exit code, and
stdoutis ans3://URL of its object store; the test checks the exit code of the run's task at Conquest (GET /runs/{run_id}/tasks). Only WDL runs list outputs, ass3://URLs; the test reads the WDL greeting from the S3 server. - Its Nextflow runs (
NFL) aren't covered: Conquest's Nextflow runner hands the repository to Nextflow (nextflow run <repository> -r <revision> -main-script <main_script>), and Nextflow 24.10.4, which it runs, refuses a repository withoutmain.nf(or anextflow.confignaming another main script) at its root, before it applies-main-script. This repository has neither, so anNFLrun of the WESkit test's Nextflow scripts ends inEXECUTOR_ERRORbefore any task runs (generic-issues#194).
WES implementations not covered¶
These WES implementations were checked for the integration test but can't run in it yet, in CI or locally. We don't test interoperability with them for now; they can join the test once the gaps listed here are closed upstream.
metis, checked at commit
676c442
(the head of its dev branch on 21 November 2026), with its API,
PostgreSQL, Valkey and NATS as in its docker-compose.yaml:
- It accepts run requests (
POST /runs) as JSON only. WES 1.1.0 specifiesmultipart/form-data, which proWES sends: metis rejects such requests, and URL-encoded forms, with400(Expected request with Content-Type: application/json). So proWES can't create runs there, and none of the checks of the test (run states, run logs, run lists, cancellation) can run (metis#23). - Its service info has none of the fields of the GA4GH service info (
id,name,type,organization,version), only the WES fields. It reportssupported_wes_versions: ["1.1.0"]but notype.version, so proWES counts it as WES 1.0 (see WES versions): an entry for it needs the labelwes.version: "1.1", as Sapporo's has (metis#24). - It has no releases and publishes no images, and its repository has no
Cargo.lock(Git ignores it). Its Dockerfiles copy the lock file, so its images can't be built from a checkout of a commit, and the versions of its dependencies aren't pinned (metis#25). - It runs Nextflow workflows only (workflow type
NFL, versionDSL2, engineNextflow), so it needs workflows of its own, not the CWL workflows of the test.
Versioning and releases¶
The project adopts the semantic versioning scheme for versioning. Currently the service is in beta stage, so the API may change without further notice.
The version is stored in Git tags (vX.Y.Z; pre-releases vX.Y.ZaN,
vX.Y.ZbN, vX.Y.ZrcN): the package version is derived from them (via
setuptools-scm), and the service
info reports it. Builds without Git metadata, such as local Docker builds
(e.g., with Docker Compose), report 0.0.0.dev0; the workflows pass the
version to the image build (build argument SETUPTOOLS_SCM_PRETEND_VERSION).
Images on Docker Hub (elixircloud/prowes) are tagged:
X.Y.Z(e.g.,X.Y.Zrc1for pre-releases): releaseX.Y.Z. Releases never taglatest, which holds a legacy image (last pushed in January 2026) and is not updated any more;dev: the latest commit ondev;sha-<commit>: commit<commit>ondev(full SHA), to deploy a fixed commit. Only commits that are still the head ofdevwhen their CI run reaches the image job get images.
Each release also publishes the Helm chart, as an OCI artifact
(oci://ghcr.io/elixir-cloud-aai/charts/prowes) and attached to the GitHub
release (prowes-<chart version>.tgz). The chart version is the release
version in SemVer form (X.Y.Z; X.Y.Z-rc1 for vX.Y.Zrc1, also -aN,
-bN), its appVersion (the default image tag) the release version. The
chart in the repository has the placeholder version 0.0.0 and
appVersion dev; the legacy chart (before the rebuild on the FOCA library
chart) had versions of its own, which no release packaged. No packages are
published to PyPI.
Releasing¶
Features and fixes are merged into dev, the default branch. Branch main
only ever moves forward to commits of dev that are released, and the
release workflow fails unless the tagged commit is on main.
- A release-prep pull request (feather lane: metadata only) sets
version(X.Y.Z) anddate-released(the planned day of the tag,YYYY-MM-DD) inCITATION.cff, which Zenodo archives with each release, and adds the curated release notesdocs/releases/X.Y.Z.md(see Release notes) todocs/and to thenavofmkdocs.yml(under "Changelog", newest first; with the first release, the entry becomes a section,- Changelog:with- changelog.mdand- releases/X.Y.Z.mdbelow it; the strict docs build fails otherwise). Each version, also each pre-release, needs its own such change. From then on, until the version is tagged, the CI job "Release readiness" checks what the release workflow will check before anything is published: the notes (present, noTODO, the organization's format, checked by the shared actionpublish-releaseat the commit thatrelease.ymlpins), that every action ofelixir-cloud-aai/.githubis pinned to the commit of the release its comment names (scripts/check_action_pins.py) and that the dependencies are releases (scripts/check_release_pins.py, see below). Its findings, also checks it can't run (e.g., an unreachable tag or checker), are warnings on pull requests and in forks and fail CI on pushes todev, which the release requires to pass (they also hold back thedevimage). Once the version is tagged, the job checks only the tagged commit and skips later ones. -
Once it is merged and CI passed for the push of its merge commit
<sha>todev, a maintainer releases versionX.Y.Zfrom it in a new worktree (so that the checkout, which may have changes of its own, stays as it is), stopping at the first error and removing the worktree in any case (POSIX shell, e.g., Bash or Zsh):git fetch origin && git worktree add --detach ../prowes-release <sha> && ( cd ../prowes-release && git push origin <sha>:refs/heads/main && # fails unless it is a fast-forward git tag -s vX.Y.Z <sha> -m "vX.Y.Z" && git push origin vX.Y.Z ) git worktree remove ../prowes-releaseIf the push to
mainis rejected, nothing is tagged:mainhas commits that<sha>lacks, so release from a commit ofdevthat contains them. If only the push of the tag failed, push it again (git push origin vX.Y.Z) instead of repeating the steps:git tag -srefuses to replace the existing tag. The tag needs a signature that GitHub verified (a GPG or SSH key registered as a signing key with your GitHub account), or the workflow fails before anything is built. Run the chart checks ofpreparebefore (see Checks before tagging). -
The release workflow (
release.yml) runs, after approvals in the environmentrelease: see The release workflow. - After the release is published, a follow-up pull request adds the
Zenodo DOI badge and a "Citation" section to the
README.md, with the concept DOI (which always resolves to the latest version, so later releases need no update). Until the first release withCITATION.cffhas a DOI, the citation metadata isCITATION.cffalone.
The release workflow¶
Triggered by the tag, the workflow runs these jobs:
| Job | Name | What it does |
|---|---|---|
prepare |
Prepare release | Checks the tag (annotated, signature verified by GitHub, the name of the signed tag object), the commit (on main, CI passed for a push of it to dev; if CI hasn't finished, failed or was cancelled, re-run CI, then the release workflow) and CITATION.cff (the release version and a release date) with the shared action check-release, the curated notes with publish-release (check-only; also that no published release of the tag exists), the form of the version (X.Y.Z, X.Y.ZaN, X.Y.ZbN, X.Y.ZrcN) and the pins of the dependencies (scripts/check_release_pins.py), then packages the chart |
push |
Push release image | After approval: stops if the image tag X.Y.Z exists, builds the image, pushes it by digest (untagged, with SBOM and provenance attestations) and checks that the app reports the release version |
scan |
Scan release image | Scans exactly that digest with Trivy, without credentials; fails on fixable critical and high findings and on pip |
release-image |
Release image | After approval: attests the build provenance of the scanned digest, signs it (Sigstore keyless signing) and tags it X.Y.Z |
release-chart |
Release chart | After approval: checks that the chart artifact is the one prepare packaged (name and SHA-256), stops if the chart version is published, pushes it to oci://ghcr.io/<owner>/charts/prowes, attests and signs it there and as a file (Sigstore bundle prowes-<chart version>.tgz.sigstore.json) |
notify |
Notify Pubgrade | Once the repository is registered at Pubgrade (see below), after approval: registers the image X.Y.Z there, so that deployments with a Pubgrade sidecar can follow releases |
publish |
Publish release | Checks the chart again and creates the GitHub release with publish-release: the curated notes, then GitHub's generated notes; the chart and its Sigstore bundle attached |
See Verifying images and
charts for what it publishes and
how to verify it. prepare packages the chart with the chart version as
version and the release version as appVersion, so that it deploys the
release image (elixircloud/prowes:X.Y.Z; in forks with DOCKERHUB_ORG,
that organization's), with the library chart (checked against
deployment/charts.sha256) and without the CI values (deployment/ci/,
left out by deployment/.helmignore). In the packaged README, links to the
latest docs and to files on branch dev point to the release
(/en/vX.Y.Z/, blob/vX.Y.Z/); the release fails if any link to a version
that moves is left (scripts/chart_readme.py). The chart in the repository
is unchanged.
Alpha, beta and release candidate versions and, until 1.0.0, all other releases are GitHub pre-releases (never marked as the latest release). The GitHub release is created as a draft, gets its assets and is published last (releases are immutable, see the settings below, so assets can't be added once it is published).
Released images, charts and tags don't change. Re-running only the failed
jobs reuses the digest and the chart of the earlier attempt (and scans the
digest again if the scan failed). Re-running all jobs builds a new digest,
which push refuses once the image tag X.Y.Z exists; release-chart
refuses a chart version that is published already, also on a re-run after
a later step of that job failed; prepare refuses a tag whose GitHub
release is published. In these cases, and whenever a check fails after the
tag was pushed (the workflow checks the tagged commit, so it fails again on
re-runs), release a new patch version, with its own release-prep pull
request. Digests of runs that fail before release-image (also in the
scan) stay on Docker Hub, untagged and unsigned. Images of commits on dev
are published by the CI workflow (environment dev-images): it pushes the
image by digest, scans it, and attests, signs and tags exactly that digest
once all other jobs passed.
Checks before tagging¶
The release workflow's checks of the curated notes and the pins run in CI
("Release readiness", see above). To run the chart checks of prepare
locally at the release commit <sha> (replace X.Y.Z by the version and
<chart version> by its SemVer form):
git switch --detach <sha>
readme="$(mktemp -d)/README.md" && cp deployment/README.md "${readme}"
python scripts/chart_readme.py "${readme}" vX.Y.Z # links of the chart
helm dependency build deployment && (cd deployment && sha256sum -c charts.sha256)
helm lint deployment --strict -f deployment/ci/test-values.yaml
helm package deployment --version <chart version> --app-version X.Y.Z -d "$(mktemp -d)"
Release notes¶
Release notes follow the format agreed for all repositories of ELIXIR
On-Cloud (see the README of the shared action
publish-release):
- An intro paragraph saying what the release brings, with a link to the upgrade steps (e.g., on the Upgrading page) if there are any.
- Grouped sections, with empty ones left out, in this order:
## Breaking changes,## Features,## Security,## Fixes,## Documentation,## Maintenance. They hold bullets only, and each bullet ends with its issue and pull request numbers, e.g.,(#12, #34). ## Commits: GitHub's generated notes, verbatim (including "New Contributors"), without their## What's Changedheader, as they credit the authors.- Last, GitHub's generated
**Full Changelog**: ...line (no compare link of our own).
The curated notes in docs/releases/X.Y.Z.md (for pre-releases, e.g.,
X.Y.Zrc1.md) hold parts 1 and 2, without a title (the release's title is
its tag); publish-release adds parts 3 and 4 from GitHub's
generate-notes
API, for the changes since the previous published release. Curated notes are
required and published as written, so the release fails if they are
missing, contain TODO or are not in this format, and so does the CI job
"Release readiness" on pushes (see above). Relative links, e.g.,
../upgrading.md#authentication-breaking, work in the docs built from
docs/releases/, but not in the release body: link the release's docs with
their full URL, e.g.,
https://prowes.readthedocs.io/en/vX.Y.Z/upgrading/#authentication-breaking.
Detailed upgrade steps belong on the Upgrading page, linked
from the intro.
Scans¶
The CI workflow builds the image of every pull request and scans it with
Trivy (the shared action
scan-image
of the organization, pinned to the commit of a release), and a weekly
workflow (scan.yml) scans the image of the highest release (the highest
version, pre-releases included, among the published GitHub releases; until
the first release, the scan is skipped). For pushes to dev and for
releases, the workflows push the image by digest, untagged, scan exactly
that digest in a job without credentials or signing identity, and only if
the scan passes attest, sign and tag it, so that the published images are
the scanned ones. The scans fail on critical and high vulnerabilities that
have a fix, and upload the findings that have a fix (all severities) to code
scanning (Security tab; only in this repository, not for pull requests from
forks, nor in the release workflow); findings without a fix appear there
once a fix is released. The release scan also fails if the image contains
pip. The weekly scan also uploads a full report, findings without a fix
included, as the workflow artifact trivy-report-release-image of each run
(trivy-report.json and trivy-report.txt, a table; Actions tab, workflow
"Scan"); it is not uploaded to code scanning. Accepted findings are left out
of all results. To accept a finding (e.g., if it doesn't affect the app),
add it to .trivyignore.yaml with the affected package versions (purls),
the reason (statement) and an expiry date (expired_at), after which the
scans fail again. Signing needs no secrets beyond the Docker Hub ones: it
uses the workflows' OIDC tokens (permission id-token: write).
Pins of dependencies¶
To test unreleased changes of FOCA, pyproject.toml may pin a FOCA commit
(foca @ git+https://github.com/elixir-cloud-aai/foca@<sha>), with FOCA's
development image of that commit as the base image (tagged by date, e.g.,
elixircloud/foca:YYYYMMDD-py3.13, pinned by digest, as the tag moves with
later commits of that day). Such pins are temporary: the release workflow
fails while a requirement (also an optional one, a dependency group or a
build requirement) is a direct reference or names a pre-release or a local
version (e.g., +g<commit>), a FOCA image has no release tag, or a
package comes from elsewhere than PyPI (https://pypi.org/simple, the only
package index allowed): a source of [tool.uv.sources] (git, url,
path, workspace, or an index other than PyPI), a package index other
than PyPI ([[tool.uv.index]], index-url, extra-index-url,
find-links), or a package of uv.lock (from which the image is
installed; it must exist) whose source is not PyPI, the app itself excepted
(scripts/check_release_pins.py, tested in
tests/test_check_release_pins.py). So replace them by the released
versions before tagging (a FOCA commit is reported twice, in
pyproject.toml and in uv.lock). This applies to pre-releases of the
app, too: they are built on FOCA releases.
Settings and forks¶
Maintainers: the workflows rely on these repository settings, which must be in place before the first release tag is pushed:
- environment
dev-images, limited to branchdev; - environment
release, with a required reviewer, "Prevent self-review" and a deployment policy that allows only tagsv*(GitHub creates a missing environment on the first run, unprotected); - the Docker Hub secrets (
DOCKERHUB_LOGIN,DOCKERHUB_TOKEN, shared by the organization), read only by the jobs in the two environments (tests/test_release_workflows.pychecks this); - a tag ruleset for
v*that restricts who may create them and prevents moving or deleting them; - immutable releases;
mainprotected against non-fast-forward pushes;- a ruleset for
devthat requires the checkCI passed(the gate of the CI workflow) only.
The first release creates the GHCR package charts/prowes of the
organization; new packages are private: make it public (package settings)
after the first release, so that the chart installs without a login. To let
deployments follow releases with Pubgrade, register the repository at
Pubgrade and set the repository variable PUBGRADE_REPOSITORY_ID (next to
the organization variable PUBGRADE_URL) and the secret PUBGRADE_TOKEN
in the environment release; until both variables are set, notify is
skipped.
The Docker Hub organization is the repository variable DOCKERHUB_ORG (by
default elixircloud; forks set it to the organization they publish to,
with the Docker Hub secrets in the environments dev-images and
release), so that the scan jobs, which have no secrets, know the image
name too, and the released chart's default image (prowes.image) is the
published one. Forks publish their charts to the GHCR namespace of their
owner. Forks without DOCKERHUB_ORG publish nothing in CI: their CI runs
the same checks (the scan of a local build included, without the upload to
code scanning) and passes without the secrets, and their weekly scan is
skipped. Dry-run the release workflow in a fork with DOCKERHUB_ORG set
(and its own release environment) on a test tag before the first release
and after changes to the workflow: the image goes to elixircloud
otherwise.
On Read the Docs, the default version is stable (the highest release)
from the first release on, and the default branch is left empty, so that
latest follows the repository's default branch, dev; an automation
rule activates the versions of tags (v*), so that the docs linked from
packaged charts exist.
The release workflow (jobs prepare and release-chart) and CI's jobs
chart, chart-install and integration install a fixed Helm version
(version: of azure/setup-helm). Dependabot updates the action, but not
this version: bump it by hand, in all places.
The workflows are tested in tests/test_release_workflows.py (names,
environments, the order of the jobs, the shared actions; it also runs the
shell scripts of the checks with stand-ins for gh, docker and helm)
and tests/test_workflows.py; the scripts in tests/test_chart_readme.py,
tests/test_check_action_pins.py and tests/test_check_release_pins.py,
checked like the app (ruff, mypy, coverage).
Dependencies¶
After changing dependencies in pyproject.toml, update the lock with uv
lock and commit both files.
Dependabot
(.github/dependabot.yml)
opens pull requests labelled type: dependencies once a month, to dev,
grouped per ecosystem: Python dependencies (pyproject.toml and uv.lock),
GitHub Actions, the images of the Dockerfile, the service images of Docker
Compose (MongoDB, RabbitMQ, Flower, and Sapporo and WESkit's Redis of the
integration tests) and the pre-commit hook revisions. Some updates are
made by hand instead:
- FOCA, in
pyproject.tomlanduv.locktogether with the FOCA base image (the image build fails unless the base image has the locked FOCA); runuv lockafter changingpyproject.toml. - connexion 3, which needs a FOCA upgrade.
- MongoDB minor and major versions (patches still come).
- WESkit of the integration test, built from the commit of a release and its base image's digest (see WESkit).
- Conquest of the integration test: the commit of its chart and the digests of its images, and the images of PostgreSQL and versitygw (see Conquest).
- The versions of Helm and kind (
versionof their actions) in the jobschart,chart-installandintegration, and Helm's in the jobsprepareandrelease-chartofrelease.yml, which must stay the same. - uv's pin in
.readthedocs.yaml, which must be the version thatuv.locklocks (tests/test_readthedocs.pyfails otherwise).
Documentation¶
This documentation is built with MkDocs and
Material for MkDocs, from
docs/ and
mkdocs.yml,
by Read the Docs (configured in
.readthedocs.yaml)
and in CI (job docs), both with the versions of uv.lock (the docs
extra); warnings, e.g., of broken links, fail the build. The API
reference is generated from the docstrings with
mkdocstrings. To build it locally, or serve
it with live reloading, in the dev environment set up as above, with the
docs dependencies too (uv sync removes the extras that it isn't given, so
dev stays in the command):
uv sync --locked --extra dev --extra docs
uv run mkdocs build --strict # into `site/`, ignored by Git
uv run mkdocs serve
The introduction, the quick start and the citation of the home and getting
started pages are sections of README.md (between --8<-- [start:<name>]
and --8<-- [end:<name>] comments), so that they are written only once.
Links in these sections must be absolute, as they must also work on GitHub
and PyPI.