Skip to content

B5: Release pipeline - #152

Open
Claptar wants to merge 2 commits into
mainfrom
fix/b5
Open

Claptar wants to merge 2 commits into
mainfrom
fix/b5

Conversation

@Claptar

@Claptar Claptar commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Part of #149 (wave 1, for 0.17.11). Closes #139.

Refs closed: F193, F194, F195, F196, F197, F198.

What changes

Ref Change
F193 Release tags and the publishing environment were not restricted. The gate is now in the repository's settings (applied on 2026-12-04). publish.yml's check-version also checks that the tagged commit is on main (git merge-base --is-ancestor against refs/remotes/origin/main). That catches mistakes such as tagging a release branch before it is merged. quay-on-tag.yml's job runs in a quay environment. Every job that can publish now runs in an environment, and a test keeps it that way.
F194 .github/dependabot.yml watches the pinned actions, uv.lock and the Dockerfile's base, monthly, one grouped PR per ecosystem, with a 7-day cooldown. For uv it uses lockfile-only, so the floors CI tests stay put. SECURITY.md points reporters to GitHub's private vulnerability reporting.
F195 benchmark.yml no longer runs on every tag. publish.yml starts it with a dispatch from the tag, once PyPI has the version and the release page exists. Its results go to a branch benchmark/<tag>, not to main, and the run's summary links the pull request to open.
F196 Every job has a timeout. publish.yml has one concurrency group for every run, and a run that has started is never cancelled.
F197 The release notes join each wrapped changelog line to the one before it, as CommonMark does, so GitHub shows paragraphs. Headings, list items, rules, fences, tables, quotes, link definitions and hard breaks keep their lines.
F198 gh release create gets --latest=true only for the highest X.Y.Z tag and --latest=false otherwise. It uses the same test as quay.io's :latest, run in the job, so a re-run after a newer release still gets it right.

Not touched: the node20 actions (B12 bumps them).

One departure from the issue: the benchmark pushes a branch and does not open the PR

The issue asks the benchmark to open a PR. With the settings applied on 2026-12-04, the workflow token cannot open a pull request, because "Allow GitHub Actions to create and approve pull requests" is off. A pull request opened by that token would also start no checks, so under the planned main ruleset it could not merge until someone closed and reopened it.

So the job pushes benchmark/<tag> and links compare/main...benchmark/<tag>?expand=1, both in the run's summary and as a notice. You open the PR, which starts CI as usual; the commit no longer carries [skip ci]. If you would rather the bot opened it, tick that setting again (it also lets workflows approve PRs) and add one gh pr create line.

Tests

Each finding has regression tests in tests/test_release_pipeline.py. Each docstring starts with the finding's ref, and each test checks against an oracle:

  • F193. The on-main step runs in real git repositories, and git decides. The cases are:

    • on main;
    • earlier on main;
    • a merged release branch;
    • an unmerged one;
    • a squash-merged one;
    • main not fetched;
    • a decoy tag named origin/main.

    A further test checks that every job that can publish runs in an environment, across all workflows.

  • F194. Dependabot's config is checked against the files each ecosystem reads. SECURITY.md is checked against the repository that pyproject.toml names.

  • F195.

    • GitHub's job graph for each kind of run: the benchmark starts only after the release.
    • The dispatch runs against a stand-in gh, and its -f inputs are checked against benchmark.yml's declared inputs and choices.
    • The branch push runs against a real bare remote: main never moves, and a re-run replaces the branch.
  • F196. The concurrency group, and a timeout on every job in every workflow.

  • F197. markdown-it is the oracle: the notes, rendered as GitHub shows a release, must equal the section rendered as the site shows the changelog. This runs for:

    • every section of the real changelog;
    • eleven synthetic cases, one per construct, so CI's Linux awk runs each branch.
  • F198.

    • The latest step runs against a stand-in git ls-remote for newest, by-number, backport, rc and pre-release tags.
    • The create step then runs against a stand-in gh, which records --latest=….
    • The step is asserted to be identical to quay's.

The new tests fail against origin/main's workflows (28 failures at the first commit) and pass here.

Verified

  • uv run pytest -m "not integration" on macOS: 4115 passed, 9 skipped. That run was at the first commit. After the review fixes, test_release_pipeline.py (98), test_docs_are_accurate.py and test_benchmark_harness.py were re-run: 680 passed, 1 skipped.
  • actionlint 1.7.12 and zizmor 1.31.1, CI's versions, on .github: clean, including .github/dependabot.yml.
  • The awk was run locally with macOS's awk only. CI's unit job runs the same tests with Ubuntu's awk, and the awk no longer puts an anchor inside a group.
  • An independent review of the diff found no definite bugs. Its points are fixed in the second commit:
    • the check uses the exact main ref;
    • the unwrapping is tighter;
    • the tests drop GIT_* from the environment;
    • stale and inaccurate wording is corrected;
    • SECURITY.md's scope no longer contradicts links that are read through.

