Repository navigation
ci: tell agents how to fix a PR body that skips the template - #14412
Conversation
|
Intent: When PR Hygiene fails a body that skips the template, tell the author (usually an agent) exactly what is missing and how to fix it, and tell agents in AGENTS.md that gh pr create bypasses the template. |
Design Review (Fable 5) — ✅ PASSDesign-level review of Design-Verdict: PASS Verify the [DESIGN-REVIEWED] 57c240b |
GPT 5.6 Review — ✅ no blocking findingsGPT 5.6 completed its review of This comment is updated in place on each push. Review detailsNo findings. False positive or not applicable? A repository writer can comment: |
First Principles Review (Fable 5) — ✅ PASSPremise-level review of First-Principles-Verdict: PASS Verify on one real fork PR that the fork check-run summary — which also gains the numbered "How to fix it" steps — still renders within GitHub's check-run limits. What this change shipsInventory (7 items) — 7 justifiedIntent: FIX — a failing PR-body check told the author a count instead of what to fix (examples #14173, #14322).
Consumer counts run: [FIRST-PRINCIPLES-REVIEWED] 57c240b |
Opus 5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
4d0bcbd to
b0e2f59
Compare
|
|
|
b0e2f59 to
f46af48
Compare
f46af48 to
1a57392
Compare
PR Hygiene's error annotation now names the missing sections and the fix, the full steps go to the job summary, the fork-only approval note stays on the fork check, and AGENTS.md says gh pr create bypasses the GitHub template.
1a57392 to
57c240b
Compare
Problem / Motivation
Goal: When PR Hygiene fails a PR body that skips the template, the author (often a coding agent) is told exactly what to fix and how.
Agents open PRs with
gh pr create --body-file, which never loads.github/PULL_REQUEST_TEMPLATE.md. PR Hygiene then fails, but its error annotation only says "4 required description sections are missing". The list of missing parts is buried in the job log, and the fix text talks about fork approval, which does not apply to a same-repo PR. Example: #14322 uses## Summary/## Cross-OSinstead of the template headings.Why it matters
A failure that names no fix makes the agent guess, so it pads the body or rewrites it by hand, and the check stays red for another round. Most PRs here are opened by agents, so the failure message is effectively their instructions.
Not a goal
## Summary. The rule set stays presence-only.contents: readonly).What changed (motivation → approach → change)
AGENTS.mdgh pr createbypasses the template: build the body from it and self-check.github/scripts/pr-description-check.shnow writes anannotationoutput: one line listing everything missing (sections, the Goal line if absent) and the fix (rebuild from the template, keep headings verbatim, save the description, no push). Its summary gains "How to fix it" steps, including a local self-check command. A newPR_CALLERinput keeps the fork-approval sentence onfork-pr-description.yml(the default) and drops it forcode-review.yml, which passesPR_CALLER=pr-hygiene. The template link now tolerates a missingGITHUB_REPOSITORY, so the self-check runs outside Actions.docs/ci/ci-and-reviews.mddescribes the new failure output.Backwards compatibility
Compatible: the pass/fail rules and the required sections are unchanged; only failure wording and one extra output key are added. The fork check keeps its existing summary text by default.
Tests
test/test_fork_pr_description_workflow.py:mktempfile, in the script output and inAGENTS.md;GITHUB_REPOSITORY;PR_CALLER=pr-hygiene, emits the annotation, and writes the job summary.Manual verification
Ran the script on #14322's live body with
PR_CALLER=pr-hygiene: failure, annotation lists## Problem / Motivation, ## Why it matters, ## Not a goal, ## What changedplus the fix, no fork sentence. Ran theAGENTS.mdself-check recipe twice in a row (failing body, then this body): each run reads one freshconclusion.Screenshots / video
Why no screenshot: CI script and docs only; no dashboard change.
no linked issue: follow-up to template-compliance feedback on #14173 and #14322.