ARM API Reviewer: Copilot agent for Azure REST API spec PR reviews#41957
ARM API Reviewer: Copilot agent for Azure REST API spec PR reviews#41957
Conversation
…rating modes, and local fix workflow
Next Steps to MergeNext steps that must be taken to merge this PR:
Comment generated by summarize-checks workflow run. |
|
Below is one example of the review
Two new TypeSpec projects under
Blocking Issues — New (must fix before merge)These issues were introduced in this PR and must be resolved.
Warnings — New (should fix)
Suggestions (optional improvements)
Breaking Change Analysis
Summary
The most critical blocking issues are #1 |
…s such as Incident 31000000574418 : [MSRC] [111551] - Dynatrace Observability - Dynatrace.Observability/monitors (definitions.EnvironmentInfo.properties.ingestionKey) - AuthZ misconfiguration: ARM Reader discloses ingestionKey
…luding checks for existing comments, tagging of issues, and severity levels for new findings.
…e and its workflow for validating local API specification changes.
… changes and PR reviews
…nhance de-duplication and reporting of findings
…ity and consistency
…or improved navigation in reports
…eferences and clarify PUT operation descriptions for idempotency.
|
Next steps after the PR merges
|
- Added guidelines for globally unique operation IDs and write-only properties in ARM API review instructions. - Introduced rules against conditional read-only and immutable properties, CSV-encoded values, and properties accepting multiple data types. - Specified requirements for default values, array ordering, and property value casing in ARM API review instructions. - Updated OpenAPI review instructions to include checks for write-only properties and conditional read-only properties. - Revised TypeSpec review instructions to prohibit write-only properties and conditional read-only properties. - Improved documentation for the API reviewer agent with a new Getting Started Guide link.
haolingdong-msft
left a comment
There was a problem hiding this comment.
Thanks @ravimeda for the PR, I love the idea, just leave some comments for improvements.
…nt-posted comments
- Updated SKILL.md to include additional references and key rule IDs for property mutability, tracked resource lifecycle, and other areas. - Added new reference files for availability zones, field ownership, policy compatibility, template deployment, and what-if preflight compliance. - Enhanced existing reference files for enum best practices, naming conventions, property mutability, provisioning state, secret detection, and tracked resource lifecycle with upstream alignment notes and additional guidelines.
…zure-rest-api-specs into raeda/api-reviewer-agent
…rule coverage and design decisions. Added linter rule coverage map (linter-rule-coverage.md) mapping 130+ linter rule IDs to their instruction file sections, and design decision frameworks (design-decisions.md) with 10 structured trade-off matrices (DD-001–DD-010) for grey-area API design choices like inline vs nested resources, boolean vs enum, and sync vs async. Also added linter rule annotations to armapi-review.instructions.md (R2001 AvoidNestedProperties) and openapi-review.instructions.md (8 operation ID rule annotations + R2063 gap rule), updated SKILL.md with design principles, formatting guidance, and the 2 new reference file entries.
…ines - Updated ARM API Reviewer instructions to emphasize the importance of depth in judgment and collaboration with human reviewers. - Added new guidelines for TypeSpec conversion reviews, specifying that conversions must be horizontal and validating generated outputs. - Introduced `suppressions.yaml` format for specifying suppressions in YAML, along with verification criteria for PRs modifying this file. - Clarified the immutability of published API versions in ARM-specific review instructions.
…stency and clarity
haolingdong-msft
left a comment
There was a problem hiding this comment.
Thanks for the PR! LGTM. I'm good as long as the prompts are update to date.
ARM API Reviewer: Copilot agent for Azure REST API spec PR reviews
Why
ARM API reviewers manually inspect spec PRs against the Resource Provider Contract (RPC), the Azure REST API Guidelines, and repository conventions. Common issues -- missing
provisioningState, incorrect DELETE response codes, secrets in GET responses, malformed examples -- are caught late and require multiple review round-trips.To build a comprehensive rule set, review comments from tens of thousands of PRs across both repos were retrieved using GitHub GraphQL and analyzed with Copilot to identify the most frequent guidance given to spec authors. The resulting patterns were codified into structured instruction files that supplement the canonical sources (RPC, Azure REST API Guidelines).
This PR introduces an AI-powered reviewer that runs inside VS Code as a Copilot agent, designed for ARM API reviewers to use during their weekly review rotation.
What it does
The agent operates in read-only PR review mode. It fetches PRs from GitHub, produces a structured report with exact line numbers, rule IDs, and fix suggestions, and can post review comments with reviewer approval. It does not modify files.
Workflow: The reviewer points the agent at a PR (public or private repo). The agent reviews the changed spec files and presents findings in chat. The reviewer validates which findings to post as PR comments. Before posting, the agent checks existing comments to avoid duplicates and posts at the exact file and line. The reviewer can then update labels to manage the PR queue.
Key capabilities:
readme.mdsuppressions across API versions: flags accidentally dropped or unjustified new suppressionsARMChangesRequested/WaitForARMFeedback)What it does NOT do
Files changed
20 new files, 5 modified files.
.github/agents/arm-api-reviewer.agent.md.github/instructions/armapi-review.instructions.md.github/instructions/openapi-review.instructions.md.github/instructions/typespec-review.instructions.md.github/instructions/typespec-project.instructions.md.github/skills/azure-api-review/SKILL.md.github/skills/azure-api-review/references/secret-detection.md.github/skills/azure-api-review/references/property-mutability.md.github/skills/azure-api-review/references/provisioning-state.mdprovisioningStaterequirements, terminal states, transition rules.github/skills/azure-api-review/references/naming-conventions.mdcreatedAt,lastModifiedAt), and resource identifier naming (Idsuffix).github/skills/azure-api-review/references/enum-best-practices.md.github/skills/azure-api-review/references/tracked-resource-lifecycle.mdx-ms-azure-resourceplacement.github/skills/azure-api-review/references/policy-compatibility.md.github/skills/azure-api-review/references/template-deployment.md.github/skills/azure-api-review/references/availability-zones.mdx-ms-mutabilityannotation, zone discoverability, cross-subscription move.github/skills/azure-api-review/references/field-ownership.md.github/skills/azure-api-review/references/what-if-preflight-compliance.md.github/skills/azure-api-review/references/lro-final-state-via.mdfinal-state-viadecision table for PUT/PATCH/DELETE/POST -- when to specify and anti-patterns.github/skills/azure-api-review/references/suppression-review-criteria.md.github/skills/azure-api-review/references/linter-rule-coverage.md.github/skills/azure-api-review/references/design-decisions.md.github/copilot-instructions.md.github/copilot-review-instructions.md.github/cspell.yamldocumentation/api-reviewer-agent.mdGetting started
See
documentation/api-reviewer-agent.mdfor setup and usage.Next steps
We plan to gather feedback from reviewers, refine the instructions and skills based on that feedback, and once we have confidence in quality, enable automatic reviews through Copilot Code Review in both repos.