Skip to content

[upstream #975] Scripts: reject empty required sections in pr_check.py and expand unit tests - #139

Closed
ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/975
Closed

ufoptg wants to merge 1 commit into
mainfrom
upstream-pr/975

Conversation

@ufoptg

@ufoptg ufoptg commented Nov 24, 2026

Copy link
Copy Markdown
Owner

Fixes an empty-section bypass in scripts/pr_check.py where a blank **Tested** or **Not tested** heading followed by another template heading (such as **Regression run** or **Not tested**) matched \s*\n\s*\S against the next heading and passed as non-empty, and expands scripts/test_pr_check.py to cover all check branches of pr_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, valid xcl-smoke v1 pairs 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

  • Host: Windows 10 Pro build 19045, Python 3.14.6.
  • python -m unittest discover -s scripts -v: 10 passed, 0 failed (before the pr_check.py fix, test_missing_or_empty_sections_are_reported failed with 2 != 0).
  • Checked the updated section check against the 25 most recent merged PR descriptions on ivall/xcl: 0 diffs vs the previous regex.
  • Rust workspace not rebuilt/run here (scripts-only change; no Rust files modified).

Regression run
Not needed: this PR changes only scripts/pr_check.py and scripts/test_pr_check.py and does not touch crates/xcl/src/.

Not tested

  • The live GitHub Actions pull_request_target workflow itself (which runs main's copy of scripts/pr_check.py until merged) or pr_check.py's --repo GitHub API CLI paths.
  • Retail titles or GPU tests.

AI use

  • Antigravity (gemini-4-neon) wrote the fix, unit tests, and this description, and ran the Python test suite and merged-PR corpus check above.

Mirror of xcl-dev#975 (auto-synced, do not edit).

@ufoptg

ufoptg commented Nov 25, 2026

Copy link
Copy Markdown
Owner Author

Upstream PR xcl-dev#975 was closed or merged.

@ufoptg ufoptg closed this Nov 25, 2026
@ufoptg
ufoptg deleted the upstream-pr/975 branch November 25, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants