Fix excessive blank lines before generated footer in safe-output bodies#50554
Conversation
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
|
🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅ |
|
✅ Design Decision Gate 🏗️ completed the design decision gate check. No ADR enforcement needed: PR does not have the implementation label and has 0 new lines of code in business logic directories. |
|
✅ PR Code Quality Reviewer completed the code quality review. |
|
✅ Test Quality Sentinel completed test quality analysis. |
There was a problem hiding this comment.
Pull request overview
Fixes excessive spacing before safe-output footers.
Changes:
- Normalizes footer separation based on guard notices.
- Reduces separator lines in generated issue, discussion, and pull request bodies.
- Adds regression coverage for footers without guard notices.
Show a summary per file
| File | Description |
|---|---|
actions/setup/js/messages.test.cjs |
Tests footer spacing without notices. |
actions/setup/js/messages_footer.cjs |
Adjusts guard-notice/footer separation. |
actions/setup/js/create_issue.cjs |
Removes an extra issue-body separator. |
actions/setup/js/create_discussion.cjs |
Removes an extra discussion-body separator. |
actions/setup/js/create_pull_request.cjs |
Removes an extra pull-request-body separator. |
Review details
Tip
Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Files reviewed: 5/5 changed files
- Comments generated: 1
- Review effort level: Balanced
There was a problem hiding this comment.
The fix is correct and well-scoped.
messages_footer.cjs: correctly gates the `
separator onguardNotices` being truthy — empty string is falsy in JS, so no blank lines are emitted when there are no guard notices.
- The three
.cjsfiles consistently reduce the double-blank push to a single separator, matching the intent. - The regression test directly validates the reported symptom.
No blocking issues found.> 🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · sonnet46 · 16.3 AIC · ⌖ 10.3 AIC · ⊞ 5.4K
There was a problem hiding this comment.
Skills-Based Review 🧠
Applied /diagnosing-bugs and /tdd — approving with one minor observation on test coverage.
📋 Key Themes & Highlights
Key Themes
- Root cause properly addressed: both compounding sources of stray blank lines are fixed — the footer separator and the caller push.
- Regression test added: the happy-path (no guard notices) is now covered; see inline comment for a suggested complementary test.
Positive Highlights
- ✅ Minimal, surgical diff across exactly the files that mattered
- ✅
guardNotices.trimEnd()prevents trailing whitespace from leaking into the separator - ✅ Consistent fix applied to all three callers (issue, discussion, PR)
- ✅ PR description accurately explains both root causes and the fix strategy
| const { generateFooterWithMessages } = await import("./messages.cjs"); | ||
|
|
||
| const result = generateFooterWithMessages("Test Workflow", "https://github.com/test/repo/actions/runs/123", "", "", undefined, undefined, undefined); | ||
|
|
There was a problem hiding this comment.
[/tdd] The test covers only the no-guard-notices path. A complementary test for when guardNotices is non-empty would protect the intentional `
` separator in that branch — without it, a future regression there would go undetected.
@copilot please address this.
There was a problem hiding this comment.
Verdict: no blocking issues
Small, well-targeted fix: generateFooterWithMessages now only inserts the \n\n separator when guard notices exist and trims trailing whitespace off the notices block; the three create_*.cjs callers were updated to push a single blank separator line instead of two. Logic checked against all three call sites (issue/discussion/PR) and matches the regression test added in messages.test.cjs.
💡 Minor nit (non-blocking)
Line 738 in messages_footer.cjs has a leftover duplicate comment line (// Attribution footer line comes after any guard notices) immediately followed by the new 3-line comment restating the same thing. Harmless but slightly redundant — could be squashed into one comment block.
🧪 Test Quality Sentinel Report✅ Test Quality Score: 100/100 — Excellent
📊 Metrics (1 test)
Quality Highlights
Verdict
|
|
@copilot Please take another pass on this PR.
|
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Co-authored-by: gh-aw-bot <259018956+gh-aw-bot@users.noreply.github.com>
Generated issues, discussions, and pull requests rendered with a large empty gap between the body content and the
> Generated by ...footer, as seen in the linked issue.Two sources of stray newlines compounded:
generateFooterWithMessagesunconditionally prefixed the attribution line with"\n\n", even whenguardNoticeswas empty — so the returned footer started with blank lines.create_issue.cjs,create_discussion.cjs, andcreate_pull_request.cjseach pushed two emptybodyLinesentries before the footer.Changes
messages_footer.cjs: only insert the"\n\n"separator when guard notices (detection caution, blocked domains, DIFC filtering) are actually present, and trim trailing whitespace off the notices block.create_issue.cjs/create_discussion.cjs/create_pull_request.cjs: push a single blank separator line instead of two.messages.test.cjs: regression test asserting the footer starts directly with> Generated by ...when there are no guard notices.Recompiled workflow lock files are included since the setup JS is bundled into them.
Run: https://github.com/github/gh-aw/actions/runs/31011720441