Skip to content

chore(amdsmi): use the amd-smi review agents in Copilot code review - #14718

Merged
adam360x merged 4 commits into
developfrom
users/adam360x/amdsmi-copilot-review-instructions
Nov 3, 2026
Merged

adam360x merged 4 commits into
developfrom
users/adam360x/amdsmi-copilot-review-instructions

Conversation

@adam360x

@adam360x adam360x commented Oct 30, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Copilot code review runs on every develop PR but never sees the amd-smi review agents (maintainer, skeptic, security, tests and the rest): it reads instruction files only from the repository root and cannot run custom agents, so projects/amdsmi/.github/agents/ is ignored.

Technical Details

Copilot instructions (.github/instructions/amdsmi-review*.instructions.md):

  • One symlink per review agent (the orchestrator and all 10 lenses) to its file in projects/amdsmi/.github/agents/, so Copilot code review always reads the current agents. Nothing is copied.

Review agents (projects/amdsmi/.github/agents/amdsmi-review*.agent.md):

  • Add applyTo: "projects/amdsmi/**", so only PRs that change amd-smi files get the agents, and excludeAgent: "cloud-agent", which keeps them out of the Copilot cloud agent. Copilot reads both through the symlinks; VS Code doesn't use them for agent files.

Code owners (.github/CODEOWNERS):

  • Give the symlinks to @ROCm/smi-reviewers, like /.github/workflows/amdsmi-*.yml.

Side effect: VS Code also reads root .github/instructions/. With the whole repository open, it attaches the agents to agent-mode edits of files under projects/amdsmi/.

Issue Tracking

JIRA ID: TBD

Test Plan

  • Opened draft PRs into throwaway branches, each with the same CHANGELOG-only diff and the review agents in a different place, and requested a Copilot review on each.
  • Load test: appended a test-only "flag the word X" rule to the end of each of the 11 agents (a different word per agent) and changed one CHANGELOG line that contains all 11 words.
  • Ran this branch against a true CHANGELOG entry rewritten with internal names, and an entry claiming a fix that develop doesn't have.
  • Root pre-commit hooks; GitHub CODEOWNERS errors API.

Test Result

Submission Checklist

- Add .github/instructions/amdsmi.instructions.md, scoped to
  projects/amdsmi/**, so Copilot code review applies the amd-smi
  maintainers' review rules to amd-smi changes. Copilot code review
  only reads instruction files at the repository root.
- Give the file to @ROCm/smi-reviewers in CODEOWNERS, like the amdsmi
  workflows.

Signed-off-by: Adam360x <Adam.pryor@amd.com>
Copilot AI balanced review requested due to automatic review settings October 30, 2026 19:52
@adam360x
adam360x requested a review from a team as a code owner October 30, 2026 19:52
@therock-pr-bot

therock-pr-bot Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass PR does not contain code files — Unit Test auto-passed
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

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.

🟡 Changes recommended

The review instructions would cause false positives by mischaracterizing ASSERT_* behavior in void lambdas and prohibiting documented partial metrics results containing N/A values.

2 open issues
What changed in this PR

This PR makes amd-smi’s review guidance available to Copilot through a repository-root instruction file, scoped to projects/amdsmi/**.

Changes:

  • Adds review checks for correctness, API compatibility, concurrency, tests, and documentation, placing code checks before wording rules.
  • Excludes the instructions from the Copilot cloud agent.
  • Assigns ownership of the instruction file to @ROCm/smi-reviewers.
File Description
.github/​instructions/​amdsmi.instructions.md Adds scoped amd-smi guidance for Copilot code review.
.github/​CODEOWNERS Assigns the new instruction file to the amd-smi reviewers.

Review effort: Balanced

- Replace the hand-written summary with the review agents themselves:
  tools/update_copilot_review_instructions.py copies the body of each
  .github/agents/amdsmi-review*.agent.md, unchanged, into
  .github/instructions/<agent>.instructions.md at the repository root,
  scoped to projects/amdsmi/**
- Add the AMDSMI Copilot Review Instructions workflow, which fails when
  a copy no longer matches its agent
- Give the generated files to @ROCm/smi-reviewers in CODEOWNERS

Signed-off-by: Adam360x <Adam.pryor@amd.com>
@adam360x adam360x changed the title chore(amdsmi): add Copilot code review instructions chore(amdsmi): use the amd-smi review agents in Copilot code review Oct 30, 2026
@adam360x
adam360x requested a review from a team as a code owner October 30, 2026 20:12
@github-actions github-actions Bot added project: amdsmi github actions Pull requests that update GitHub Actions code labels Oct 30, 2026
- Replace the generated copies in .github/instructions/ with symlinks to
  the review agents, so Copilot code review always reads the current
  agents
- Add applyTo and excludeAgent to each review agent's frontmatter, which
  Copilot code review reads through the symlinks
- Remove the generator script and its CI check, which the symlinks make
  unnecessary

Signed-off-by: Adam360x <Adam.pryor@amd.com>
@adam360x
adam360x requested a review from geomin12 November 2, 2026 14:39

@geomin12 geomin12 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.

lgtm, but i would like to see amdsmi team folks review as well

@adam360x

adam360x commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

@copilot resolve the merge conflicts in this pull request

…smi-copilot-review-instructions

# Conflicts:
#	.github/CODEOWNERS
#	projects/amdsmi/.github/agents/amdsmi-review-maintainer.agent.md

Co-authored-by: adam360x <61172547+adam360x@users.noreply.github.com>

Copilot AI commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

@copilot resolve the merge conflicts in this pull request

Merged develop and resolved both conflicts in merge commit d30999804.

@adam360x
adam360x merged commit 2be94ee into develop Nov 3, 2026
33 of 34 checks passed
@adam360x
adam360x deleted the users/adam360x/amdsmi-copilot-review-instructions branch November 3, 2026 21:11
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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

Labels

github actions Pull requests that update GitHub Actions code organization: ROCm project: amdsmi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants