test(guardrails): 4 block-root-delete-target allowed-roots assertions fail on Windows Git Bash
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 57/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- Shell
- Stelle
- 22
- Fork
- 2
- Merge medio
- 7h 57m
- PR unite (30g)
- 938
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di melodic-software/claude-code-plugins
-
priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
melodic-software/claude-code-plugins#8831 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
priority: medium status: confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
melodic-software/claude-code-plugins#8801 ·
I maintainer di solito rispondono entro 1 giorno
-
priority: low status: confirmed
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
melodic-software/claude-code-plugins#8799 ·
I maintainer di solito rispondono entro 1 giorno
-
fix(links): make the online link check green (23 errors since 2026-10-11)Forse già presa Una pull request collegata a questa issue è aperta o già unita. Apertapriority: medium
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
melodic-software/claude-code-plugins#8730 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
melodic-software/claude-code-plugins#8709 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di melodic-software/claude-code-plugins
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 74/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
-
Negative subscript on a sparse array counts from the number of elements, not from the highest indexApertaarea: compat bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
reubeno/brush#1570 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
platform-mesh/helm-charts#2569 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
kunchenguid/firstmate#7604 ·
I maintainer di solito rispondono entro 1 giorno