Add Copilot PR review instructions for modern Go 1.26 patterns#7316
Add Copilot PR review instructions for modern Go 1.26 patterns#7316spboyer merged 1 commit intoAzure:mainfrom
Conversation
The Copilot PR reviewer flagged 5 false positives on PR Azure#7223 because it didn't know about Go 1.26 features (e.g. new(expr) for pointer literals) and incorrectly flagged missing imports that existed outside the diff context. These patterns are documented in cli/azd/AGENTS.md but the PR reviewer reads .github/instructions/*.instructions.md files, not AGENTS.md. This adds a focused Go-specific instruction file that covers: - new(expr) pointer literal syntax (Go 1.26) - Other modern Go patterns that should not be flagged - Guidance to check full file context, not just diff hunks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Adds Go-specific Copilot PR review instructions so automated reviews stop flagging Go 1.26+ language/features and avoid “missing import/symbol” false-positives when the diff doesn’t show full file context.
Changes:
- Introduces
.github/instructions/go.instructions.mdscoped to**/*.go. - Documents accepted modern Go patterns (e.g.,
new(expr), integerrange, test helpers). - Instructs the reviewer to validate imports/symbols against unchanged file sections before reporting issues.
|
@kristenwomack I think once #7301 merges this becomes redundant since it already adds copilot-instructions.md pointing to AGENTS.md which has the Go 1.26 patterns. Can we close this one after #7301 lands? |
This PR (#7316) is specific to Copilot's PR review process. The docs change in #7301 adds instructions to the docs. I'm open to the how we get this done, so please do make suggested changes, but we should have docs and also customize the copilot PR config. The intension of this PR: add .github/instructions/go.instructions.md — a path-scoped instruction file with applyTo: "**/*.go". In #7301, . PR #7301 is fantastic, and this PR is intended to make Copilot actually read the relevant pages during Go file reviews. Reference docs:
|
|
/check-enforcer override |
…#7316) The Copilot PR reviewer flagged 5 false positives on PR Azure#7223 because it didn't know about Go 1.26 features (e.g. new(expr) for pointer literals) and incorrectly flagged missing imports that existed outside the diff context. These patterns are documented in cli/azd/AGENTS.md but the PR reviewer reads .github/instructions/*.instructions.md files, not AGENTS.md. This adds a focused Go-specific instruction file that covers: - new(expr) pointer literal syntax (Go 1.26) - Other modern Go patterns that should not be flagged - Guidance to check full file context, not just diff hunks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7316) The Copilot PR reviewer flagged 5 false positives on PR Azure#7223 because it didn't know about Go 1.26 features (e.g. new(expr) for pointer literals) and incorrectly flagged missing imports that existed outside the diff context. These patterns are documented in cli/azd/AGENTS.md but the PR reviewer reads .github/instructions/*.instructions.md files, not AGENTS.md. This adds a focused Go-specific instruction file that covers: - new(expr) pointer literal syntax (Go 1.26) - Other modern Go patterns that should not be flagged - Guidance to check full file context, not just diff hunks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…#7316) The Copilot PR reviewer flagged 5 false positives on PR Azure#7223 because it didn't know about Go 1.26 features (e.g. new(expr) for pointer literals) and incorrectly flagged missing imports that existed outside the diff context. These patterns are documented in cli/azd/AGENTS.md but the PR reviewer reads .github/instructions/*.instructions.md files, not AGENTS.md. This adds a focused Go-specific instruction file that covers: - new(expr) pointer literal syntax (Go 1.26) - Other modern Go patterns that should not be flagged - Guidance to check full file context, not just diff hunks Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Fixes #7315
The Copilot PR reviewer flagged 5 false positives on #7223 because it didn't recognize Go 1.26 features (
new(expr)pointer literals) and incorrectly flagged imports that existed outside the diff context.The modern Go patterns are documented in
cli/azd/AGENTS.md, but the PR reviewer doesn't read that file — it reads.github/instructions/*.instructions.md.Changes
.github/instructions/go.instructions.md— New instruction file scoped to**/*.gothat tells the Copilot PR reviewer about:new(expr)pointer literal syntax (Go 1.26)errors.AsType,for i := range n,t.Context(),wg.Go(), etc.)