Repository navigation
Scripts: reject empty required sections in pr_check.py and expand unit tests - #975
certified-retart wants to merge 1 commit into
Conversation
pane33
left a comment
There was a problem hiding this comment.
Tested locally on Fedora and confirmed the fix for empty sections, though note that the branch currently predates 6522c24 (smoke_blocks() updates) and will need a rebase against main.
Tested
Verified PR head 3fb8a36206be754b3dc7c648df91bdb984260b03 on Fedora Linux 45 Workstation with Python 3.15.2:
PYTHONDONTWRITEBYTECODE=1 python3 -m unittest discover -s scripts -p test_pr_check.py -v— 10 passed, 0 failed, 0 skipped.- Reproduced the before/after behavior against
pr_check.check()comparingmain(6efdabcdaac93ce5cc123a85e85deba5d49cb294) and3fb8a36206be754b3dc7c648df91bdb984260b03: a whitespace-only**Tested**section followed by**Not tested**returned[]onmainand['the **Tested** section is missing or empty']on the PR head, while a valid section containing**Machine:**and**Result:**subheadings continued to return[]on both.
Not tested
Windows build and Rust test suite, GPU/smoke runs, the live GitHub Actions workflow, and the rebased merge result with current main.
AI use
Used OpenAI Codex CLI (GPT-6.2-Sol) to run the local verification commands and help structure this report.
|
Independent check — this looks superseded by merged #1037 (the #965 fix, now on
Worth a rebase check by the author, but likely closeable. AI use: review by Devin (Cognition, SWE-2); no code changes. |
Fixes an empty-section bypass in
scripts/pr_check.pywhere a blank**Tested**or**Not tested**heading followed by another template heading (such as**Regression run**or**Not tested**) matched\s*\n\s*\Sagainst the next heading and passed as non-empty, and expandsscripts/test_pr_check.pyto cover all check branches ofpr_check.py.What is in it
scripts/pr_check.py: extract each required section's body up to the next template heading (What is in it,Tested,Regression run,Not tested,AI use) or end of text before checking.strip(), so empty sections followed by another template heading are rejected while bold subheadings (e.g.**Machine:**) inside a section remain accepted.scripts/test_pr_check.py: add 7 unit tests (PrCheckRulesTests) covering empty/adjacent required sections, bold subheadings, banned open-weight models vs frontier models, game files / binary /tests/data/1 MiB limit / removed-file skips, validxcl-smoke v1pairs at exact thresholds (0.8×frames,1.25×peak commit), uncommitted/non-main smoke blocks,device removals/crashes/killed/ title-or-seconds mismatches, and frame-drop / commit-growth rejections.Tested
3.14.6.python -m unittest discover -s scripts -v: 10 passed, 0 failed (before thepr_check.pyfix,test_missing_or_empty_sections_are_reportedfailed with2 != 0).ivall/xcl: 0 diffs vs the previous regex.Regression run
Not needed: this PR changes only
scripts/pr_check.pyandscripts/test_pr_check.pyand does not touchcrates/xcl/src/.Not tested
pull_request_targetworkflow itself (which runsmain's copy ofscripts/pr_check.pyuntil merged) orpr_check.py's--repoGitHub API CLI paths.AI use
gemini-4-neon) wrote the fix, unit tests, and this description, and ran the Python test suite and merged-PR corpus check above.