docs: add PR review patterns to AGENTS.md#7301
Conversation
There was a problem hiding this comment.
Pull request overview
Updates the azd agent instruction guide (AGENTS.md) to capture recurring review findings and preferred patterns, aiming to reduce repeated issues in future PRs.
Changes:
- Adds guidance on output formatting (shell-safe path quoting; JSON type consistency).
- Expands standards for error handling, architecture boundaries, path safety, documentation, testing, and CI/GitHub Actions.
- Extends the testing section with concrete patterns for env vars, timeouts, cross-platform behavior, and helper reuse.
63a191a to
d3760e7
Compare
Add lessons learned from team and Copilot reviews across PRs #7290, #7251, #7250, #7247, #7236, #7235, #7202, #7039 as agent instructions to prevent recurring review findings. New/expanded sections: - Error handling: ErrorWithSuggestion field completeness, telemetry service attribution, scope-agnostic messages, link/suggestion parity, stale data in polling loops - Architecture boundaries: pkg/project target-agnostic, extension docs separation, env var verification against source code - Output formatting: shell-safe quoted paths, consistent JSON types - Path safety: traversal validation, quoted paths in messages - Code organization: extract shared logic across scopes - Documentation standards: help text consistency, no dead references, PR description accuracy - Testing best practices: test YAML rules e2e, extract shared helpers, correct env vars (AZD_FORCE_TTY, NO_COLOR), TypeScript patterns, reasonable timeouts, cross-platform paths, test new JSON fields - CI / GitHub Actions: permissions blocks, PATH handling, cross-workflow artifacts, prefer ADO for secrets, no placeholder steps Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…o patterns (#7320) * Fix Copilot instructions for code review and strengthen guidance on Go patterns * Update wording
e2ae42c to
c1e215e
Compare
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Summary
Adds lessons learned from team and Copilot code reviews to
AGENTS.md(agent instructions) to prevent recurring review findings in future PRs.Feedback Sources
Analyzed code-level review comments across 8 recent PRs from team reviewers (
vhvb1989,weikanglim,JeffreyCA,jongio,wbreza,danieljurek) and GitHub Copilot code review:pkg/projectis target-agnostic), link parityNew/Expanded Sections (+48 lines)
ErrorWithSuggestionmust populate all fields; only seterror.service.namefor external service errors; scope-agnostic messages; match links to suggestion text; refresh stale data in polling loopspkg/project/is target-agnostic (no Container Apps logic); extension docs stay in extension dirs; verify env var parsing against source code../.traversal; quote paths in user messagesAZD_FORCE_TTY=falsenotAZD_DEBUG_FORCE_NO_TTY;NO_COLOR=1in tests;catch (e: unknown)notany; reasonable timeouts; cross-platform paths; test new JSON fields; no unused depspermissions:; don't overwrite PATH viaenv.PATH; cross-workflow artifact needsrun-id; prefer ADO for secrets; no placeholder steps