Skip to content

Release on a tag through trusted publishing, with the checks that were memory before - #59

Merged
danielplohmann merged 5 commits into
danielplohmann:mainfrom
r0ny123:release/modernize-release-workflow
Sep 15, 2026
Merged

danielplohmann merged 5 commits into
danielplohmann:mainfrom
r0ny123:release/modernize-release-workflow

Conversation

@r0ny123

@r0ny123 r0ny123 commented Sep 12, 2026 •

Copy link
Copy Markdown
Contributor

Releasing purepdb is make publish with an API token, and the tag workflow only attaches artefacts to a release with generated notes. The checks around a release live in whoever is doing it: that the tag matches pyproject.toml and purepdb/__init__.py, that the version has a changelog section, that the commit is on main and CI went green on it. None of that is visible afterwards, and a version yanked from PyPI stays unusable under that number forever.

This is one of six pull requests giving the MCRIT ecosystem one release process — the same guard, the same tag-triggered workflow, the same changelog check, and a RELEASING.md in each repository stating only the values that differ. A maintainer learns it once.

Architecture

The hand-written CHANGELOG.md is the single stream of change information. Every PR that touches purepdb/ or pyproject.toml adds its own bullet under ## [Unreleased] while the change is fresh, or carries the no-changelog label; a new Changelog check enforces that (read-only token, no PR content executed, Dependabot exempt). At release time the version's section is the release notes, and GitHub's generated list of merged PRs and contributors is appended under it — the entry says what changed and what it costs, the generated half says who and where to diff. .github/release.yml groups the dependency bumps so they do not sit between the real changes.

