Repository navigation
ci(release): a preflight job refuses a bad tag before any build, and a failed release can be re-run (#1457) - #1460
Merged
Merged
Conversation
…a failed release can be re-run (#1457) publish.yml now starts with a preflight job that every other job needs. For a tag push it refuses, in seconds, a tag that is not vX.Y.Z, is lightweight or not verified as signed by GitHub, names another commit than the one pushed, whose commit is on neither main nor a hotfix/* branch, or that disagrees with any version file (rvt, rvt-py, rvt-rs-mcp, rvt-wasm, the =X.Y.Z pins on rvt, viewer/package.json, CITATION.cff, both lock files, the CHANGELOG.md section, pyproject.toml leaving the wheel's version to rvt-py/Cargo.toml), then waits for CI passed on the tagged commit. The decisions are pure functions in tools/ci/release_preflight.py with failure-first tests, run by the PII guard job; the same version check runs there on every pull request. Deploy viewer's wait for CI moves into the wait-for-check composite action, which the preflight uses too. A docs-only commit that has CI's check anyway (the last commit of a push that changed more) now waits for it. Also: the crates.io steps skip a version crates.io already has, PyPI skips existing files from the second attempt on, one global release concurrency group, the docs.rs preview on CI's pinned nightly with CI's banner check, no playwright --with-deps, workflow values passed through env, SHA256SUMS attested with the archives, and the Intel macOS CLI smoke-tested under Rosetta. Refs #1457
…tests name each comparison, and the release docs say what the tag runs (#1457) The second read of #1460 found that the tests matched substrings, so dropping five of the fourteen version comparisons left all 57 passing, and that a docs-only commit tagged after a red one read as having nothing to wait for and would have shipped the red commit's tree. - test_release_preflight.py asserts the exact problems, builds each of the fourteen sources stale on its own (the stream_evidence pin included), and folds 57 tests into 26. Mutating the five comparisons the read named, and 23 other conditions of the module, in a scratch copy fails the tests each time. - wait-for-check: with docs-only-skips "false" a commit whose every file CI's push filter skips fails at once with the reason instead of passing or waiting 80 minutes; one that carries the check anyway is still waited for. publish.yml passes "false"; Deploy viewer keeps the default. - RELEASE.md: the tag goes on a commit CI ran on; a hotfix from v0.15.0 or older runs the workflow files of its tag and has no preflight unless it carries them; the landing queue stays disarmed between the squash and the tag; the release page's wheels and sdist are outside SHA256SUMS and the attestations (#1466), also said in docs/install.md. - release-binaries.yml: the Rosetta install step has a 10-minute timeout. - docs/maintaining.md: the tag ruleset's administrator bypass. Refs #1457
DrunkOnJava
marked this pull request as ready for review
November 5, 2026 19:29
8 of 15 tasks
DrunkOnJava
enabled auto-merge (squash)
November 5, 2026 20:02
DrunkOnJava
added a commit
that referenced
this pull request
Nov 5, 2026
…kflows and widen the PII guard (#1457) (#1462) ## Summary Gates and schedule, part 1 of 2 for #1457: every job that runs steps is time-bounded, the PII guard reads capitalised paths, every runner is a pinned image, the workflows are linted with actionlint and shellcheck, and a script holds the values that must agree across files and fails on any job that lacks a limit. The scheduled checks (part 2) are #1463. ## Motivation #1457 found most jobs with no `timeout-minutes` (the default is 360), a PII guard whose patterns start with `[a-z]` and which skips every workflow file, `-latest` runner labels that move without a commit, stale text in two workflow descriptions and four issue forms, and nothing that checks a workflow before it runs. By the count of `tools/ci/check-workflows.py` 53 jobs ran steps on the day I started (54 now, with `claude.yml`) and 8 had a timeout. ## Changes - PII guard (`ci.yml`): `/Users/`, `/home/` and `C:\Users\` take a user name beginning with either case, a Windows profile folder may hold spaces, and only `ci.yml` (which defines the patterns) is left out of the scan instead of every workflow. A `git grep` that fails (status above 1, such as a pattern that does not compile) now fails the step; it used to read as clean. The patterns are otherwise as they were. - Timeouts on every job that runs steps: 45 jobs gain one (`ci.yml` 20, `publish.yml` 9, `release-binaries.yml` 4, `measure.yml` 3, `fuzz.yml` 3, and `codeql.yml`, `deploy-viewer.yml`, `corpus-nightly.yml`, `perf-budget.yml`, `scorecard.yml`, `zizmor.yml` 1 each). Each is at least 3 times the longest run of that job among the last 96 runs on main and 29 pull-request runs (100 runs of `ci.yml` for the wheel job); the release jobs, which must not die on their limit, are at least 5 times the longest of their last 9 runs (`publish.yml` 20 to 90 minutes, `release-binaries.yml` 20 to 100; `publish-testpypi` was skipped in all 9 runs, so it has no duration and takes the 20 of the other upload jobs). `fuzz`'s limit is an expression: 40 minutes on the default 300 s budget (10 to 13 minutes seen), 360 when a manual run sets another duration. IfcOpenShell has 70: 3.1 times the 22.9 minutes it once took (a slow runner, every step slow) and 17 times its median of 4.0. - Corpus health has 180 minutes. A host that drops packets holds the BIM4LCA and R2025 fetches to their own retries, which end as NOT MEASURED, a warning: BIM4LCA tries two URLs, each five tries of 300 s with 150 s of pauses, 55 minutes; R2025 downloads three archives, and two at their 900 s limit followed by a third refused on four tries of 900 s is 90 minutes; the rest of the job is about 10: 155 in all, and the limit sits above that so a dead host never becomes a red timeout. (The RE1 fetch, `fetch-re1` since #1461, is a red failure, not NOT MEASURED, and is cut off at 15 minutes by its own `timeout 900`: 170 in all.) - `tools/ci/check-workflows.py`, run by `env config lint`, with failure-first tests in `tools/ci/test_check_workflows.py`: it fails on - a job that runs steps without a timeout (a job that calls a workflow is left out); - a `-latest` runner label; - an MSRV that differs between `Cargo.toml`, the two test matrix strings, the other crates (`rvt-mcp` at 1.88 is named as deliberate) and the prose that states it (`README.md`, `CONTRIBUTING.md`, `.cursor/install.sh`, `AGENTS.md`, `docs/python.md`, `RELEASE.md` and `docs/install.md`, which also says the MCP server needs 1.88: that sentence is read against `rvt-mcp`'s own `rust-version`, and an install page whose MCP wording cannot be read fails instead of passing unread); - a documentation-only path list that differs between `ci.yml`'s `paths-ignore`, `viewer-paths` and Deploy viewer's wait step (`viewer-paths` adds `docs/viewer-demos.json` and `docs/support-matrix.json`, named as deliberate; the check reads the wait step's script from a local action too, which #1460 introduces); - a `uses: $/.github/...` or `./.github/...` that names no file, or whose `with:` names an input the target does not declare or leaves out one it requires. actionlint does not know the `$/` form, so `.github/actionlint.yaml` ignores that message and this check stands in for what actionlint would have checked. `PENDING`, the list of jobs another change still edits, is empty. PyYAML joins `requirements-test.txt` with its hashes; its block was spliced in beside the others, and the `uv pip compile` command at the top of the file now produces a fuller file (universal markers for Python before 3.11, `colorama`, `exceptiongroup`, `tomli`, a split `rpds-py`) than the committed one, so a later regeneration will differ in more than PyYAML. CI installs it with `--require-hashes` on Python 3.12. - actionlint 1.7.12 and shellcheck 0.11.0 (the latter through `taiki-e/install-action`, which has no actionlint; the actionlint tarball is checked against the sha256 of its release) in `env config lint`. `.github/actionlint.yaml` ignores exactly the two messages about the `$/` form, whole-message and only for a `$/.github/` target. - Runner pins: every Windows leg runs on `windows-2025-vs2026` and every macOS leg on `macos-26` (the test job, the wheel job, `publish.yml`, `release-binaries.yml`), the images `windows-latest` and `macos-latest` resolved to on 2026-11-05 (actions/runner-images' README lists these labels for them). A pinned label retires eventually: GitHub announces the date in actions/runner-images and runs brownouts first, and after it a job on the label has no runner to pick it up. Moving to the next image is a deliberate edit, as for `ubuntu-24.04` (the comment at `jobs:` in `ci.yml` says so). - Stale text: the `fast` input's description and `ci-pr.yml`'s comment name `corpus-mcp`; the `test` job's header states the unit-test rule as it is; the three issue forms list Revit 2027 down to 2015; `re_finding.yml` links the corpus intake page by its full URL. ## Merged with the other pull requests #1460 (release preflight) and #1461 (wheels without LTO, CodeQL, one RE1 pin list, retried SARIF uploads) are on `main` and merged into this branch. #1460: two textual conflicts, both small (`release-binaries.yml`: the x86_64 macOS entry, mine `macos-26` against its `macos-latest` with `smoke: true` and `rosetta: true`; `publish.yml`: `validate-wheel-install`'s `timeout-minutes` against its `needs: [preflight, build-wheels]`), resolved by taking both. #1461: one conflict, `ci.yml`'s python-wheel job (my pinned `os:` labels beside its no-LTO `env` block), both kept. Two jobs it added had no timeout, and `check-workflows.py` found them: `scorecard.yml`'s `upload-retry` and `zizmor.yml`'s `zizmor-retry` now have 15 minutes, as the jobs they retry do. `PENDING` is empty. #1463 (scheduled checks) is on `main` too and merged: one conflict, `fuzz.yml`'s fuzz job (my timeout expression beside its `actions: read` permissions block), both kept, and the new `scheduled-checks.yml` and `report-failure.yml` already carry timeouts and pinned labels. On the merged tree `check-workflows.py` finds 65 jobs in 17 workflows, 31 local references, 0 errors and 0 warnings, and actionlint exits 0. The RE1 fetch in Corpus health is now `fetch-re1`: each `curl` has `--connect-timeout 20 --speed-limit 1024 --speed-time 60` (a transfer under 1 kB/s for 60 s is abandoned, three tries per host) and the step runs under `timeout 900`, so a stall there is bounded at 15 minutes instead of by the job's limit. The Corpus health arithmetic is 55 + 90 + 10 + 15 = 170 minutes under the limit of 180, and the comment says so. The `publish.yml` wheel comment said it mirrors the CI wheel, which is now a smoke build without LTO, and now says what differs. ## Testing Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead. - [ ] `tools/check-local.sh` passes (fmt, clippy, rustdoc, build, real-file / CLI / contract checks). N/A: CI-only change; no local compute on this lane, CI is the build. - [ ] Verified end to end on real Revit files. N/A: no Rust or reader change. - [ ] If this touches the IFC exporter. N/A. - [ ] If this is a performance change. N/A. What was run: - `actionlint .github/workflows/*.yml` on `main`: 22 messages (16 `[action]`, 6 `[workflow-call]`, all the `$/` form, no shellcheck finding); with `.github/actionlint.yaml` exit 0. In a scratch copy `uses: foo/bar`, `uses: $/other`, `uses: $/.github/actions/with space` and `uses: other/repo/.github/workflows/x.yml` are still reported, and so is a shellcheck finding in a `run:` script. - `python3 tools/ci/check-workflows.py` on this head: 0 errors, 0 warnings; 65 jobs run steps in 17 workflows, 31 local references, 8 crates and 7 prose files for the MSRV (the head merged with #1463). - `python3 tools/ci/test_check_workflows.py`: 81 tests of the pure comparisons. Of 33 mutations of the script every one makes a test fail (one that did not, a `uses` branch shadowed by an absent `steps`, now has a test that observes it), and of 10 more of the two-valued prose check nine do; the tenth is the line in `main()` that reports an `rvt-mcp` with no `rust-version`, which the prose check reports anyway. - Two stale prose statements planted in the working tree (`RELEASE.md`'s `MSRV 1.86`, `docs/install.md`'s `needs Rust 1.89 or later`): `check-workflows.py` exits 1 with one error for each (`RELEASE.md: states Rust 1.86, Cargo.toml's rust-version is '1.87'`; `docs/install.md: says the MCP server needs Rust 1.89, rvt-mcp/Cargo.toml's rust-version is '1.88'`), and 0 errors after both were put back. - On local scratch commits, never pushed: two typos in local references (`$/.github/actions/fetch-re1x`, `$/.github/workflows/nothere.yml`): actionlint exits 0, `check-workflows.py` reports 4 errors, one per use; a stale README MSRV (`MSRV 1.86`) and `publish.yml`'s `build-sdist` without a timeout: both reported, and earlier the `fmt` job without a timeout, MSRV 1.86 in the fast matrix string, `CITATION.cff` dropped from `paths-ignore` and `fmt` on `ubuntu-latest`, each reported. - The PII guard, the step's own script extracted from `ci.yml` and run with `bash` on local scratch commits that were never pushed (a fake capitalised user name was planted: a file holding `/Users/<Name>/`, `/home/<Name>/` and `C:\Users\<Name With Space>\` paths): - `main`'s step on the planted commit: `PII guard: clean.` - this branch's step on the same commit: exit 1, the three patterns each matched with the file and line. - a planted path in `zizmor.yml`, a workflow other than `ci.yml`: `main`'s step is clean, this branch's exits 1. - the plants removed: `PII guard: clean.` - a pattern that does not compile: `main`'s step prints `clean.`, this branch's exits 1 with `git grep failed (status 128)`. - Hashed install of `tools/ci/requirements-test.txt` on Python 3.12 (uv, `--require-hashes`) succeeds with PyYAML 6.0.3. - On GitHub's runners at the first push (head `cdd2c731`, run 42076073074, a draft, so the fast set): `fast / env config lint` passed in 44 s with every new step (shellcheck 0.11.0 and actionlint installs and runs, the tests, `check-workflows.py`), as did `fast / PII guard`, `fast / cargo fmt`, the Ubuntu MSRV build and zizmor; Measure's `plan`, shards, `same-project gates` and `compare` ran on the changed `measure.yml` and passed. 22 checks passed, none failed, 17 were skipped by the draft's fast set. The CI run of the current head is read by the main session. Not measured: the Windows and macOS legs on `windows-2025-vs2026` and `macos-26` (a draft does not run them; the full set will); the release workflows' new timeouts and labels (they run at a tag); every new timeout's headroom on a cold Rust cache (no run in the 96-run window rebuilt the dependencies from nothing); a cold clone of the family corpus under `test`'s 40 minutes (every run in the window restored it from the cache; on main's first run after #1092 moved its pin, run 40957121621, the fetch step took 2 s on Linux and 10 s on Windows, and the job's steps do not say whether that run restored or cloned); and Scorecard with a `timeout-minutes` on its job (the published restrictions on the job list env, defaults, containers, runners and approved steps, not a timeout, but the first Scorecard run after the merge should still say its results were published). ## Audit-honesty checklist - [x] README / docs reflect the current state after this PR (no user-visible capability changes) - [ ] A user-visible change has its entry as a fragment under `changelog.d/<section>/`. N/A: CI only, as agreed for #1457. - [ ] If a limitation was resolved, the "Known limitations" / "What works today" section is updated. N/A. - [x] If a new limitation was introduced, it is documented in the PR body (none). - [x] Commit messages describe WHAT changed and WHY - [x] No emojis in code, docs, or commit messages - [x] No private paths, personal email addresses, or internal jargon in committed files (the planted paths of the proof were on local scratch commits only) - [ ] Reverse-engineering finding. N/A. ## Legal and contribution hygiene - [x] I agree this work is licensable under Apache-2.0 - [x] This PR contains no Autodesk proprietary source, decompiled internals, or NDA'd SDK content - [x] Any new test fixtures use synthetic values ## Breaking changes None. The Windows, macOS and wheel job names carry the new labels (`build + real files / windows-2025-vs2026 / stable`, `Python wheel / macos-26`); the required check is `full / CI passed`, and nothing in the repository reads the old names. ## Screenshots or output samples See Testing. ## Related issues Refs #1457
18 tasks done
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.
Summary
publish.ymlgets apreflightjob that every other job needs: a bad tag now fails in seconds, before any wheel builds. A release that failed part way can be re-run. Release-binaries smokes the Intel macOS CLI and attestsSHA256SUMS. The release path's other verified problems from #1457 and the outside review are fixed in the same change (list below).Motivation
#1457 and an outside review of the release path found that a tag on a commit whose i686, IfcOpenShell or corpus job failed still shipped, that nothing checked where a tag pointed or that it was signed, that the version check ran after seven wheel builds and covered only two of the version files, and that a release failing after
rvtreached crates.io could not be re-run. Release 0.16.0 is coming, and a release cannot be rehearsed, so every check here is also run read-only against the real tags.Changes
tools/ci/release_preflight.py:check(tag name, annotated tag object verified by GitHub, tag object names this tag and the pushed commit, commit onorigin/mainororigin/hotfix/*viagit merge-base --is-ancestor, every version file from the tagged commit's tree) andcrate-state(is a version already on crates.io). The decisions are pure functions;tools/ci/test_release_preflight.pyhas 26 failure-first tests of them (folded down from 57 after the second read), run from the PII guard job beside the other two. Each asserts the exact problems, and builds each of the fourteen version sources stale on its own. The PII guard job also runscheckwithout a tag on the checked-out tree, so a half-finished bump fails the release pull request and the reader is exercised on the real files on every pull request..github/actions/wait-for-check(composite action,wait.sh): Deploy viewer's "Wait for CI on the commit" logic, with its retry and docs-only rule.docs-only-skips(defaulttrue, which Deploy viewer keeps) lets a commit CI's push filter skips pass without waiting; the preflight passes"false", under which such a commit fails at once with the reason, because a docs-only tag after a red commit would otherwise ship the red commit's tree. A docs-only commit that does carry the check (the last commit of a push that changed more) is waited for either way.deploy-viewer.ymlchanges only the one step.publish.yml: thepreflightjob (fetch-depth: 0,contents: readandchecks: read, 90-minute timeout, CI wait only on a tag push);needs: preflighton every job; the old "Verify tag matches Cargo.toml version" step is gone frompublish-crate; crates.io steps skip a version already there (a yanked one fails); PyPIskip-existingfrom the second attempt on; concurrency grouppublish-releasefor tag pushes, never cancelled, with the third-pending-run behaviour in the comment (dispatch runs have their own group so a dry run cannot displace a pending release);docs-rs-previewonnightly-2026-10-01with CI's banner check;--with-depsdropped; the matrix values moved toenv:; therelease-binariescomment fixed.release-binaries.yml:x86_64-apple-darwinis smoked witharch -x86_64on the arm64 runner (installs Rosetta if the image lacks it, in a step with a 10-minute timeout; checkslipo -archsandarch -x86_64 uname -msay x86_64);SHA256SUMSattested with the archives.RELEASE.md,docs/install.md,docs/maintaining.md, the workflow header and a changelog fragment say what is now enforced and what to do when the preflight refuses a tag or CI on the tagged commit is red. RELEASE.md also says: the tag goes on a commit CI ran on (hotfix step 5); a hotfix cut from v0.15.0 or older runs the workflow files of its tag and has no preflight unless it carriespublish.yml,release-binaries.yml,.github/actions/wait-for-checkandtools/ci/release_preflight.py(hotfix step 6); the landing queue stays disarmed between the squash and the tag (step 9).The wheels and the sdist stay on the release page, because
docs/install.mdpromises them and 0.15.0 shipped them, butSHA256SUMSand the attestations cover the CLI archives only;docs/install.mdand RELEASE.md now say so, and the PyPI copies of the wheels carry PEP 740 attestations from trusted publishing. Adding them to the checksums and the attestation is #1466, left alone for 0.16.0 because the checksum job is the hardest job of a release to test before a real tag. #1466 has no milestone: there is no milestone after 0.16.0 yet.queue: maxon the concurrency group (GitHub's option to keep up to 100 runs pending) is not used: actionlint 1.7.12 rejects the key, and the publish workflow is the last file to risk an unknown key in. Without it GitHub keeps one pending run, and the comment says so.Testing
Unit tests are banned in this repository: do not add them. Show the change working end to end on real files instead.
tools/check-local.shpasses (fmt, clippy, rustdoc, build, real-file / CLI / contract checks): N/A, no Rust, viewer or fixture change; no local build was run.release_preflight.py check --event push --ref-type tag --ref-name v0.15.0 --sha 0945d5a3...passes in 0.8 s, and so does v0.14.0. Refused, each with its reason named: a missing tag (v9.9.9, 0.5 s), the real signed v0.15.0 for v0.14.0's commit (wrong commit and 14 version files, 0.8 s), v0.15.0 for an unmerged branch commit (wrong commit and off branch, 0.8 s), a branch ref.crate-state:rvt 0.15.0andrvt-rs-mcp 0.15.0skip,rvt 99.0.0publishes. A lightweight tag is covered only by the pure tests (the repository has none).Cargo.tomlversion,rvt-py's andrvt-rs-mcp's own versions, thetools/stream_evidencepin,Cargo.lock'srvt-pyentry) and 23 other conditions of the module fails the tests every time (28 of 28 killed).wait.shon real commits (head 6bac791): withdocs-only-skips: "false", the docs-only commit40b86b80fails at once (0.8 s, "every file ... is one CI's push filter skips"), v0.15.0's commit0945d5a3passes,d5de57b2(CI passedfailed) is refused, and a docs-only head that carries the check (5f099500,full / CI passed) is waited for and passes; with the defaulttrue,40b86b80still skips, as Deploy viewer needs. A skipped conclusion is refused and a missing check times out (run at 0fbd4e3 and unchanged since).publish.ymldispatched on a scratch branch withviewer/package.jsonone patch ahead (run 42072957401, head 0fbd4e3, before the second read): preflight refused in 14 s end to end (job 9 s, the refusing step under 1 s), every other job skipped; the dispatch path and the$/.github/actions/wait-for-checkset-up resolved on a runner. Release binaries run 42072884597 (head 0fbd4e3, read by the main session): the Intel macOS leg ran its smoke under Rosetta ("Rosetta is already installed", x86_64, 20 binaries). The 40-job-minute graph dispatch was not repeated; the changes since do not touch the jobs it covers.uses: $/...form on these files (the newwait-for-checkuses join the existing ones); zizmor 1.32.0 offline reports no findings; shellcheck is clean onwait.sh. This PR's own CI on the new head: not yet read.What only a real tag will show
None of these has run on a hosted runner as the thing it is for; the first tag push, or the merge of this PR for the first, is their test:
$/.github/actions/wait-for-checkactually executing: the dispatch run only resolved it (the CI-wait step is skipped off a tag). Merging this PR runs Deploy viewer, which exercises the non-docs wait first (itsdeployjob calls the action with the defaultdocs-only-skips).fetch-depth: 0leavingorigin/mainandorigin/hotfix/*for the ancestry check) and CI checks, with the job'sGITHUB_TOKENandchecks: read. Read-only runs against real tags prove the logic, not the token's scope.crate-statecalling crates.io from a hosted runner.actions/attestwith the two-linesubject-path(dist/rvt-rs-*anddist/SHA256SUMS).softwareupdatebranch of the Rosetta step: the runner image already had Rosetta, so that branch has never run.github.run_attemptrendering as the PyPIskip-existingvalue on attempt 2.Audit-honesty checklist
changelog.d/<section>/SHA256SUMSand the attestations: documented indocs/install.mdand RELEASE.md, filed as Release page: add the wheels and the sdist to SHA256SUMS and the build-provenance attestation #1466Legal and contribution hygiene
Breaking changes
None to users. Maintainers: a release now needs the
CHANGELOG.md## [X.Y.Z]section and every version file in step before the tag (RELEASE.md already required both), a tag on a commit CI skipped is refused, and a hotfix branch must still exist while its release runs.Related issues
Refs #1457. Filed from this change: #1466.