Skip to content

Task 13: release plumbing - #13

Merged
roachitect-aman merged 1 commit into
mainfrom
task-13-release-plumbing
Aug 25, 2026
Merged

Task 13: release plumbing#13
roachitect-aman merged 1 commit into
mainfrom
task-13-release-plumbing

Conversation

@roachitect-aman

Copy link
Copy Markdown
Contributor

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 VERSION is committed before the tag, and the workflow refuses to publish when v$(python dbprofiler.py --version) disagrees with GITHUB_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.sha256 that writes the checksum). git show <tag>:dbprofiler.py | diff - dbprofiler.py is 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-safety and 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, no branches:, no workflow_dispatch: back door), step ordering, the tag/version gate, checksum generation and re-verification, both assets attached, no rewriting step, provenance attested, contents: read by default with contents: write scoped to the publishing job, no secrets. reference beyond github.token, every action pinned to a major version, and a README that documents the filenames the workflow actually produces.

Six mutations tried — a workflow_dispatch back door, a version-stamping sed -i, dropping the tag/version gate, unpinning the attest action to @main, publishing before the audit, and widening the top-level permission to contents: write. Each was caught by the test written for it and by no other.

Also

  • --verify-tag on gh release create: without it gh will happily create the tag it was asked to release, so a typo becomes a release pointing at whatever main was.
  • README gains gh attestation verify alongside the checksum — the checksum proves the file survived the transfer, the attestation proves it came from this repository's workflow — plus shasum -a 256 for macOS and a ## Releasing section recording the bump-then-tag ritual the version gate requires.
  • Both workflow YAMLs were parsed before commit. A syntax error in a workflow does not fail CI; it silently means the workflow never runs, which for a release path would only be discovered at the tag.

Verification

python3 -m unittest      Ran 382 tests   OK
python3.9 -m unittest    Ran 382 tests   OK
--check-safety           OK (14 SQL constants checked)
ruff check               All checks passed

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>
@roachitect-aman
roachitect-aman merged commit b845fdc into main Aug 25, 2026
7 checks passed
@roachitect-aman
roachitect-aman deleted the task-13-release-plumbing branch August 25, 2026 05:22
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.

1 participant