PR checks: reject untouched PR template placeholders (#965) #1030

Merged
ksanjeev284 merged 1 commit from upstream-pr/1037 into main 2026-11-24 11:03:44 +00:00
ksanjeev284 commented 2026-11-24 10:43:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ksanjeev284 on 2026-11-24T10:43:55Z.


Fixes #965.

Previously scripts/pr_check.py checked required sections with \*\*<section>\*\*\s*\n\s*\S, so an untouched .github/pull_request_template.md passed Tested, Not tested, and AI use because the template's placeholder lines and bare - bullet matched \S.

What is in it

  • scripts/pr_check.py: add section_has_content() to extract each required section up to the next template heading, strip HTML comments and leading bullet markers, and ignore the verbatim placeholder lines from .github/pull_request_template.md.
  • scripts/test_pr_check.py: add TemplatePlaceholderTests verifying that the untouched .github/pull_request_template.md fails all three required sections, bare bullets/comments alone fail, and sections with real content pass.

Tested

  • Host: Windows 11, Python 3.12.6
  • python -m unittest discover -s scripts -v: 8 passed, 0 failed
  • Checked section_has_content() against the 20 most recently merged PRs on ivall/xcl: 0 false positives (only #771 lacked an **AI use** heading altogether).
  • python scripts/pr_check.py --local on this PR's description and changed files: description ok

Regression run

  • Not needed: changes only scripts/pr_check.py and scripts/test_pr_check.py (no files under crates/xcl/src/).

Not tested

  • Live GitHub Actions pull_request_target execution (uses main's copy of scripts/pr_check.py until merged).
  • Rust workspace build/tests and retail title smoke run (scripts-only change).

AI use

  • Antigravity (Gemini 3.1 Pro) implemented the fix, unit tests, corpus check, and PR description under author review.
<!-- greyfinch-sync:ivall/xcl:issue:6580002675 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1037). Originally posted by [ksanjeev284](https://github.com/ksanjeev284) on 2026-11-24T10:43:55Z. --- Fixes #965. Previously `scripts/pr_check.py` checked required sections with `\*\*<section>\*\*\s*\n\s*\S`, so an untouched `.github/pull_request_template.md` passed **Tested**, **Not tested**, and **AI use** because the template's placeholder lines and bare `-` bullet matched `\S`. **What is in it** - `scripts/pr_check.py`: add `section_has_content()` to extract each required section up to the next template heading, strip HTML comments and leading bullet markers, and ignore the verbatim placeholder lines from `.github/pull_request_template.md`. - `scripts/test_pr_check.py`: add `TemplatePlaceholderTests` verifying that the untouched `.github/pull_request_template.md` fails all three required sections, bare bullets/comments alone fail, and sections with real content pass. **Tested** - Host: Windows 11, Python 3.12.6 - `python -m unittest discover -s scripts -v`: 8 passed, 0 failed - Checked `section_has_content()` against the 20 most recently merged PRs on `ivall/xcl`: 0 false positives (only #771 lacked an `**AI use**` heading altogether). - `python scripts/pr_check.py --local` on this PR's description and changed files: `description ok` **Regression run** - Not needed: changes only `scripts/pr_check.py` and `scripts/test_pr_check.py` (no files under `crates/xcl/src/`). **Not tested** - Live GitHub Actions `pull_request_target` execution (uses `main`'s copy of `scripts/pr_check.py` until merged). - Rust workspace build/tests and retail title smoke run (scripts-only change). **AI use** - Antigravity (Gemini 3.1 Pro) implemented the fix, unit tests, corpus check, and PR description under author review.
upstream-sync closed this pull request 2026-11-24 11:05:31 +00:00
copilot-pull-request-reviewer[bot commented 2026-11-24 11:05:31 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by copilot-pull-request-reviewer[bot] on 2026-11-24T10:44:06Z.

Review: COMMENTED


Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

<!-- greyfinch-sync:ivall/xcl:review:6037777381 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1037#pullrequestreview-6037777381). Originally posted by [copilot-pull-request-reviewer[bot]](https://github.com/copilot-pull-request-reviewer%5Bbot%5D) on 2026-11-24T10:44:06Z. **Review:** COMMENTED --- Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
ivall commented 2026-11-24 11:06:03 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by ivall on 2026-11-24T11:04:31Z.


Merged in dc6a283 – thanks. It conflicted with #995's builds_runtime() next to runtime(); both are kept. Checked on the merged tree: python scripts/test_pr_check.py 9 tests OK; the untouched template gets all three section problems; and the new section check gives the same answer as the old one on the last 40 PR descriptions except #1039, which is an untouched template.

<!-- greyfinch-sync:ivall/xcl:comment:7129621612 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1037#issuecomment-7129621612). Originally posted by [ivall](https://github.com/ivall) on 2026-11-24T11:04:31Z. --- Merged in dc6a283 – thanks. It conflicted with #995's `builds_runtime()` next to `runtime()`; both are kept. Checked on the merged tree: `python scripts/test_pr_check.py` 9 tests OK; the untouched template gets all three section problems; and the new section check gives the same answer as the old one on the last 40 PR descriptions except #1039, which is an untouched template.
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!1030
No description provided.