Repository navigation
Conversation
amandeavor
left a comment
There was a problem hiding this comment.
Reviewed the path classifier, embedded-file guard, CI dependency graph, prerelease range selection, and stable-release asset verification. The classifier passes all 40 self-test cases, the PR checks pass across Linux, Windows, and macOS, and the gate consistently fails open when it cannot prove a change is inert. I also checked the release demotion and downstream notification/Homebrew dependencies. I did not find a correctness blocker.
|
Solid PR overall — the design write-up and the One correctness bug worth fixing before merge, on the notify-discord:
needs: [verify-assets]
if: ${{ !inputs.prerelease }}
So as written, both jobs run as soon as Fix: if: ${{ !inputs.prerelease && needs.verify-assets.result == 'success' }}on both (Rest of the review — duplicated merge-ref guard, hardcoded asset list in |
c26851c to
ecada25
Compare
|
Thanks — two of the cleanup notes turned out to be worth more than the blocker, and both are now fixed in the PR. On the blocker itself I think the rule is the other way round, and I'd rather not add the condition. The implicit
|
e31dba6 to
51ad5d4
Compare
51ad5d4 to
46fcbd2
Compare
46fcbd2 to
76a574b
Compare
14fa302 to
9fb9f6a
Compare
9fb9f6a to
394691f
Compare
There was no path filtering anywhere in .github/. Every push to develop ran
pre-release plus the whole release build and published a dev-*-rc.N prerelease,
and every PR ran the whole CI matrix. Replaying the last 100 merges into
develop, 8 were pure markdown and paid for all of it.
.github/inert-paths.conf holds git pathspecs for the paths that cannot change
the binary or CI. changed-scope.sh subtracts them from a diff range and answers
through its exit status. Git does the matching, so there is no glob engine of
ours to get wrong.
No failure direction ships a stale artifact:
- The list is inverted, so an unrecognised path builds.
- The skip verdict is status 3, not 1, because bash hands out the low statuses
itself -- 1 for a set -u violation or a failed command, 2 for a syntax error,
127 for a missing one. An accident cannot be mistaken for a skip.
- Gated jobs skip only on an explicit build=false. A failed gate leaves that
unset and ends the run red, with clippy and everything below it skipped, so it
cannot wave a PR through green.
- --no-renames throughout: rename detection reports only a rename's
destination, so moving an embedded file into docs/ would otherwise look inert
on a commit that no longer compiles.
hooks/** is deliberately not excluded: src/hooks/init/ include_str!s files out
of hooks/, .md ones included. A bare :(exclude)*.md would swallow them,
because without `,glob` a pathspec `*` also matches `/`. check-embed-scope.sh
fails the build if that ever happens, and runs ungated so it still fires on the
docs-only PRs that skip everything else.
docs/ is listed piecemeal for the same reason: engine/tests/guide_examples.rs
and tests/agent_coverage_doc_test.rs embed the pages under
docs/guide/{pipelines,proxy,resources}/ to check their examples, so those
directories build and the rest of docs/ stays inert.
.claude/hooks/ stays a build input: tests/hook_decision_protocol_test.rs runs
.claude/hooks/rtk-rewrite.sh. The security job's pattern scan was Rust-only, so
it gains a shell scan.
check-embed-scope.sh splits each macro onto its own line before matching.
grep -o does not match overlapping windows, so the 80 characters trailing a
literal embed swallowed whichever embed followed it, and that one was dropped
as literal and never reported -- the exact concat!(env!(..)) form the guard
exists to catch was invisible whenever a plain include_str! preceded it.
include_str!(concat!(env!("CARGO_MANIFEST_DIR"), "/x")), which engine/ uses for
its fixtures, is resolved against the nearest Cargo.toml and checked like a
literal; every other non-literal form is still reported.
It runs against fixtures through --self-test as well as against the tree.
pr-target-check.yml stops flagging release-please. Its only exemption was the
develop->master promotion, so release-please's own version-bump PR was labelled
wrong-base and told to target develop on every release since 0.37.1. Both
maintainer routes are now keyed by branch, because the account behind them is
not stable: the promotion has been opened by a human and by two different apps.
Replayed over the last 100 PRs into master, that flips 17 verdicts, all of them
release-please's, and exempts nothing else. Both exemptions are conditioned on
the branch living in this repo, because a fork's head branch name is the
contributor's to choose; every exempt route already satisfies that, so the
clause changes no verdict.
pr-target-check.yml also gains the matching base-branch filter. Its job only acts
on a PR into master, so every PR into develop was starting a run that skipped;
the last 20 runs did nothing. It also holds a pull-requests:write app token on
pull_request_target, so a run it cannot act on is exposure with no upside.
That job's three existing scans diffed origin/master...HEAD, which on a PR into
develop spans every merge since the last release rather than the PR. They now
diff HEAD^1 HEAD like the new shell scan, so they report the PR's own changes
instead of naming files the author never touched. Each scan also separates its
git call from the grep that needs `|| true` for a no-match, so a git failure
fails the step rather than passing as a clean verdict.
A manual dispatch of cd.yml always builds. Otherwise it diffs from the last RC
rather than from github.event.before: develop
runs are cancel-in-progress, and a docs push landing on a cancelled source
build would otherwise skip and strand that source change with no RC.
release.yml therefore uploads an RC as a draft and publishes it last, so the
tag only exists once every asset does.
The master path moves to its own workflow, stable-release.yml, and is not
gated. install.sh follows the redirect on /releases/latest and downloads that
tag's tarballs, so a stable release without assets breaks every fresh install;
a bug in the develop gate must not be able to cause that. release.yml gains a
verify-assets job that asserts all 27 assets uploaded non-empty and that
checksums.txt names nothing that failed to upload, demoting the release out of
/releases/latest if not, with Discord, the Homebrew tap and the winget manifest
waiting on it.
Fixes rtk-ai#189
Co-Authored-By: Claude Opus 5.5 <[email protected]>
394691f to
49e60cd
Compare
Fixes #189, deliberately not the way it proposed (see below).
What
.github/has no path filtering: every push todevelopruns the whole release build and publishes adev-*-rc.Nprerelease, and every PR runs the whole CI matrix, whatever changed. This adds a gate that skips both when a change touches nothing that can affect the build..github/inert-paths.confholds git pathspecs for those paths.changed-scope.shsubtracts them from a diff range and answers through its exit status, so git does the matching.The saving depends on how many changes are docs-only. Over the last 100 merges into
develop, 3 would have skipped and 97 would have built; every file in the 3 is markdown.About #189
The issue asked to gate the binary build on the release path. Two problems, both verified:
'*.rs' 'Cargo.toml' 'Cargo.lock' 'build.rs'since the previous tag, and release-please's own commit always bumpsCargo.tomlandCargo.lock.masterbreaks installs.install.shfollows the redirect on/releases/latestand downloads that tag's tarballs, so a stable release without assets fails every freshcurl | sh.So the gate covers
developand PRs, and the master path moves to its own ungated workflow. If you would rather keep #189 open for the release-path idea, drop theFixeslines before merging.How a failure behaves
No failure direction ships a stale artifact:
build=false. A failed gate leaves that unset and ends the run red, withfmtandtest presencerun andclippyand everything below it skipped, so it cannot wave a PR through green.--no-renamesthroughout: rename detection reports only the destination, so moving an embedded file intodocs/would otherwise look inert on a commit that no longer compiles.What stays a build input
Some paths look like docs or tooling but are not:
hooks/**:src/hooks/init/embeds files from it,.mdones included. A bare:(exclude)*.mdwould swallow them, because without,globa pathspec*also matches/.docs/guide/pipelines/,docs/guide/proxy/,docs/guide/resources/: tests embed these pages and check them. The rest ofdocs/is inert..claude/hooks/:tests/hook_decision_protocol_test.rsruns.claude/hooks/rtk-rewrite.sh.check-embed-scope.shenforces the embedded cases. It resolves everyinclude_str!andinclude_bytes!target in tracked.rsfiles, literal orconcat!(env!("CARGO_MANIFEST_DIR"), "/…"), and fails if one is excluded, missing, or in a form it cannot resolve. It runs ungated, so it still fires on the PRs that skip everything else. It cannot see a file a test reads at runtime, like the hook above, so those are kept off the list by hand.Other changes
stable-release.yml: the master path moves out ofcd.yml, so a bug in the develop gate cannot reach a release.verify-assetsinrelease.yml: asserts all 27 stable-named assets uploaded non-empty and thatchecksums.txtnames nothing that failed to upload. On failure it demotes the release out of/releases/latest, so installs fall back to the last good tag. Discord, the Homebrew tap and the winget manifest wait on it. It detects and demotes but cannot prevent, see Stable releases are 'Latest' for ~6-7 minutes before their assets exist, breaking install.sh #3759.cd.ymldiffs from the last RC rather thangithub.event.before: develop runs arecancel-in-progress, and a docs push landing on a cancelled source build would otherwise skip and strand that source change. A manual dispatch always builds.origin/master...HEAD, which on a PR intodevelopspans every merge since the last release, and reported files the PR never touched as critical. All scans now diffHEAD^1 HEAD, a failinggitfails the step instead of passing as clean, and a new step scans changed shell scripts.pr-target-check.ymlgainsbranches: [master], since every PR intodevelopstarted a run that only skipped while holding apull-requests:writetoken. It also stops flagging release-please's version-bump PR aswrong-base. Both exemptions are keyed by branch and require the branch to live in this repo, since a fork's head branch name is the contributor's to choose.Test plan
changed-scope.sh --self-test, 41 cases, run in CI.check-embed-scope.sh --self-test, 17 fixture cases, run in CI. Breaking the script 14 different ways fails it each time.cargo test --all(5508 passed),cargo test --no-default-featuresandcargo docresults unchanged. Not run for theproxy/tests, semgrep orbenchmark.sh, where a search finds no reference to those paths..claude/hooks/rtk-rewrite.sh:affirmative_allow_hooks_ignore_an_inherited_hostfails. A broken page underdocs/guide/fails the tests that embed it.develop: 97 build, 3 skip, all markdown.verify-assetscomparison replayed against the realdev-1.2.0-rc.619: nothing missing, nothing dropped.GIT_DIRaimed at it.develop:build=false:fmtand everything below it skip,doc reviewruns, and the run is green.softprops/action-gh-releasewithdraft: true, thengh release edit --draft=false: no tag through two uploads, the second upload reuses the draft, publishing creates the tag on the branch tip, and it stays one prerelease with both assets.GITHUB_TOKEN, not this repo's App token. The first push todevelopafter merging covers it: a failure shows as a red run with a draft and no tag, and stable releases are not affected.Known limitations
test (${{ matrix.os }}…), seen on the fork. No required checks are configured today, but a requiredtest (ubuntu-latest)would wait forever on a docs-only PR.rtk-rewrite.shhooks claiming the same version) was opened while working on this and is not addressed here.🤖 Generated with Claude Code