Repository navigation
ci(ci): release on a tag, with the checks that were memory before - #343
Conversation
|
Renamed the workflow — two files called Only one of the names was ever mine to choose.
Each now names the other in its header, so the next reader does not have to work out why there were two. No behaviour change: nothing referenced the workflow by filename except the |
Releasing is `make package` then `make publish` with an API token, and every check around it lives in whoever is doing it: that the tag matches the packaged version, that the version has a changelog section, that the commit is on master, that CI went green on it, that the milestone is finished. None of that is visible afterwards, and a version yanked from PyPI stays unusable under that number forever. Pushing a vX.Y.Z tag now runs all five as gates, builds, publishes and closes the milestone. Trusted publishing rather than a token, so there is no secret to leak, rotate or forget to scope, and each file carries signed provenance. The build runs isolated, unlike `make package --no-isolation`, so the wheel is a product of the declared build requirements rather than of the machine. Before anything is published the wheel is installed into a clean environment carrying only the declared runtime dependencies and used to disassemble a bundled sample. A missing module, absent package data or a dependency only the development environment supplies fails there rather than on a user's machine -- the artifact is tested, not the tree it came from. The release notes are this version's changelog section with GitHub's generated list appended under it; the API pre-pends a supplied body rather than replacing it. The entry says what changed and what it cost, the generated half says who did it and where to diff it. `.github/release.yml` groups the dependency bumps so they do not sit between the real changes. That file is named by GitHub, which reads the configuration from that path and nowhere else, so the workflow is named apart from it rather than being a second release.yml. The checks that parse anything live in a script with tests, because the changelog shape they read is a convention and a convention with no test drifts until the release that needs it finds out. A manual run from a tag rehearses the whole path against TestPyPI and stops before the GitHub release.
4049d12 to
92926da
Compare
|
Cut the comments back to what the code cannot say, and squashed — the intermediate states were "comments added, then removed" and a rename, neither of which is worth a reviewer's time.
The rest went to the commit body. Verified it is a comment-only change rather than trusting the diff: both YAML files parse identically to the reviewed version, and every remaining changed line is inside a comment or a docstring. The smoke step was re-extracted from the trimmed YAML and run again — the heredoc still survives the block scalar and still prints Suite 2,151 passed, 1 skipped, 2,596 subtests; |
The release workflow was written for this repository alone. purepdb, mcrit, mcritweb, mcrit-plugin and docker-mcrit now carry the same shape - a guard script over the same changelog convention, a tag-triggered workflow with the same gates, a changelog check on every PR, and a RELEASING.md stating the repository-specific values - so a maintainer learns one process. This commit brings smda's copy to that shape. The guard accepts a PEP 440 pre-release tag (v4.7.0rc1) and reports it, so the GitHub release is marked as a pre-release and never becomes latest; it accepts a changelog heading with or without the v prefix, since the other repositories write [1.9.0] and this one wrote [v4.6.0]. The wheel smoke test runs with -P so the checkout cannot stand in for the wheel; this repository's src layout hid that, a flat layout does not. The changelog check exempts Dependabot and covers pyproject.toml. SmdaConfig.VERSION is read from smda.__version__ rather than kept in sync by hand, so the version is declared once and a release bumps one line. The license is declared as an SPDX expression with license-files (PEP 639) in place of the free-text form and the deprecated classifier, and the project URLs gain Repository, Issues and Changelog. The Python floor moves to 3.12, shared across the ecosystem; the interpreter matrices and the tool target follow.
…-release-workflow # Conflicts: # CHANGELOG.md
…-release-workflow # Conflicts: # CHANGELOG.md # src/smda/SmdaConfig.py
|
Merged v4.7.0 in. One thing about how, since the obvious resolution would have written a false entry into the release you just cut. The bump moved every So the changelog is master's verbatim with this PR's four bullets placed explicitly in the new
A useful side effect: run against the merged tree, Suite 2,168 passed, 1 skipped, 2,601 subtests; |
|
Reviewed against the source rather than the body, on a worktree at Verified here
Five things, none of them blocking
One observation rather than a request: none of 🤖 Generated with Claude Code |
RELEASING.md said the build ran the `smda` entry point. This package declares no console scripts, so there is none; the smoke step disassembles a sample and stops there. "CI passed" read as covering all of master's checks. The gate reads ci.yml only -- fuzzing, the security audit and the benchmark are not in it, the benchmark because it reports skipping on some events and a gate that can never complete is worse than a narrow one. Say so, and name the benchmark as the one to confirm by eye, since it is the one that catches a recovery regression. A manual rehearsal runs the workflow as it exists at the chosen tag, so no tag cut before this workflow has one to run. Say that the first rehearsal needs a fresh tag. The docs described `## [X.Y.Z]` headings while the file uses `## [vX.Y.Z]`. Aligned them to the file. The guard accepts both on purpose, since other repositories sharing it write the bare form, so its error message now names both rather than steering toward the one this file does not use. State what the 3.12 floor costs rather than calling it alignment. IDA 9.3 and 9.4 accept any Python from 3.8 through idapyswitch, so an IDA pointed at 3.8-3.11 has to be switched to 3.12 or newer before smda.ida can be installed into it from this release on.
|
All five taken in 1. The entry point. Dropped. Right that it was a line true in a repository with console scripts; this one declares none. 2. Which CI. 3. The first rehearsal. Added to Rehearsing: a manual run uses the workflow file as it exists at the chosen tag, so the first rehearsal needs a tag cut after this merges — a throwaway 4. Heading forms. Aligned the docs to the file: 5. The 3.11 floor. I checked rather than guessed, against IDA itself. Both 9.3 and 9.4 ship So the floor is not free, but the cost is narrower than stopping at 4.7.0 for good: an IDA pointed at 3.8–3.11 has to be switched to a 3.12-or-newer Python before The floor itself is unchanged — whether that cost is worth ecosystem alignment is the support-policy call you flagged, and it is yours. Suite 2,168 passed, 1 skipped, 2,601 subtests; Agreed on the closing observation — the YAML around the script first runs on a real release, so the rehearsal belongs before the next tag. |
|
Answering the 3.11 floor, since it is the one thing I left open — and thanks for going to Keep 3.11 for now. Not because the long-term argument is wrong, but because the premise the entry rests on is not true yet, and the cost of waiting is one CI leg. What I checked
On the long-term argumentYour case is that the switch is paid once and is better paid deliberately than under pressure. I agree with that, and it is why I want the policy written down rather than the floor left to drift. The timing does not follow from it, though:
One mechanical note on reversibility: What I would like in this PRDrop the floor, keep everything else. To be specific about the hunks: Out: In, unchanged: PEP 639 ( And in place of the bump, a policySince what you are after is predictability, let us have it in writing rather than as a floor set early:
Either in this PR or a follow-up, whichever keeps this one moving. Everything else here I am ready to merge. 🤖 Generated with Claude Code |
No dependency needs 3.12 -- purepdb and pycxxfilt are >=3.11, lief >=3.9, capstone and dnfile >=3.8, dncil >=3.7 -- and MCRIT and purepdb still declare 3.11. Raising SMDA's floor alone would not have aligned anything: it would have left SMDA the only component at 3.12, and pip on 3.11 would silently resolve MCRIT's unbounded smda>=4.2.13 back to 4.7.0 while MCRIT kept advertising 3.11 and nothing errored. So the floor goes back to 3.11: requires-python, the 3.11 classifier, ruff's target-version, the ci.yml matrix with its Windows and macOS legs and the coverage conditions keyed to them, the MCRIT install legs, and the interpreter the profile, security and benchmark workflows pin. The release workflow now builds and smoke-tests on 3.11 too, since the installed wheel is only proven on the oldest interpreter it claims. Everything else stays: the PEP 639 licence expression and license-files, setuptools>=77 without wheel, and the project URLs. In place of the bump, the policy. SMDA's floor follows MCRIT's and moves in the same wave, triggered by whichever comes first of MCRIT and purepdb moving to 3.12, a runtime dependency dropping 3.11, or 3.11's end of life in October 2027. RELEASING.md states it and Unreleased carries the deprecation notice, so smda.ida users get the warning in advance rather than meeting it as a silent downgrade. The release script and its tests were written while the floor was 3.12. Checked they hold on 3.11: ruff passes with target-version py311, which reports syntax a version cannot parse, and all three changed Python files compile under 3.9, a stricter lower bound.
|
Done in Out, per your list: Three hunks you did not list were the same floor in other files, so they went too: the pinned interpreter in Kept, verified in a real build rather than read off the diff: the wheel's metadata carries The policy is in One risk worth closing, since the release script was written while the floor was 3.12: there is no 3.11 on this machine and I did not want to install an interpreter unasked, so I checked two ways instead. Suite 2,168 passed, 1 skipped, 2,601 subtests; |
|
Verified The floor revert is complete, and byte-identical where it should be
The release workflow building on 3.11 is the part I would not have asked for and is the right call. An artifact proven only on 3.12 while its metadata claims 3.11 is a gap the smoke step exists to close, and it would have survived the revert unnoticed. Wheel metadata, built here rather than read off the diff
The four documentation pointsAll four fixed in
Re-ran the guard against the real tree at this head: The policyThe Supported Python versions section is the part that will still be doing work in a year. Stating the resolver mechanism — that a floor raised alone becomes a silent downgrade rather than an error — is what makes the rule hold up when someone later asks why SMDA is waiting on MCRIT. Same for recording that Merging. Thank you for the two follow-ups inside a day, and for checking 3.11 compatibility two ways rather than installing an interpreter unasked. 🤖 Generated with Claude Code |
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>
…e memory before Releasing purepdb was `make publish` with an API token, and the tag workflow only attached artefacts to a release with generated notes. Every check around a release lived in whoever was 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 that CI went green on it. None of that is visible afterwards, and a version yanked from PyPI stays unusable under that number forever. `.github/workflows/publish-release.yml` replaces `release.yml`. Pushing a `vX.Y.Z` tag now verifies, builds, publishes and releases: - **verify** refuses the tag unless it matches both version strings, `CHANGELOG.md` has a `## [X.Y.Z] - <date>` section (which becomes the release notes), the commit is an ancestor of `main`, CI concluded `success` on it, and a milestone named for the tag, if one exists, has no open items; - **build** runs `python -m build` in isolation and `twine check --strict`, then installs the wheel into a clean venv and imports it under `python -P`, so the checkout cannot stand in for the artefact; - **publish** uploads through trusted publishing with `id-token: write` as the only credential and attestations on — no token is stored anywhere; - **release** creates the GitHub release with the changelog section as its body and `--generate-notes` appended, attaches the sdist and wheel, and closes the milestone. Pre-release tags are marked and never become latest. A manual run rehearses the whole path against TestPyPI and stops before the release. The hand-written `CHANGELOG.md` is the single stream of change information: a new `Changelog` check requires an entry from any PR touching `purepdb/` or `pyproject.toml`, or the `no-changelog` label. `.github/release.yml` groups the dependency bumps so they do not sit between the real changes. `release_guard.py` carries the parsing, with 13 tests, because the changelog shape it reads is a convention. It is the same script across the ecosystem, varying only in its `VERSION_SOURCES` table, so there is one thing to fix rather than six that resemble each other. `RELEASING.md` documents cutting, rehearsing, pre-releases, recovery, the Python floor policy and the one-time maintainer configuration. The Python floor stays at 3.11: purepdb sits at the bottom of the stack — smda depends on it unbounded and MCRIT reaches it through smda — so raising it alone would silently resolve smda back to an older purepdb with nothing reporting the downgrade. Still to be configured by a maintainer before a tag can publish: the PyPI trusted publisher, a *pending* publisher on TestPyPI, the `pypi` and `testpypi` environments, and the `no-changelog` label. One of six pull requests giving the MCRIT ecosystem one release process, after danielplohmann/smda#343. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Releasing today is
make packagethenmake publishwith an API token, and every check around it lives in the head of whoever is doing it. #341 and #337 wrote those checks down; this makes them run.Pushing a
vX.Y.Ztag builds, publishes, creates the release and closes the milestone. Nothing else is triggered by a branch push, so a release stays a deliberate act.What it refuses to publish
Five gates, each of which is a mistake that is only visible afterwards — and a version yanked from PyPI stays unusable under that number forever:
CHANGELOG.mdsection## [Unreleased]renamed without being written, or not renamed at allmastersuccessfor that commitmasteris green" as a gate rather than a habitThere is already a
v4.7.0milestone with two open items, so this gate is live rather than theoretical.What it does differently from the Makefile
Trusted publishing, not a token.
id-token: writeand no username or password, per the action's own README — so there is no secret to leak, rotate or forget to scope, and each file carries signed PEP 740 provenance.The build is isolated, unlike
make package's--no-isolation, so the wheel is a product of the declared build requirements rather than of whatever the machine held.The artifact is tested, not the tree it came from. Before anything is published the wheel goes into a clean environment carrying only the declared runtime dependencies, and disassembles a bundled sample with it. A missing module, absent package data or a dependency that only the development environment supplies fails there rather than on a user's machine. I found the shape of that check the useful way: running the full suite against the installed wheel fails, because a test imports a CI helper that needs
tqdm— which is exactly the kind of dev-environment dependency this is meant to catch.Release notes
The body is this version's changelog section;
--generate-notesappends the merged pull requests, contributors and compare link underneath, since the API pre-pends a supplied body rather than replacing it. The entry says what changed and what it cost; the generated half says who did it and where to diff it, and neither substitutes for the other..github/release.ymlputs the dependency bumps in their own group — 12 of the last 100 merged PRs are Dependabot's, and the repo already labels them, so otherwise they sit between the real changes.Verification
The parts that parse anything are in
.github/workflows/scripts/release_guard.pywith 12 tests, because the changelog shape they read is a convention and a convention with no test drifts until the release that needs it finds out. Each test verified to fail under a mutation of the line it covers: the section not stopping at the next heading, the heading date not required, an empty section accepted, a version disagreement ignored, thevprefix not required.Everything I could exercise without a release, I did:
smda 4.6.0: 33 functions, status okgh release createaccepts--notes-fileand--generate-notestogether — it reaches the API rather than rejecting the combinationrepository-url: ''resolves to PyPI: the canonical input carries no default, so the action falls through to the deprecated alias that defaults to the real indexzizmor --persona=regularclean. It flaggedsoftprops/action-gh-releaseas superfluous and exited 11, which would have failed the Workflow audit job — replaced with the runner's owngh, which also means one fewer third party in the path that signs and announces a releaseFull suite 2,151 passed, 1 skipped, 2,596 subtests;
ruffclean;make typecheckexit 0 at 267, master's own count, so the new script adds none.The one thing that cannot be automated
Trusted publishing needs the publisher configured on PyPI before the first run, and the workflow names two environments:
pypirelease.ymltestpypirelease.ymlWorth adding a required reviewer on
pypi— that turns the publish into an approval step, which is the last chance to stop a release after everything else has passed.Rehearse before trusting it: run the workflow manually from a tag. It takes the same five gates and publishes to TestPyPI, then stops without creating a release.
skip-existingis on for that path only, so a second rehearsal of the same tag is not blocked by the first; on PyPI a collision means the version is already public and stopping is correct.Closes nothing on its own — it is #323's rollout step 4, and it makes #341's "close it when the tag is pushed" automatic.
Update: the ecosystem-wide shape
The second commit brings this workflow to the shape now shared by purepdb, mcrit, mcritweb, mcrit-plugin and docker-mcrit — the same guard over the same changelog convention, the same gates, the same changelog check, and a
RELEASING.mdin each repository stating only the values that differ. What changed here as a result:v4.7.0rc1) and reports it, so the GitHub release is marked as a pre-release and never becomes latest; PyPI does not install one without--pre. It accepts a changelog heading with or without thevprefix, since the other repositories write[1.9.0]and this one wrote[v4.6.0].python -P, so the checkout in the working directory cannot stand in for the wheel. This repository'ssrclayout hid that; running the same step in a flat-layout repository imported the source tree and passed on a wheel that was never checked.pyproject.toml.SmdaConfig.VERSIONis read fromsmda.__version__rather than kept in sync by hand, so the version is declared once, the guard reads one place, and a release bumps one line.report.smda_versionis unchanged.pyproject.tomldeclares the license as the SPDX expressionBSD-2-Clausewithlicense-files(PEP 639) in place of the free-text form and the deprecated classifier — the wheel now carriesLicense-Expression: BSD-2-Clause— and gainsRepository,IssuesandChangelogURLs. Building needssetuptools>=77; thewheelrequirement was already unnecessary.RELEASING.mddocuments cutting, rehearsing, pre-releases, recovery and the one-time configuration;AGENTS.mdpoints at it and no longer describes a three-place bump.Re-verified on the second commit: full suite 2,151 passed, 1 skipped (
make test-all),ruffclean,make typecheckat master's own 267;python -m build+twine check --strictpass and the wheel, installed into a clean Python 3.13 venv with-P, disassemblescutwail_xoredto 33 functions withSmdaConfig.VERSION == smda.__version__ == 4.6.0;zizmor --persona=regularandactionlintclean.Update: the 3.11 floor is kept
An earlier revision raised the floor to 3.12 for ecosystem alignment. It is back at 3.11, because the premise did not hold yet: no dependency needs 3.12, MCRIT and purepdb still declare 3.11, and raising SMDA's floor alone would have left it the only component at 3.12 — with pip on 3.11 silently resolving MCRIT's unbounded
smda>=4.2.13back to 4.7.0 while MCRIT kept advertising 3.11.Reverted:
requires-python, the 3.11 classifier,ruff'starget-version, theci.ymlmatrix with its Windows and macOS legs and the coverage conditions keyed to them, the MCRIT install legs, and the interpreter the profile, security, benchmark and release workflows pin. The release workflow builds and smoke-tests on 3.11, since an installed wheel is only proven on the oldest interpreter it claims.Kept: the PEP 639 licence expression and
license-files,setuptools>=77withoutwheel, and the project URLs.In place of the bump, a written policy in
RELEASING.mdand aDeprecatednotice underUnreleased: SMDA's floor follows MCRIT's and moves in the same wave, at whichever comes first of MCRIT and purepdb moving to 3.12, a runtime dependency dropping 3.11, or 3.11's end of life in October 2027.Verified on the current head: full suite 2,168 passed, 1 skipped, 2,601 subtests;
ruffclean attarget-version = "py311";make typecheckexit 0;zizmorclean. A realpython -m buildproduces a wheel whose metadata readsRequires-Python: >=3.11,License-Expression: BSD-2-ClauseandLicense-File: LICENSEwith 3.11–3.14 classifiers, andtwine check --strictpasses both files. The release script and its tests were written under the 3.12 floor, so I checked they hold on 3.11:ruffat py311 reports syntax a version cannot parse and finds none, and all three changed Python files compile under 3.9.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.