Skip to content

feat: use GitHub suggestion syntax in PR reviewer comments#47508

Merged
pelikhan merged 2 commits into
copilot/resolve-issue-stringsjoinonefrom
copilot/update-aw-prompt-to-suggestions
Jul 23, 2026
Merged

feat: use GitHub suggestion syntax in PR reviewer comments#47508
pelikhan merged 2 commits into
copilot/resolve-issue-stringsjoinonefrom
copilot/update-aw-prompt-to-suggestions

Conversation

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

PR reviewer workflows embed code fixes in collapsed <details> blocks, requiring authors to read and manually apply changes. Switching to GitHub's suggestion syntax makes fixes one-click applicable directly from the review UI.

Changes

  • pr-code-quality-reviewer.md — Step 4 updated: prefer ```suggestion blocks for concrete line-level fixes; start_line guidance added for multi-line spans; <details> retained as fallback for issues requiring broader structural changes
  • mattpocock-skills-reviewer.md — Step 5 updated with the same pattern; two concrete JSON examples (with and without suggestion) replace the single <details>-only example

Example

Review comment body with a one-click suggestion:

**Potential nil dereference**: `user.Profile` is accessed without a nil check and will panic if the user has no profile.

```suggestion
if user.Profile == nil {
    return ErrNoProfile
}
profile := user.Profile
```

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title feat: use suggestion syntax in PR reviewer review comments feat: use GitHub suggestion syntax in PR reviewer comments Jul 23, 2026
Copilot AI requested a review from pelikhan July 23, 2026 07:03

@pelikhan pelikhan left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot use safe outputs pull request review comment

@github-actions

Copy link
Copy Markdown
Contributor

🤖 PR Triage

Field Value
Category feature
Risk 🟢 Low
Priority Score 35/100
Recommended Action defer

Score Breakdown: Impact 15 · Urgency 10 · Quality 10

DRAFT PR updating reviewer workflows to use GitHub suggestion syntax. Low-urgency improvement — no CI data available. Defer until author marks ready for review.

Generated by 🔧 PR Triage Agent · sonnet46 33.1 AIC · ⌖ 7.95 AIC · ⊞ 5.7K ·

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Jul 23, 2026

Copy link
Copy Markdown
Contributor Author

@copilot use safe outputs pull request review comment

Done — pr-code-quality-reviewer.md Step 4 examples now use the safe-output JSON format (path, line, body) consistent with mattpocock-skills-reviewer.md. The suggestion block is shown inside the body field, with start_line guidance for multi-line spans. Commit: feat: use safe-output JSON format for review comment examples

Copilot AI requested a review from pelikhan July 23, 2026 07:10
@pelikhan
pelikhan marked this pull request as ready for review July 23, 2026 07:26
Copilot AI review requested due to automatic review settings July 23, 2026 07:26
@pelikhan
pelikhan merged commit 1e14615 into copilot/resolve-issue-stringsjoinone Jul 23, 2026
@pelikhan
pelikhan deleted the copilot/update-aw-prompt-to-suggestions branch July 23, 2026 07:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates PR reviewer workflows to generate one-click GitHub code suggestions.

Changes:

  • Adds suggestion-block guidance and examples.
  • Retains <details> as a fallback for structural fixes.
  • Refreshes generated workflow metadata.
Show a summary per file
File Description
.github/workflows/pr-code-quality-reviewer.md Updates review-comment instructions.
.github/workflows/pr-code-quality-reviewer.lock.yml Refreshes generated metadata.
.github/workflows/mattpocock-skills-reviewer.md Adds suggestion guidance and examples.
.github/workflows/mattpocock-skills-reviewer.lock.yml Refreshes generated metadata.

Review details

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comments suppressed due to low confidence (2)

.github/workflows/pr-code-quality-reviewer.md:140

  • This preference conflicts with the existing Review Formatting rule at line 193, which still requires every code suggestion to be wrapped in <details>. With both instructions present, the reviewer may continue producing the old non-applicable format. Update that rule to exempt direct GitHub suggestions.
- **GitHub suggestion** (preferred when the fix maps to the commented lines): use a ` ```suggestion ` block so the author can apply it with one click

.github/workflows/mattpocock-skills-reviewer.md:208

  • start_line is based on how many existing diff lines are being replaced, not how many lines appear in the replacement text. The current wording teaches incorrect range construction and conflicts with the safe-output contract where line is the ending line (actions/setup/js/safe_outputs_tools.json:419-435).
- Use a `` ```suggestion `` block (preferred) when the fix is a concrete replacement for the commented lines; set `start_line` when spanning multiple lines
  • Files reviewed: 4/4 changed files
  • Comments generated: 2
  • Review effort level: Medium

<summary>💡 Suggested fix</summary>
For each significant issue, call `create-pull-request-review-comment` (safe output) with:
- `path` — repository-relative file path
- `line` — line number in the diff (use `start_line` when the replacement spans multiple lines)
"path": "path/to/file.ts",
"line": 42,
"body": "**[/tdd]** Missing edge case: `value` is `null` — add a test to prevent this regression.\n\n<details>\n<summary>💡 Suggested test</summary>\n\n```ts\nit('returns default when value is null', () => {\n expect(fn(null)).toBe(defaultValue);\n});\n```\n\nMissing edge case tests are a common source of regressions.\n\n</details>\n\n@copilot please address this."
"body": "**[/tdd]** Missing edge case: `value` is `null` — add a test to prevent this regression.\n\n```suggestion\nit('returns default when value is null', () => {\n expect(fn(null)).toBe(defaultValue);\n});\n```\n\nMissing edge case tests are a common source of regressions.\n\n@copilot please address this."
@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.83.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants