Scripts: pr_check refuses smoke blocks without a title, time or frames #1124

Merged
emirduran707 merged 1 commit from upstream-pr/1133 into main 2026-11-24 15:51:39 +00:00
emirduran707 commented 2026-11-24 12:16:43 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by emirduran707 on 2026-11-24T12:16:43Z.


check() compares the main and PR xcl-smoke blocks through number(), which returns None for a missing field. The comparisons let None pass, and the title / seconds match compares None == None. So two blocks holding only xcl-smoke v1 and commit: <sha> pass every regression check.

CONTRIBUTING.md, item 3, asks for "at least 80 % of main's frames", with blocks "of the same title for the same time". Neither can be checked on such a block.

What is in it

  • scripts/pr_check.py:
    • field_problems reports a smoke block that lacks a title, seconds or frames shown line, or has a non-number in one of the last two;
    • each message names the field and the block's commit;
    • it runs on the PR's block, and on the main block that matches it (on every main block when none matches).
  • Scope, to avoid overlapping open PRs:
    • the crash and device-removal counts are left to #635, which requires numeric counts;
    • peak commit is left to #1103.
  • scripts/test_pr_check.py:
    • blocks with only commit lines are refused for each of the three fields, in both blocks;
    • a non-numeric frames shown is named;
    • the two blocks in one fence fixture gets full blocks.

Tested

  • Windows 11 Pro 26300, Python 3 (python -I).
  • python -I -m unittest discover -s scripts -p "test_*.py": 11 tests, OK.
  • With main's pr_check.py and these tests: FAILED (failures=2), the two new tests.

Not tested

  • The PR checks workflow itself on a PR with such a block; only the function, locally.
  • Merge order with #635 / #1103: both touch nearby lines, and #1103 also edits the same test fixture. Whichever lands second has a small rebase.

AI use

  • Claude Code with Claude Opus 5.5:
    • a sub-agent found and demonstrated this in an audit of pr_check.py;
    • another wrote the fix and tests;
    • I reviewed them, narrowed them to what #635 / #1103 do not cover, and made an empty commit line safe.

🤖 Generated with Claude Code

<!-- greyfinch-sync:ivall/xcl:issue:6581580434 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1133). Originally posted by [emirduran707](https://github.com/emirduran707) on 2026-11-24T12:16:43Z. --- `check()` compares the `main` and PR `xcl-smoke` blocks through `number()`, which returns `None` for a missing field. The comparisons let `None` pass, and the title / seconds match compares `None == None`. So two blocks holding only `xcl-smoke v1` and `commit: <sha>` pass every regression check. CONTRIBUTING.md, item 3, asks for "at least 80 % of `main`'s frames", with blocks "of the same title for the same time". Neither can be checked on such a block. **What is in it** - `scripts/pr_check.py`: - `field_problems` reports a smoke block that lacks a `title`, `seconds` or `frames shown` line, or has a non-number in one of the last two; - each message names the field and the block's commit; - it runs on the PR's block, and on the `main` block that matches it (on every `main` block when none matches). - Scope, to avoid overlapping open PRs: - the crash and device-removal counts are left to #635, which requires numeric counts; - `peak commit` is left to #1103. - `scripts/test_pr_check.py`: - blocks with only commit lines are refused for each of the three fields, in both blocks; - a non-numeric `frames shown` is named; - the `two blocks in one fence` fixture gets full blocks. **Tested** - Windows 11 Pro 26300, Python 3 (`python -I`). - `python -I -m unittest discover -s scripts -p "test_*.py"`: 11 tests, OK. - With `main`'s `pr_check.py` and these tests: FAILED (failures=2), the two new tests. **Not tested** - The `PR checks` workflow itself on a PR with such a block; only the function, locally. - Merge order with #635 / #1103: both touch nearby lines, and #1103 also edits the same test fixture. Whichever lands second has a small rebase. **AI use** - Claude Code with Claude Opus 5.5: - a sub-agent found and demonstrated this in an audit of `pr_check.py`; - another wrote the fix and tests; - I reviewed them, narrowed them to what #635 / #1103 do not cover, and made an empty `commit` line safe. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
futurepro62 commented 2026-11-24 15:05:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T14:15:51Z.


Tested exact head 1d83fd1, script tests only, since this PR has no test report yet.

Tested

  • Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here).
  • python -m pytest scripts/test_pr_check.py at the head: 11 passed.
  • The PR's test file(s) against current main's script (930e8b4): 2 failed: test_blocks_with_only_commit_lines_fail, test_non_numeric_frames_shown_fails. So the new test catches the problem the PR fixes.

Not tested

  • PowerShell 7, the CI workflow itself, a game (no runtime code changed).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7134094871 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1133#issuecomment-7134094871). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T14:15:51Z. --- Tested exact head `1d83fd1`, script tests only, since this PR has no test report yet. **Tested** - Windows 11 Home 26300, Python 3.14.3 with pytest 9.0.3, Windows PowerShell 5.1.26100.9818 (no PowerShell 7 here). - `python -m pytest scripts/test_pr_check.py` at the head: 11 passed. - The PR's test file(s) against current main's script (`930e8b4`): 2 failed: `test_blocks_with_only_commit_lines_fail`, `test_non_numeric_frames_shown_fails`. So the new test catches the problem the PR fixes. **Not tested** - PowerShell 7, the CI workflow itself, a game (no runtime code changed). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
upstream-sync closed this pull request 2026-11-24 16:05:57 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
xcl-dev/xcl!1124
No description provided.