Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .github/workflows/bug-fix.md
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -187,6 +188,11 @@ changed paths (e.g. `pytest <path>`, `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`,
Expand Down
16 changes: 16 additions & 0 deletions tests/test_bug_fix_workflow.py
Original file line number Diff line number Diff line change
@@ -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