Task 13: release plumbing - #13
Merged
Merged
Conversation
Publish a tagged dbprofiler.py, unmodified, with a checksum and a signed provenance attestation. The point of a single-file tool is that a reviewer can read what they are about to run, which only holds if the download is byte-identical to the tag. So nothing here rewrites the script -- not even to stamp a version into it. VERSION is committed before the tag and the job refuses to publish when the two disagree. The safety audit and the unit suite run again before anything is uploaded, on Python 3.9, because a tag is the one moment the boundary stops being reviewable by reading the repository. Eleven guard tests cover the workflow the way the rest of the suite covers the tool: trigger shape, step ordering, the tag/version gate, checksum generation and re-verification, both assets attached, the absence of any step that could rewrite the script, provenance, permissions scoped to the publishing job, no secret beyond the workflow token, action pinning, and a README that documents the filenames the workflow actually produces. Six mutations were tried against them and each was caught by its own test. Co-Authored-By: roachdev-claude <roachdev-claude-bot@cockroachlabs.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Publishes a tagged
dbprofiler.py, unmodified, with a checksum and a signed provenance attestation.The download is byte-identical to the tag
The obvious thing to do at release time is stamp the version into the script. That is exactly what this must not do: the tool's value is that a reviewer reads the file before running it, which only holds if the file they read and the file they ran are the same bytes.
So
VERSIONis committed before the tag, and the workflow refuses to publish whenv$(python dbprofiler.py --version)disagrees withGITHUB_REF_NAME. A guard test fails if any step could rewrite the script —sed -i,tee,patch, or a redirect onto it (with a lookahead sparing the> dbprofiler.py.sha256that writes the checksum).git show <tag>:dbprofiler.py | diff - dbprofiler.pyis empty, and the README says so.The safety audit gates the release
A tag is the one moment the safety boundary stops being reviewable by reading the repository, so
--check-safetyand the unit suite run again before anything is uploaded — on Python 3.9, the oldest version the tool claims to support. A guard test asserts the ordering by line index, so moving the publish step above the audit turns the unit suite red.Guard tests
Eleven of them, written first and mutation-tested. Trigger shape (
v*tags only, nobranches:, noworkflow_dispatch:back door), step ordering, the tag/version gate, checksum generation and re-verification, both assets attached, no rewriting step, provenance attested,contents: readby default withcontents: writescoped to the publishing job, nosecrets.reference beyondgithub.token, every action pinned to a major version, and a README that documents the filenames the workflow actually produces.Six mutations tried — a
workflow_dispatchback door, a version-stampingsed -i, dropping the tag/version gate, unpinning the attest action to@main, publishing before the audit, and widening the top-level permission tocontents: write. Each was caught by the test written for it and by no other.Also
--verify-tagongh release create: without itghwill happily create the tag it was asked to release, so a typo becomes a release pointing at whatevermainwas.gh attestation verifyalongside the checksum — the checksum proves the file survived the transfer, the attestation proves it came from this repository's workflow — plusshasum -a 256for macOS and a## Releasingsection recording the bump-then-tag ritual the version gate requires.Verification