test(guardrails): 4 block-root-delete-target allowed-roots assertions fail on Windows Git Bash
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 57/100
Research direction
Start with section 2d of plugins/guardrails/hooks/block-root-delete-target.test.sh and compare its allowed-roots fixtures with the Windows Git Bash path behavior described in the issue. Check how the test derives relative paths and handles / under MSYS; the issue also points to hook behavior as an open question. Done when the four assertions behave appropriately on Windows without breaking the existing Linux suite.
Written by the indexing model from the issue text.
Description
Problem
On Windows Git Bash, four assertions in plugins/guardrails/hooks/block-root-delete-target.test.sh (section 2d, allowed roots) fail. They fail the same way on origin/main (a1a836827) as on the #6542 branch, so the suite cannot go fully green locally on Windows. CI is Linux, and the Windows lane does not run this suite.
Failing assertions and output
FAIL: allowed roots: a relative root grants nothing (direct): expected exit 2, got 0
FAIL: allowed roots: a relative root grants nothing (dispatched): expected exit 2, got 0
FAIL: allowed roots: the root '/' does not allow a top-level path (direct): expected exit 2, got 0
FAIL: allowed roots: the root '/' does not allow a top-level path (dispatched): expected exit 2, got 0
Root-cause hypotheses (test fixtures, not the hook)
a relative root grants nothingpasses"${RDT_AR#/}"as a "relative" entry. On Windows,RDT_TOPcomes fromgit rev-parse --show-toplevel, which returns the drive form (D:/worktrees/...).#/therefore strips nothing, and the entry is a valid absolute root that correctly allows$RDT_AR/child. The test does not build a relative entry on this host. Evidence:git rev-parse --show-toplevelprintedD:/worktrees/melodic-software-claude-code-plugins-fix-6542-allowed-roots-prefix.the root '/' does not allow a top-level pathlists/and expectsrm -rf /opt/rdt-allowed-x/yto stay refused. Under MSYS,/is the Git install directory (cygpath -m /printsC:/Program Files/Git/). That is not a filesystem root, sordt_root_likedoes not drop the entry, and/opt/...lies strictly under it, so the delete is allowed.
Suggested fix
- Build the relative entry from a path that is certainly relative on every host, e.g. strip the drive or leading slash with a host-aware helper.
- Skip or re-target the
/case on MSYS, where/is not the volume root. - Decide whether the hook should also refuse an entry spelled
/on Windows. It names the Git install directory, which is probably never what a user means.
Related: #6020. Found while working #6542 (PR #6624).
- Dominant language
- Shell
- Stars
- 22
- Forks
- 2
- Avg merge
- 5h 15m
- Merged PRs (30d)
- 833
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from melodic-software/claude-code-plugins
-
good first issue needs-triage priority: medium
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
melodic-software/claude-code-plugins#6631 · 1 comment ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
melodic-software/claude-code-plugins#6547 ·
Maintainers usually reply within 1 day
-
needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
melodic-software/claude-code-plugins#6535 ·
Maintainers usually reply within 1 day
-
test_comment_census.py: SccArgv flag-shaped-filename test errors on Windows (#!/bin/sh scc shim)Opengood first issue needs-triage priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
melodic-software/claude-code-plugins#6532 · 1 comment ·
Maintainers usually reply within 1 day
-
good first issue needs-triage priority: low
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
melodic-software/claude-code-plugins#6390 · 1 comment ·
Maintainers usually reply within 1 day
All issues in melodic-software/claude-code-plugins
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
aws-samples/appmod-blueprints#972 ·
Maintainers usually reply within 1 day
-
[Bug]: remote-ls --updates reports up-to-date OCI refs because it ignores deployed Alt-idPossibly taken @Joao-kouznetz claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
status:needs-triage
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 3 days