Label Audit Commands as Bash - #848
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates the audit documentation to correctly label Bash-specific command blocks as bash, and adds a regression test to prevent reintroducing POSIX sh code fences in AUDIT.md.
Changes:
- Relabel selected
AUDIT.mdfenced command blocks fromshtobash. - Add a unit test that fails if
AUDIT.mdcontains a POSIXshfence label.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| AUDIT.md | Relabel audit command fences to bash for Bash-only syntax. |
| scripts/tests/test_release_guards.py | Add regression coverage preventing AUDIT.md from using ```sh fences. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
scripts/tests/test_release_guards.py:66
- The regression test will fail with an unhelpful message because it only reports the repeated string "
sh" and not where it occurs in AUDIT.md. Recording line numbers (and catching "sh" with trailing info) makes the failure actionable.
def test_audit_bash_blocks_are_not_labeled_as_posix_shell(self) -> None:
audit_lines = (REPO / "AUDIT.md").read_text(encoding="utf-8").splitlines()
mislabeled = [line for line in audit_lines if line.strip() == "```sh"]
self.assertEqual([], mislabeled)
|
Suppressed comments (1) scripts/tests/test_release_guards.py:66
Fixed in d31bd90. The regression test now reports each matching line number and text, and catches both an exact Review round: #848 (review) |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
Suppressed comments (1)
scripts/tests/test_release_guards.py:70
- The new regression test is both over-broad and under-specific: it forbids any
sh fence anywhere in AUDIT.md (which would block legitimate POSIX sh examples), and it still wouldn't catch a regression where a Bash-only block is mislabeled asshell. Consider asserting that any code fence containing Bash-only constructs (e.g., process substitution<(, here-strings<<<, ANSI-C quoting$'...') is labeled ```bash instead.
def test_audit_bash_blocks_are_not_labeled_as_posix_shell(self) -> None:
audit_lines = (REPO / "AUDIT.md").read_text(encoding="utf-8").splitlines()
mislabeled = [
(number, line)
for number, line in enumerate(audit_lines, start=1)
|
Suppressed comments (1) scripts/tests/test_release_guards.py:70
Fixed in 6f72b23da7daa0534196d721dc064e23e975d5a8. The test now parses fenced blocks, permits ordinary POSIX examples, and reports Review round: #848 (review) |
|
Correction: the fixing commit in the preceding response is 6f72b23. The abbreviated |
## Summary - Promote fail-closed release validation and audit path discovery. - Promote explicit Bash labels for executable audit commands. - Promote the canonical PyPI artifact-name regression guard. - Promote the executable Python entry point for the release-guard test. - Promote the internally consistent missing-job audit fixture. ## Source - #844 (`a08713a`) - #847 (`af2c8ff`) - #848 (`1cd5b84`) - #849 (`87c3960`) - #850 (`9b6c01f`) - #851 (`bb4d603`) ## Validation - 730 Python tests - audit self-tests and spec validation - ruff, mypy, and coverage - actionlint, markdownlint, EditorConfig, CSpell, ShellCheck, and PSScriptAnalyzer - Copilot full-diff review on each feature pull request Closes #842 Closes #843 Closes #845
Summary
bash.shlabel on these blocks.Root Cause
The audit commands use process substitution, here-strings, and ANSI-C quoting, but their fence labels implied generic POSIX shell compatibility.
Validation
Follow-up to the suppressed Copilot finding on #846.