docs: expand AGENTS.md with test marker guidance and CI audit notes#7963
docs: expand AGENTS.md with test marker guidance and CI audit notes#7963JamesClarke7283 wants to merge 2 commits into
Conversation
Document the four-way test marker decision (expectedFailure / expectedFailureIf vs skip / skipIf, with skip reserved for tests that crash the interpreter), add guidance on avoiding zizmor's impostor-commit audit when pinning third-party actions, link the wiki guide for syncing tests from upstream CPython, and note the grep recipe for finding WIP TODO: RUSTPYTHON entries. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
📝 WalkthroughWalkthroughThis PR updates AGENTS.md with three contributor-facing additions: a CRITICAL pre-commit and test-running checklist, a “Choosing the right marker” subsection for RustPython test failures, and a “CI Workflows” note plus a documentation link for syncing Lib/ tests from CPython. ChangesContributor and CI Documentation
🎯 1 (Trivial) | ⏱️ ~3 minutes
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@AGENTS.md`:
- Around line 102-106: Update the “only acceptable modifications” section
(currently restricting changes to adding only expectedFailure) to match the new
“When to use which” guidance: allow contributors to also add skip/skipIf when a
test would crash/hang or otherwise make the test process unusable (segfaults,
Rust panics, aborts, or hangs), and keep expectedFailure/expectedFailureIf as
the default for non-crashing regressions; adjust the text so both sections
consistently state that expectedFailure is preferred but skip/skipIf is
permitted for crash/hang scenarios.
- Line 292: Replace the incorrect capitalization of "Github" with the proper
"GitHub" in the contributor docs; specifically update the occurrences in the
sentences that reference PR CI runs (the line containing "PR CI runs [zizmor] to
audit `.github/workflows/*.yaml`") and the line discussing the `impostor-commit`
audit so both use "GitHub" (and scan the surrounding paragraphs for any other
"Github" instances to ensure consistent capitalization).
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
Add a "CRITICAL: Pre-commit Checks" subsection requiring prek and the full test suite to pass before any commit. Shrink the CI Workflows section to a single sentence per @ShaharNaveh's review feedback: contributors only need to know that workflow changes must pass a zizmor scan in CI, not the full impostor-commit explainer. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
There was a problem hiding this comment.
♻️ Duplicate comments (1)
AGENTS.md (1)
108-111:⚠️ Potential issue | 🟠 Major | ⚡ Quick winResolve policy conflict with the "only acceptable modifications" section
This guidance correctly allows
skip/skipIffor crash/hang cases, but it conflicts with lines 281-283, which currently state "The only acceptable modifications to test files are: [...] Adding@unittest.expectedFailuredecorators when tests cannot be fixed." Please update that section to also allow addingskip/skipIfwhen a test would crash the interpreter or hang the test process, so contributors have a single consistent rule set.📝 Suggested fix for lines 281-283
- The only acceptable modifications to test files are: 1. Removing `@unittest.expectedFailure` decorators and the upper TODO comments when tests actually pass - 2. Adding `@unittest.expectedFailure` decorators when tests cannot be fixed + 2. Adding `@unittest.expectedFailure` decorators when tests cannot be fixed (prefer this by default) + 3. Adding `@unittest.skip` or `@unittest.skipIf` decorators when running the test would crash the interpreter or hang the test process (segfault, Rust panic, abort, or hang)🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@AGENTS.md` around lines 108 - 111, Update the "The only acceptable modifications to test files are:" guidance to resolve the conflict by explicitly allowing adding skip/skipIf in addition to `@unittest.expectedFailure` when a test would crash or hang the test process; locate the section that currently references "Adding `@unittest.expectedFailure` decorators when tests cannot be fixed" and expand that clause to permit adding skip/skipIf (with the same restriction that these are only for tests that would segfault, panic, abort, or hang the test process), and ensure you reference both decorators by name (`@unittest.expectedFailure`, skip, skipIf) so the policy is unambiguous.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Duplicate comments:
In `@AGENTS.md`:
- Around line 108-111: Update the "The only acceptable modifications to test
files are:" guidance to resolve the conflict by explicitly allowing adding
skip/skipIf in addition to `@unittest.expectedFailure` when a test would crash or
hang the test process; locate the section that currently references "Adding
`@unittest.expectedFailure` decorators when tests cannot be fixed" and expand that
clause to permit adding skip/skipIf (with the same restriction that these are
only for tests that would segfault, panic, abort, or hang the test process), and
ensure you reference both decorators by name (`@unittest.expectedFailure`, skip,
skipIf) so the policy is unambiguous.
Summary
Four additive updates to
AGENTS.mdto capture guidance that contributors keep asking about. No existing wording was changed — everything is appended in place.@unittest.expectedFailure/expectedFailureIf/skip/skipIf) with theTODO: RUSTPYTHON; <reason>format, and explains when to use which: preferexpectedFailureso a future fix surfaces an unexpected pass; reach forskiponly when running the test would take down the test process (segfault, Rust panic, abort, hang).impostor-commitaudit. Explains why hash-pinneduses:lines can still be rejected when the SHA only exists on a fork, the canonical-repo verification recipe (gh api repos/<owner>/<repo>/commits/<sha>), and the repo's existing convention of pinning to a full 40-char SHA with a trailing# vX.Y.Zcomment.grep -d recurse 'TODO: RUSTPYTHON' Lib/test/.Test plan
AGENTS.mdreads cleanly (headings, code fences, link targets)🤖 Generated with Claude Code
Summary by CodeRabbit