Repository navigation
feat(bin): add opt-in PR squash commit summaries - #8366
Conversation
With the config/pr-squash-summary presence flag, a GitHub squash merge whose caller passed no subject or body uses the PR title plus (#N) as the subject and the PR body's ## What Changed section as the body, so the commit on the base branch describes the change instead of listing every branch commit. A missing or empty section, an unreadable PR, a merge or rebase method, caller-supplied commit text (including -t, -b, and -F after --), and GitLab and Forgejo merges keep the repository's own squash text. Opt-in: the behaviour is off by default. Without the flag the merge reads no PR text and sends exactly today's command; with it, the PR's summary overrides the repository's squash commit message setting. The head-match, attestation, and waiver guards are unchanged.
[Medium impact] The PR appears safe to merge, with the previous inline-code issue fixed and no new actionable issues found. Reviews (3) · Last reviewed commit: "fix(pr-merge): treat a backtick run hold..." · Reviewed by Greptile |
what_changed_section now tracks fenced code blocks (``` and ~~~, closed only by a run of the same character at least as long), so a "## " line inside a fence neither ends the What Changed section nor is selected as a fenced "## What Changed". Regression tests cover both.
A backtick-opened fence is valid only when its info string contains no backtick (CommonMark), so a line such as three backticks, text, three backticks is inline code. fence_run no longer opens a fence on it, so it neither swallows later headings and the appendix inside What Changed nor hides the real section before it. Tilde fences keep no such restriction.
|
Speaking as Kun's firstmate: thank you @Dematom1. I read the full diff against latest One note on the no-mistakes review warning about One thing is waiting on you: live evidence. Live validation is 0 of 3. The pipeline didn't drive a real squash merge, and the targeted test file timed out before it reached the new cases. Because this is opt-in, it can merge on its own once the full suite is green, and it rewrites the commit text of every merge for homes that turn it on. So I'd like one real run before queueing the full suite. A disposable GitHub repo you own is enough (nothing on this repo):
A contract-class: opt-in. With the flag absent, VISION: One captain aligns (git history shows the outcome, not the fix-up mechanics) · Authority aligns (off by default; caller text and every merge guard unchanged) · Scripts aligns (deterministic extraction) · Restart neutral · Delegation aligns · Vendor aligns (GitLab and Forgejo untouched) · Scope aligns. |
|
Live evidence, as asked: two real squash merges through
|
|
Speaking as Kun's firstmate: thank you @Dematom1, that settles the live-evidence ask. Both real squash merges ran through Gates on contract-class: opt-in, unchanged. With the flag absent, VISION: One captain aligns · Authority aligns (off by default; caller text and merge guards unchanged) · Scripts aligns · Restart neutral · Delegation aligns · Vendor aligns (GitLab and Forgejo untouched) · Scope aligns. |
|
Speaking as Kun's firstmate: this is merged. Thank you @Dematom1 — really appreciate you taking the time on this. |
What Changed
config/pr-squash-summarysetting that uses a GitHub PR title and its## What Changedsection as commit text for squash merges when the caller supplies no subject or body.Risk Assessment
Testing
The targeted merge test timed out before the squash-summary scenarios, and I did not mutate a real GitHub PR. No live scenario evidence or visual artifacts were gathered; result is inconclusive.
Evidence: Merge test timeout
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
tests/fm-pr-merge.test.sh:5595- The new assertion treats the NUL-delimited argv file as one whole record (grep -z -x), but the record contains the entiregh pr mergeargv, not a standalone--squashrecord. Thus this required-summary test fails even when the method is correctly present; check the captured argv withgithub_merge_flag_valueor parse its NUL-separated arguments. Same assertion site:tests/fm-pr-merge.test.sh:5595.bin/fm-pr-merge.sh:1- Live validation against an actual GitHub squash merge was not attempted because it would mutate a real PR; this is the previously declined live-validation concern. Mock-backed test harness execution is not live product validation, and the targeted test file timed out before reaching the new scenarios.git diff bb3b2d6951d021fcd085478b3c04f6ea16b22ba8 afbc48bbcc65fb5ff567863ed35d717836c81d30(identified runtime files and change)bash tests/fm-pr-merge.test.sh(exceeded 300-second limit before new squash-summary cases)✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.
Issues
Closes #8364