docs: expand AGENTS.md with test marker guidance and CI audit notes - #7963
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>
|
No actionable comments were generated in the recent review. π βΉοΈ Recent review infoβοΈ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: π Files selected for processing (1)
β Files skipped from review due to trivial changes (1)
π WalkthroughWalkthroughThis PR updates AGENTS.md with four contributor-facing additions: a CRITICAL pre-commit and test-running checklist, a βChoosing the right markerβ subsection for RustPython test failures, a Rust docstring rule for items annotated with py-attributes, 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
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: d6122385-1f87-4008-a04f-27b504d37e52
π Files selected for processing (1)
AGENTS.md
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.
βΉοΈ Review info
βοΈ Run configuration
Configuration used: Path: .coderabbit.yml
Review profile: CHILL
Plan: Pro
Run ID: 86a57042-bdf9-4815-8d75-c0e05b770c33
π Files selected for processing (1)
AGENTS.md
- Note that rustpython-doc supplies CPython docstrings via the derive macros - Flag that `///` comments override that source and are dropped on `#[pyattr]`
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
///on those items).