Repository navigation
Name the Hub From Its Constant Everywhere, and Say Which Checkout the Menu Filters For - #1427
Conversation
… Menu Filters For Two findings from the promotion pull request's review, and the class behind them. The tree-carry guard tested `name == HUB_NAME` and then named the hub as a literal in the message it raised. Fixing only that line would have left the worse instance standing: `verify_hub` resolved the registry entry by literal too, so a rename would have died there, in every mode, before reaching the guard the finding was about. Both now read the constant, as does the origin-mismatch message beside them. Both menus hard-coded the slug in a section header while holding it in `HUB_REPO` two lines above, which rendered two different hub names on one screen for any fork. They read the variable now, verified by rendering the menu. The guard itself had no test, since it sits behind `verify_hub` and a unit test would have needed a hub checkout to reach it. It is now `refuse_hub_tree_target`, exercised directly, and the test fails when the guard is removed. Both menus close their usage text on a sentence whose subject a reader cannot resolve. "Each is shown the tasks that apply to it" leaves "each" pointing at nothing the preceding sentence named, which is what the reviewer read as a missing subject. It now says which checkout is meant. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
|
ⓘ Qodo reviews are paused because your trial has ended. Ask your workspace admin to add credits to resume reviews. Manage billing |
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Team Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🟢 Approval recommended
The changes are small, well-scoped, and add test coverage for the newly extracted guard without introducing risky behavior.
Pull request overview
This PR removes hard-coded references to the hub name by routing lookups and user-facing messages through shared constants, adds a direct unit test for the hub-tree target refusal guard, and updates the host-setup menus to show which tasks apply to the current checkout.
Changes:
- Use
HUB_NAMEconsistently for hub registry resolution and related error messages inscripts/carry.py. - Factor the hub tree-target refusal into
refuse_hub_tree_target()and add a unit test covering the opt-in behavior. - Update the Bash and PowerShell menus to use the hub repo variable in the “Hub, …” section header and clarify the usage sentence.
File summaries
| File | Description |
|---|---|
| scripts/tests/test_carry.py | Adds a focused unit test for the hub-as-tree-target refusal logic. |
| scripts/carry.py | Replaces hub-name literals with HUB_NAME and extracts the hub tree-target guard into a testable helper. |
| host-setup/menu.sh | Clarifies usage text and uses $HUB_REPO in the hub menu header. |
| host-setup/menu.ps1 | Clarifies usage text and uses the hub repo variable in the hub menu header. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
`menu.ps1` runs under `Set-StrictMode -Version Latest` and every other reference
to this variable inside a function qualifies it, including the header line
twenty-five lines above this one. The unqualified form resolves the same today
and stops resolving the moment any local of that name is introduced.
Demonstrated rather than assumed, since the menu itself does not start on this
host:
unqualified -> Hub, local-shadow/wrong:
script-scoped -> Hub, ptr727/ProjectTemplate:
Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The newly added unit test reintroduces a hard-coded hub name string instead of deriving it from carry.HUB_NAME, which makes the test fragile to the renaming this PR is standardizing.
Once you've addressed the issues Copilot identified, you can request another Copilot review.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 1
- Review effort level: Lite
The test added for `refuse_hub_tree_target` pinned the hub's name as a literal in the message it expects, which is the hard-coded name the guard's own message was changed to stop carrying. It reads the constant now, escaped, since the expectation is a regular expression rather than a plain string. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
There was a problem hiding this comment.
🟢 Approval recommended
The changes consistently remove hard-coded hub naming, add direct regression coverage for the extracted guard, and keep behavior changes narrowly scoped to messaging and menu rendering.
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0 new
- Review effort level: Lite
Answers three findings raised on promotion PR #1426, whose head is
develop, so they land herefirst.
The hub's name, in five places rather than one
The finding was that
carry.py's tree-carry guard testsname == HUB_NAMEand then names the hubas a literal in the message it raises. Fixing that line alone would have left the worse instance
standing:
verify_hubresolved the registry entry by literal too, so renaming the hub would havefailed there, in every mode, before ever reaching the guard the finding was about. The
origin-mismatch message beside it had the same shape.
Both menus hard-coded the slug in a section header while holding it in
HUB_REPOtwo lines above,so any fork would render two different hub names on one screen. Verified by rendering the menu
rather than by reading it:
A guard with no test
The guard whose message this change edits had none, because it sits behind
verify_huband a unittest would have needed a real hub checkout to reach it. It is now
refuse_hub_tree_target,exercised directly, and the test fails when the guard is removed. Its sibling in
run_sectionsalready had one, so this was the untested half of a matched pair.
The usage sentence, rewritten once more
"Each is shown the tasks that apply to it" leaves "each" pointing at nothing the preceding sentence
named, which is what the reviewer read as a missing subject. It now names the referent: "Only the
tasks that apply to that checkout are shown." The local review pass was asked specifically whether
this wording is correct and unambiguous rather than for another variant, since the sentence has now
been rewritten twice, and it confirmed the referent binds and that the claim matches what the
menus actually do.
🤖 Generated with Claude Code