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

Manually merged
github merged 1 commit from gh-pr/1037/head into gh-pr/1037/base 2026-11-26 04:41:26 +00:00
Owner

@⁠ksanjeev284 on GitHub · 2026-11-24 10:43 UTC · original
ksanjeev284:pr-965-template-placeholders → main · +61 −1 · 2 files · 1 commits · merged 2026-11-24 11:03 UTC

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.
**@⁠ksanjeev284** on GitHub · 2026-11-24 10:43 UTC · [original](https://github.com/xcl-dev/xcl/pull/1037) `ksanjeev284:pr-965-template-placeholders` → `main` · +61 −1 · 2 files · 1 commits · merged 2026-11-24 11:03 UTC 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.
Fixes #965. Extract each required section up to the next template heading, strip HTML comments and bare bullet markers, and ignore verbatim placeholder lines from .github/pull_request_template.md.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:41:26 +00:00
github manually merged commit 9a19d7e436 into gh-pr/1037/base 2026-11-26 04:41:26 +00:00
Author
Owner

@⁠ivall on GitHub · 2026-11-24 11:04 UTC · original

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.

**@⁠ivall** on GitHub · 2026-11-24 11:04 UTC · [original](https://github.com/xcl-dev/xcl/pull/1037#issuecomment-7129621612) 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.
This discussion has been locked. Commenting is limited to contributors.
No description provided.