Instruction file imported from Azure/azure-sdk-for-js (
.github/instructions/reviewer/mgmt-sdk.instructions.md). Copyright stays with the author.
Management SDK Review β ARM Package Patterns
Scope: Public API + tool validation for @azure/arm-* packages. Review src/, review/*.api.md, README, CHANGELOG, samples, snippets.spec.ts. Skip implementation internals, private methods. Only flag issues introduced by this PR.
ARM packages are auto-generated from TypeSpec or Swagger. Review focuses on public API surface and rule-based validations.
Version Consistency (Tool Validation)
Package version must align across:
package.jsonβ source of truthsrc/api/*Context.ts(e.g.,managedOpsContext.ts) β discover the appropriate*Context.tsfile firstCHANGELOG.mdtop heading
Cross-check code references in README, snippets.spec.ts, and public API. Inconsistent versions β critical tool issue.
Version rules:
- First package version must be preview (regardless of API versions)
- Preview API versions can only ship in preview package versions
- No alpha versions anywhere (
CHANGELOG.md, context files,package.json) - First CHANGELOG entry is hard-coded template β ignore content, only check version matches
Breaking Changes
Breaking changes are acceptable in mgmt SDKs with proper CHANGELOG documentation.
Root-cause analysis: Trace breaking changes to their source:
- API version change in spec β expected, document in changelog
- TypeSpec migration artifact β may be approved pattern, check with architects
- Emitter/tooling bug β report to typespec-azure
- Do NOT flag cosmetic changes:
XxxOptionalParamsβXxxOptions, response wrapper removal
Changelog alignment: Public API changes in review/*.api.md must be documented:
- New exports β Features Added
- Removed/renamed exports β Breaking Changes with migration guidance
| Case | Action |
|---|---|
| Client name changed | β Not allowed. Use @clientName decorator in TypeSpec spec repo |
Stable versions removed from KnownVersions |
β Not allowed (preview versions may be removed) |
subscriptionId or similar constructor params removed |
β οΈ Flag, discuss migration path on spec side |
| Last major release <6 months ago | β οΈ Flag frequent breakage, discuss justification |
| Method parameters re-ordered | β Restore original order. Use @override decorator in TypeSpec |
Naming Validation (Spec Issues)
Flag patterns indicating spec problems:
_Nsuffixes (e.g.,Resource_1) β duplicated models, use@clientNameAutoGeneratedsuffixes β duplicated Swagger models, merge in spec_prefixes on enums β use@clientNamefor better name
Type Safety
- Avoid
unknownin return types - Avoid
unknownin public models (exception:ErrorAdditionalInfo) - No
voidreturn for create/update/get/list operations (voidacceptable for delete/upgrade/reset actions) anyis acceptable in mgmt SDKs β do NOT flagundocumentedtags on public API are acceptable β do NOT flag
Exports
- New symbols in
src/index.tsmust appear inreview/{package-name}-node.api.md ae-forgotten-exportwarnings indicate missing exports β usually generation tool bug- Avoid exports clashing with web/DOM types (
Request,Response,Event)
Samples & Tests
- Samples are auto-generated β only comment on syntax issues found while checking
src/references - Do NOT comment on placeholder values in samples (e.g.,
subscriptionId,resourceGroupName) β these are intentionally non-real values - Do NOT comment on style, formatting, documentation, or whitespace
- Do NOT comment on implementation internals (private methods, internal helpers)
Generated Infrastructure Files
- Do NOT comment on
eslint.config.mjs,warp.config.yml,tsconfig.json, orvitest.config.tspatterns β these are set by the generation tool and intentionally differ from hand-written packages - Config deviations from other packages are expected when generation tooling evolves
Comment Deduplication
- If an issue repeats across multiple files (e.g., same placeholder format in every sample), comment ONCE on the first file and note the total count of affected files
- Do NOT post the same comment on every file that has the same issue
Issue Types
π΄ Tool Issue: Generation bug β fix + report to typespec-azure
π΄ Design Issue: API problem β @clientName/@override in spec repo
π΅ Suggestion: Optional improvement