diff --git a/.github/workflows/bug-fix.md b/.github/workflows/bug-fix.md index 01eb6af5bf..d73be52724 100644 --- a/.github/workflows/bug-fix.md +++ b/.github/workflows/bug-fix.md @@ -1,6 +1,7 @@ --- description: "Apply the remediation from a prior bug assessment to a bug-fix-labeled issue and open a draft PR for human review" emoji: "🛠️" +max-ai-credits: 2000 on: issues: @@ -10,7 +11,7 @@ on: tools: edit: - bash: ["echo", "cat", "head", "tail", "grep", "wc", "sort", "uniq", "python3", "jq", "date", "ls", "find", "pytest", "npm", "go", "cargo", "dotnet"] + bash: ["echo", "cat", "head", "tail", "grep", "wc", "sort", "uniq", "python", "python3", "jq", "date", "ls", "find", "pytest", "npm", "go", "cargo", "dotnet"] github: toolsets: [issues, repos] min-integrity: none @@ -187,6 +188,11 @@ changed paths (e.g. `pytest `, `npm test`, `go test ./...` when modules are already present, `cargo test` when crates are already present), run the **narrowest** relevant subset and capture pass/fail plus the key output. +- Prefer `python3 -m pytest` or `pytest` from PATH. Do not invoke + `.venv/bin/python`, `venv/bin/python`, or any project-local interpreter: + the harness cannot grant execute permission on those binaries and fails + with "Permission denied". `python` is allowed when that is what PATH + provides. - Run only the project's **own** test/lint commands. Never run destructive, network-dependent, or repo-wide expensive suites. Do not fetch or install dependencies (for example `go mod download`, `go get`, `cargo fetch`, diff --git a/tests/test_bug_fix_workflow.py b/tests/test_bug_fix_workflow.py new file mode 100644 index 0000000000..33d3441468 --- /dev/null +++ b/tests/test_bug_fix_workflow.py @@ -0,0 +1,16 @@ +"""Pin bug-fix workflow credits and pytest PATH rules (#4472).""" + +from pathlib import Path + +BUG_FIX = Path(__file__).parent.parent / ".github" / "workflows" / "bug-fix.md" + + +def test_bug_fix_workflow_has_credit_headroom_and_pytest_path() -> None: + text = BUG_FIX.read_text(encoding="utf-8") + assert "max-ai-credits: 2000" in text + assert '"python"' in text or "python3" in text + # Allowlist must include both python and python3 (harness argv[0] matching). + assert "python3" in text + assert '"python"' in text or ", \"python\"" in text or '["python"' in text or '"python",' in text + assert ".venv/bin/python" in text + assert "Permission denied" in text