I looked at Release Please, semantic-release, towncrier and scriv. All of them either derive the notes from commit subjects (which this repository's commit style does not carry, and which produce a list rather than an entry) or add a second place where release information is written. The repository already had a Keep a Changelog file and the discipline to fill it; the cheapest reliable system is to make that file authoritative and gate on it.

Versioning stays Semantic Versioning over purepdb.__all__, as the changelog header already states. The version is declared in pyproject.toml and purepdb/__init__.py; tests/test_version.py already tied them together, and the release workflow now refuses a tag that does not match both.

What pushing vX.Y.Z does now

.github/workflows/publish-release.yml replaces release.yml:

job what it does
verify refuses unless the tag matches both version strings, CHANGELOG.md has a ## [X.Y.Z] - <date> section (written out as the notes), the commit is an ancestor of main, and the CI workflow concluded success on that commit
build python -m build in isolation, twine check --strict, then installs the wheel into a clean venv and imports it with python -P so the checkout cannot stand in for the wheel — checks __version__, py.typed, and runs the purepdb entry point
publish pypa/gh-action-pypi-publish through trusted publishing, id-token: write as the only credential, attestations on. Environment pypi; a manual run goes to testpypi instead and skips an existing version
release gh release create with the changelog section as body, --generate-notes appended, sdist and wheel attached. Pre-release tags (v0.6.0rc1) are marked --prerelease and not --latest

A manual run from a tag rehearses the whole path against TestPyPI and stops before the GitHub release. The guard script has tests (tests/test_release_guard.py), because the changelog shape it reads is a convention.

Other changes

  • Python floor 3.12 (requires-python, classifiers, CI matrices, ruff target). The ecosystem shares one floor now; nothing in the parser needed 3.12. Recorded under Removed.
  • RELEASING.md documents cutting, rehearsing, pre-releases, recovery and the one-time maintainer configuration; AGENTS.md and the README point at it.
  • The build job installs the dev group, so the pinned build/twine/hatchling versions stay the single copy, as AGENTS.md requires.

pyproject.toml was already PEP 621 with a PEP 639 license expression and a PEP 735 dev group; only the floor moved. Dependabot was already configured for actions and pip.

Security

  • Every action pinned to a commit SHA (unchanged); persist-credentials: false on every checkout; top-level contents: read, raised per job only where a job writes.
  • No token stored anywhere — trusted publishing replaces make publish's API token, and each file carries PEP 740 provenance.
  • zizmor --persona=regular reports no findings; actionlint clean.

Tests

  • Full suite: 601 passed (locally on 3.13, unchanged from main), ruff check and ty check clean.
  • python -m build + twine check --strict pass; the wheel installs into a clean Python 3.13 venv, imports from site-packages with py.typed present, purepdb --help runs. The wheel's metadata reads Requires-Python: >=3.12, License-Expression: BSD-3-Clause.
  • release_guard.py --tag v0.5.0 run against the real tree extracts the 0.5.0 section and reports prerelease=false.
  • The one path I could not run is the publish itself; it is the documented action used exactly as its README prescribes.

What a maintainer has to configure once

  1. A trusted publisher on pypi.org for purepdb: owner danielplohmann, repository purepdb, workflow publish-release.yml, environment pypi. The same on test.pypi.org with environment testpypi enables rehearsals.
  2. GitHub environments pypi and testpypi. A required reviewer on pypi turns the publish into an approval step.
  3. The no-changelog label.

Until 1 is done, pushing a tag fails at the publish job with PyPI's own message; nothing is created on GitHub, and the tag can be deleted and re-pushed.

Compatibility

make publish still exists as the manual fallback. Consumers are unaffected except for the 3.12 floor; smda, the one in-ecosystem consumer, moves to the same floor in its own PR.

Related pull requests across the ecosystem

The same process, one PR per repository. None depends on another to merge; release order once merged is smda → purepdb → picblocks → MCRIT → MCRITweb → docker-mcrit.

…e memory before

Releasing was `make package` then `make publish` with an API token, and the
tag workflow only attached artefacts to a release with generated notes. Every
check around it lived in whoever was doing it: that the tag matches both
version strings, that the version has a changelog section, that the commit is
on main and CI went green on it.

Pushing a vX.Y.Z tag now runs those as gates, builds in isolation, installs
the wheel into a clean environment and imports it with the checkout kept off
sys.path, publishes to PyPI through trusted publishing with signed provenance,
and creates the GitHub release from the version's changelog section with the
generated contributor list appended. Pre-release tags are marked as such. A
manual run rehearses against TestPyPI and stops before the release.

A PR that changes purepdb/ or pyproject.toml now has to touch CHANGELOG.md or
carry the no-changelog label, so the release notes are written while the
change is fresh rather than reconstructed at release time.

The Python floor moves to 3.12, shared across the MCRIT ecosystem.

The checks that parse anything live in a script with tests, because the
changelog shape they read is a convention.
r0ny123 and others added 2 commits September 13, 2026 01:00
…loader for ty

Since Python 3.12, shutil.which() on Windows resolves a file only under one of
the PATHEXT extensions, even when handed an absolute path. The stub
llvm-pdbutil the validator tests hand in has no extension, so on the new floor
the guard read it as absent and skipped, and the test that expects a run over
an empty corpus to fail saw it succeed instead. The stub carries a .bat
extension on Windows; it is never executed there.

The guard test loads the script through importlib and left the spec and
loader unnarrowed, which ty checks in this repository.
Raising requires-python to 3.12 is a user-visible breaking change -- it is
what makes pip refuse the wheel on 3.11 -- and it rode in on a
release-workflow PR whose title says nothing about it. Nothing in the
workflows needs 3.12 (tomllib is 3.11), so this PR runs on the floor the
project has, and the bump goes to a branch of its own with its Removed
entry, where it can be reviewed as the ecosystem decision it is. The
Windows shutil.which fix stays: it is harmless on 3.11 and needed the day
the floor moves.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017jQKALSgFN7VecWTqzWSmD
r0ny123 added a commit to r0ny123/purepdb that referenced this pull request Sep 12, 2026
…anielplohmann#59 and the dependabot bumps

Fill in the fuzz and timing results, note the follow-up branches, and
summarise the review in the log.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017jQKALSgFN7VecWTqzWSmD
danielplohmann and others added 2 commits September 15, 2026 08:29
Two places where this repository had drifted from the shape smda merged in
danielplohmann/smda#343.

The milestone gate: verify refuses a tag whose milestone still has open items,
and release closes that milestone once the release exists. Both steps are
byte-identical to smda's, so the ecosystem keeps one thing to fix rather than
two that resemble each other. A tag with no milestone emits a notice and
releases, which is what makes this adoptable here -- purepdb's one milestone is
named `0.3.0` without the `v`, so nothing matches a tag until a release is
tracked that way deliberately.

The Python floor: smda's RELEASING.md names purepdb as one of the conditions
for moving off 3.11, so the reasoning has to exist on this side too. Framed the
way it actually applies here rather than copied: purepdb is at the bottom of
the stack -- smda depends on `purepdb>=0.3.0` unbounded, MCRIT reaches it
through smda -- so this floor constrains what is above it instead of following
it, and raising it alone would silently resolve smda back to an older purepdb
on 3.11 with nothing reporting the downgrade.

Verified: the gate's jq run verbatim against this repository's API in both
branches it can reach -- no milestone for `v0.6.0` (notice), `0.3.0` at 100%
(pass); the open-items branch has no milestone here to exercise it, and is
smda's own tested code. zizmor --persona=regular clean, 601 passed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
`purepdb` does not exist on TestPyPI, so "add the same publisher on TestPyPI"
sends a maintainer to a project page that is not there. The mechanism for a
project that does not exist yet is a pending publisher, on a different form,
which the first successful upload converts into an ordinary one.

Also states which path reaches TestPyPI at all: a manual rehearsal, never a tag
push. A tag always goes to PyPI, where re-running an existing version is a
collision rather than a skip.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@danielplohmann
danielplohmann merged commit bb93206 into danielplohmann:main Sep 15, 2026
11 checks passed
danielplohmann added a commit that referenced this pull request Sep 15, 2026
Both version strings to 0.6.0, `## [Unreleased]` renamed to
`## [0.6.0] - 2026-09-15` with a fresh empty one above it, and the compare links
moved on. No source changes.

First release cut through `publish-release.yml`, which has existed since #59
without a tag ever exercising it.

23 entries from five merged PRs plus the release machinery and three dependency
bumps: the corpus-audit fixes (#60), the single-pass record walk (#61), the
mapped `PDB.open` and streamed inline-site placement (#62), the C7/C11 signature
handling (#65) and the parse-boundary hardening (#53).

Minor rather than patch: the `Fixed` entry for the fused
`ChangeCodeLengthAndCodeOffset` annotation says **This moves addresses** -- the
second and later ranges of an inline site built from that opcode now start
earlier than 0.5.0 reported, on every rust-lld and clang output. The first
range, and every single-range site, are unchanged. `CHANGELOG.md`'s preamble
reserves that for a breaking change and requires it to be stated.

Verified before tagging: `release_guard.py --tag v0.6.0` extracts the section
and reports prerelease=false, and refuses v0.7.0 naming both version strings;
645 passed, ruff and ty clean on the new pins; `python -m build` plus
`twine check --strict` pass on both artefacts; and the wheel, installed into a
clean venv and imported with `python -P`, reports 0.6.0 from site-packages with
`py.typed` present and runs the entry point.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@r0ny123
r0ny123 deleted the release/modernize-release-workflow branch September 30, 2026 18:46
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.

2 participants