For the maintainer

  1. Before tagging 0.17.11: create the quay environment with the same tag rule as pypi ([0-9]*.[0-9]*.[0-9]*), move QUAY_USERNAME and QUAY_TOKEN into it, and delete the repository-level copies (settings step 5).
    • publish.yml still passes the secrets by name. That is how a called workflow reads an environment's secret, and the environment's value wins, so the image job works both before and after the move.
    • If quay does not exist when a release runs, GitHub creates it with no protection.
  2. As this merges: turn on private vulnerability reporting (settings step 6, along with secret scanning, push protection, Dependabot security updates and CodeQL). Until then, SECURITY.md's link leads nowhere.
  3. After each release: open the pull request from benchmark/<tag> (the Benchmark run's summary links it), and merge it before the next release. The next run's "vs previous" and history read docs/benchmarks/ on main.
  4. Dependabot opens its first PRs soon after this merges. The actions group will include the major bumps that B12 (B12: CI and test coverage #146) makes, so close that PR or let B12 supersede it.
  5. For B12, which owns tests.yml:
    • the workflow lint job runs zizmor .github/workflows, which skips .github/dependabot.yml; zizmor .github would lint it too.
    • GitHub's concurrency.queue: max would queue several release tags in order instead of cancelling a waiting run, but actionlint 1.7.12 rejects the key. Once the lint job's actionlint knows it, publish.yml can use it, and the "push one tag at a time" caveat goes away.
  6. The branch name fix/b5 was October's merged B5 branch (B5: Element fidelity, legacy stores and HDF5 safety #117). It was an ancestor of main, so this push fast-forwarded it and lost nothing.

Changelog entry (for the 0.17.11 release PR)

- **Only a reviewed release tag on `main` publishes, one release at a time**
  ([#139](https://github.com/cellgeni/adata-cli/issues/139)). Release tags
  and the publishing environments are now restricted in the repository's
  settings, and `publish.yml` checks that the tagged commit is on `main`
  before anything is published. Releases run one at a time, none is
  cancelled once started, and every job has a timeout. The release notes
  show the changelog's paragraphs as paragraphs, where every wrapped line
  had been a line break since 0.17.7. A release is marked Latest on GitHub
  only when it is the newest `X.Y.Z`, as the image's `:latest` already
  was. The benchmark runs once a release is out, rather than for every tag
  pushed, and its results arrive as a branch for a pull request rather
  than a commit to `main`. Quay's credentials are used from the `quay`
  environment. Dependabot proposes updates to the pinned actions, the lock
  and the image's base, and `SECURITY.md` says how to report a
  vulnerability privately.

🤖 Generated with Claude Code

Claptar and others added 2 commits December 4, 2026 17:21
publish.yml checks that the tag is on main, runs one release at a time
with a timeout on every job, joins the changelog's wrapped paragraphs in
the release notes, and marks a release Latest only when it is the newest
X.Y.Z, as quay.io's :latest already was. It starts benchmark.yml once the
release is out; the benchmark pushes its results to a branch for a pull
request rather than to main. quay-on-tag.yml's job runs in the quay
environment. Dependabot watches the pinned actions, uv.lock and the base
image, and SECURITY.md points reporters to private vulnerability
reporting.

Refs F193, F194, F195, F196, F197, F198.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- check-version compares with refs/remotes/origin/main: git reads a bare
  origin/main as a tag of that name first.
- The notes' awk closes a fence only with the character that opened it,
  keeps rules, setext underlines and link definitions on their own lines,
  tells an escaped backslash from a hard break, and starts a list where
  CommonMark does after a list item. It no longer puts an anchor inside a
  group, and each case is tested on its own.
- The tests drop GIT_* from the environment, check the dispatch's inputs
  against benchmark.yml's, and try a tag named origin/main.
- Docs: merge the benchmark's pull request before the next release; a
  waiting Publish run can still be cancelled; TestPyPI takes main,
  release/* or a tag. SECURITY.md no longer names a version, and defines
  a vulnerability without contradicting links that are read through.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings December 4, 2026 21:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Dec 4, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-12-04T21:58:00.574600Z ac862d9 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Test Results (py3.13)

3 927 tests   3 914 ✅  10m 12s ⏱️
    1 suites     13 💤
    1 files        0 ❌

Results for commit ac862d9.

@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

Test Results (py3.12)

3 927 tests   3 914 ✅  10m 39s ⏱️
    1 suites     13 💤
    1 files        0 ❌

Results for commit ac862d9.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

B5: Release pipeline

2 participants