Skip to content

Commit 36a4745

Browse files
Yash-Chindamclaude
andcommitted
fix(github): repair the json_escape test harness and re-sync with core
Two CI failures, both mine. The json_escape parity tests wrote their payload into a per-script subdirectory of tmp_path that nothing created, so every parametrised case died with FileNotFoundError before reaching an assertion. They had never run: bare `bash` resolves to the WSL launcher on my machine, so `requires_bash` skipped them locally and CI was their first execution. The helper now creates the directory. The command-parity test then caught a real drift, which is what it is for. Upstream #4456 changed core's taskstoissues to report an unreadable extensions.yml instead of skipping hooks silently, in both the before and after hook blocks. The extension copy still carried the old wording, so the diff against core grew from 10 lines to 14. Ported both lines rather than relaxing the assertion; the diff is back to the three script paths plus the two that read the new TASKS value. Rebased onto main to pick up that change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent eb9916f commit 36a4745

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

‎extensions/github/commands/speckit.github.taskstoissues.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ You **MUST** consider the user input before proceeding (if not empty).
2020
**Check for extension hooks (before tasks-to-issues conversion)**:
2121
- Check if `.specify/extensions.yml` exists in the project root.
2222
- If it exists, read it and look for entries under the `hooks.before_taskstoissues` key
23-
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
23+
- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that `.specify/extensions.yml` could not be read (include the parser error) and that no hooks were checked, including any mandatory (`optional: false`) hooks registered there, then continue normally
2424
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
2525
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
2626
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable
@@ -77,7 +77,7 @@ git config --get remote.origin.url
7777
**Check for extension hooks (after tasks-to-issues conversion)**:
7878
Check if `.specify/extensions.yml` exists in the project root.
7979
- If it exists, read it and look for entries under the `hooks.after_taskstoissues` key
80-
- If the YAML cannot be parsed or is invalid, skip hook checking silently and continue normally
80+
- If the YAML cannot be parsed or is invalid, do not skip silently: tell the user that `.specify/extensions.yml` could not be read (include the parser error) and that no hooks were checked, including any mandatory (`optional: false`) hooks registered there, then continue normally
8181
- Filter out hooks where `enabled` is explicitly `false`. Treat hooks without an `enabled` field as enabled by default.
8282
- For each remaining hook, do **not** attempt to interpret or evaluate hook `condition` expressions:
8383
- If the hook has no `condition` field, or it is null/empty, treat the hook as executable

‎tests/extensions/github/test_github_extension.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -602,6 +602,9 @@ def _escape(script: Path, tmp_path: Path, value: str) -> str:
602602
)
603603
assert body, f"no json_escape found in {script}"
604604

605+
# Callers pass a per-script subdirectory so the two harnesses do not
606+
# collide; pytest only creates tmp_path itself.
607+
tmp_path.mkdir(parents=True, exist_ok=True)
605608
payload = tmp_path / "value.txt"
606609
payload.write_text(value, encoding="utf-8", newline="")
607610
harness = tmp_path / "harness.sh"

0 commit comments

Comments
 (0)