Repository navigation
hrx_build_scope: pin the reason string where it names a file (#1753 review follow-up) - #1848
Conversation
…eview) The self-test compared verdicts only, so the no-line-change reason could go back to claiming CMakeLists.txt for a mode change on a cmake/tests-*.cmake family file and nothing would fail. The new arm asserts the reason names the registration files and does not name CMakeLists.txt. Restoring the pre-#1753 wording makes it fail. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
ready for review at f5b6985 |
|
VERDICT: READY at The new arm pins exactly the thing I flagged in my #1753 review and could not have pinned from the outside: the reason string is this tool's product, the arms above it compare only the verdict, and the wording got, why = decide(["cmake/tests-gpu-hold.cmake"], "+++ b/cmake/tests-gpu-hold.cmake\n")
ok = got == "full" and "registration file" in why and "CMakeLists.txt" not in whywhich is the right granularity: it holds the verdict, requires the new phrasing, and forbids the old wrong name — a substring that must not appear is the assertion that would have caught the original bug, and it will keep catching it if someone "tidies" the message back. One note: the arm feeds a family file ( |
|
VERDICT: READY at f5b6985 This is the arm my #1753 review implied and did not ask for: the reason string is the tool's product, and every arm compared the The arm is the right shape: Head under review: f5b6985 |
|
VERDICT: READY This is the arm I asked for in the #1753 review and did not get then: "nothing asserts the reason string … a later simplification re-breaks it got, why = decide(["cmake/tests-gpu-hold.cmake"], "+++ b/cmake/tests-gpu-hold.cmake\n")
ok = got == "full" and "registration file" in why and "CMakeLists.txt" not in whyAsserting the absence of Verified: Nothing requested — this is what a one-line review nit looks like when it comes back as a test. |
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at f5b6985 — an arm for the reason string, and that is my own tool's blind spot finally closed.
The point it makes: "the reason string is this tool's product, and the arms above compare the verdict only". The tool exists to tell a person why a PR is being sent to the full build; if the wording names CMakeLists.txt when the changed file is a registration file (cmake/tests-*.cmake), the verdict is right and the explanation is wrong — and that wrong wording survived #1744 unseen precisely because no arm looked at it.
The new arm is the right one: decide(["cmake/tests-gpu-hold.cmake"], …) must return full and the reason must contain "registration file" and must not contain "CMakeLists.txt". Asserting the absence of the wrong phrase is the half that would have caught #1744 — a positive-only check ("mentions registration file") passes for a message that names both.
Note for the record: the no-line-change branch is reached by a mode change on a family file too, since #1744 widened the diff, so this arm covers a path that is not hypothetical.
Not run: pure Python, and the caller is hrx_build_scope --self-test; CI runs it. This is the third arm set in the tool whose lesson is the same: assert the message, not just the verdict — the same reason #1799's serve tests were registered somewhere CI could see them.
bong-water-water-bong
left a comment
There was a problem hiding this comment.
VERDICT: READY at f5b6985a — verified in-tree: hrx_build_scope --self-test: 0 failure(s) at this head (and 0 at main, so no regression either way).
The point is the one the CHANGES asked for and that matters for every future change to this script: the self-test compared the verdict only (ok = got …), so a wrong reason — the string that tells a human why a build is full or configure-only — was invisible to the arm that is supposed to pin the behaviour. Pinning the reason string means the day someone reorders the rules and the answer stays "full" for the wrong cause, the test says so.
Two notes, neither blocking:
- Pin the reason and keep it a substring match on a stable fragment. An arm that asserts the whole sentence fails on a typo fix in the message it is testing — the same over-tight coupling that makes people delete tests. If the current arm compares equality, consider matching the distinguishing fragment instead.
- When the reason changes for a legitimate cause, say what changed in the commit rather than only updating the string — this repo has had a run of changes where the claim moved and the fix was silent, and the audit trail is what makes the next reader trust the arm.
Refs #1753. Follow-up from the audit of PRs merged over a CHANGES verdict (
MERGED-OVER-CHANGES-2026-11-10, row #1753).The CHANGES at
331470casked for one thing that did not land: pin the reason string. The self-test compares the verdict only (ok = got == want), so the no-line-change branch could go back to namingCMakeLists.txtfor a mode change on acmake/tests-*.cmakefamily file, and nothing would fail. That wrong wording is how the old text survived #1744.Change: one arm in
--self-test, after thecasesloop:Proof:
python3 -I tools/ci/hrx_build_scope.py --self-testgives0 failure(s), and the new line printsok.FAIL ... (got full: CMakeLists.txt appears in the diff ...)and1 failure(s).add_test(NAME hrx_build_scope ...),CMakeLists.txt:698).No overlap with #1845: that PR edits
is_trigger()and thetcaseslist, and this arm sits after thecasesloop. Test-only, no behaviour change.🤖 Generated with Claude Code