Skip to content

[AutoPR @azure-arm-subscriptions]-generated-from-SDK Generation - JS-6054106#37800

Closed
azure-sdk wants to merge 1 commit into
mainfrom
sdkauto/@azure-arm-subscriptions-6054106
Closed

[AutoPR @azure-arm-subscriptions]-generated-from-SDK Generation - JS-6054106#37800
azure-sdk wants to merge 1 commit into
mainfrom
sdkauto/@azure-arm-subscriptions-6054106

Conversation

@azure-sdk

Copy link
Copy Markdown
Collaborator

Configurations: 'specification/subscription/resource-manager/Microsoft.Subscription/Subscription/tspconfig.yaml', API Version: 2025-11-01-preview, SDK Release Type: beta, and CommitSHA: '431a0488ba8f92835169ffd9d9cc352f6ae568be' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6054106 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.

…t.Subscription/Subscription/tspconfig.yaml', API Version: 2025-11-01-preview, SDK Release Type: beta, and CommitSHA: '431a0488ba8f92835169ffd9d9cc352f6ae568be' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6054106 Refer to https://eng.ms/docs/products/azure-developer-experience/develop/sdk-release/sdk-release-prerequisites to prepare for SDK release.
@github-actions github-actions Bot added the Mgmt This issue is related to a management-plane library. label Mar 24, 2026
@github-actions

Copy link
Copy Markdown
Contributor

API Change Check

APIView identified API level changes in this PR and created the following API reviews

@azure/arm-subscriptions

@github-actions github-actions Bot 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.

3 issues found in @azure/arm-subscriptions 7.0.0-beta.1: 1 tool issue (autoPublish: false in package.json) and 2 API design issues (AzureClouds enum members use UPPER_SNAKE_CASE instead of PascalCase; AzureSupportedClouds is a closed template literal type instead of string). No naming collisions, alpha version references, or version mismatches detected. CI checks are currently in-progress.

📊 Structured Report
{"agent":"mgmt-reviewer","pr":37800,"summary":"issues_found","findings":[{"file":"sdk/subscription/arm-subscriptions/package.json","line":9,"issueType":"tool","category":"configuration","description":"autoPublish is false; should be true to enable automated publishing"},{"file":"sdk/subscription/arm-subscriptions/review/arm-subscriptions-node.api.md","line":76,"issueType":"design","category":"naming","description":"AzureClouds enum members use UPPER_SNAKE_CASE instead of PascalCase"},{"file":"sdk/subscription/arm-subscriptions/review/arm-subscriptions-node.api.md","line":83,"issueType":"design","category":"type-safety","description":"AzureSupportedClouds is a closed template literal type constrained to AzureClouds; should be string"}]}

Benchmarked by Management SDK PR Review

Comment on lines +76 to 82
export enum AzureClouds {
AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
}

// @public

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.

🔴 Design Issuearm-subscriptions-node.api.md:76-82

export enum AzureClouds {
    AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
    AZURE_PUBLIC_CLOUD = "AZURE_PUBLIC_CLOUD",
    AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
}

Enum members use UPPER_SNAKE_CASE instead of the required PascalCase naming convention for Azure SDK TypeScript enums.

Fix: Apply @clientName decorators in the TypeSpec spec to rename the members to PascalCase (e.g., AzureChinaCloud, AzurePublicCloud, AzureUsGovernment). This is a spec change in azure-rest-api-specs.

"@azure/core-rest-pipeline": "^1.19.1",
"tslib": "^2.8.1"
"sideEffects": false,
"autoPublish": false,

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.

🔴 Tool Issuepackage.json:9
"autoPublish": false

This package has autoPublish set to false, which disables automated publishing. Management SDK packages should have autoPublish: true unless there is a deliberate reason to hold the release.

Fix: Change "autoPublish": false to "autoPublish": true, or file an issue in the generation tool repository if this was generated incorrectly.


// @public
export type AliasListResponse = SubscriptionAliasListResult;
export type AzureSupportedClouds = `${AzureClouds}`;

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.

🔴 Design Issuearm-subscriptions-node.api.md:83

export type AzureSupportedClouds = `\$\{AzureClouds}`;

AzureSupportedClouds is defined as a closed template literal type constrained to AzureClouds enum values. This prevents callers from passing future or custom cloud strings without a breaking change. Per Azure SDK guidelines, extensible string union types should be string.

Fix: Change the type definition to export type AzureSupportedClouds = string; in the TypeSpec spec, or report this as a generation tool issue at autorest.typescript.

@JialinHuang803 JialinHuang803 added the refresh PR for SDK refresh label Apr 22, 2026
@JialinHuang803

Copy link
Copy Markdown
Member

Breaking Change Analysis: @azure/arm-subscriptions 7.0.0-beta.1

Old SDK (main) New SDK (PR)
Generator Swagger / AutoRest TypeSpec / emitter
API Version 2024-08-01-preview 2025-11-01-preview
Package Version 6.0.0 7.0.0-beta.1

Spec References:

Note: Despite the API version upgrade (2024-08-01-preview -> 2025-11-01-preview), none of the 6 breaking changes trace to swagger-level API differences. Layer A and Layer C swagger are structurally identical for all affected operations and models. All changes come from the emitter generating different TypeScript code.

Type 2: TypeSpec / Emitter Migration -- 6 items

Root Cause Sub-Type Count Accepted
Paging return type: Promise<ListResult> -> PagedAsyncIterableIterator<T> Emitter 1
resumeFrom removed from LRO options + response wrapper removed Emitter 1
AutoRest error wrapper type not generated by TypeSpec emitter Emitter 1
Collection wrapper type internalized by paging Emitter 1
ErrorResponse now uses correct ARM common type structure ({error: ErrorDetail} instead of flat {code, message}) Emitter 2

Details

  1. Operation Alias.list has a new signature -- Emitter ✅

    Return type changed from Promise<AliasListResponse> (collection wrapper) to PagedAsyncIterableIterator<SubscriptionAliasResponse>. Swagger is identical in both layers (both have x-ms-pageable), but AutoRest returned the list result directly while the emitter returns a paginated iterator. Matches pattern 5: Paging Interface Changes.

    Cascade checklist: Direct params -- no change. Options -- no change (empty interface). Cascade -- return type SubscriptionAliasResponse not in broken_models. Root cause is paging pattern change.

  2. Operation Subscription.beginAcceptOwnershipAndWait has a new signature -- Emitter ✅

    (1) resumeFrom removed from SubscriptionAcceptOwnershipOptionalParams (matches pattern 9: Core Client/Operation Options Changes). (2) Response wrapper SubscriptionAcceptOwnershipResponse (headers-only type with location/retryAfter) removed; return type changed to void (matches pattern 7: Response Wrapper Removal). Swagger is identical in both layers (POST, LRO, 202 with no schema body).

    Cascade checklist: Direct params -- no change. Options -- resumeFrom removed (breaking cause). Cascade -- return type and param types not in broken_models. Root causes are options change + response wrapper removal.

  3. Removed Interface ErrorResponseBody -- Emitter ✅

    AutoRest-generated error wrapper type ({code, error, message}) not present in either Layer A or Layer C swagger definitions. Not reachable from any operation signature. Matches pattern 2: Orphan Enum/Model Removal.

  4. Removed Interface GetTenantPolicyListResponse -- Emitter ✅

    Collection wrapper type ({value, nextLink}) present in both Layer A and Layer C swagger but internalized by TypeSpec paging emitter. Operations return PagedAsyncIterableIterator<GetTenantPolicyResponse> directly. Matches pattern 5: Paging Interface Changes.

  5. Interface ErrorResponse no longer has parameter code -- Emitter

    AutoRest generated flat ErrorResponse {code, message}. TypeSpec emitter generates correct ARM common type structure ErrorResponse {error: ErrorDetail}. Both swagger layers reference ARM common types ErrorResponse (v5 -> v6, but same structure). No exact match in approved patterns -- leaving for review.

  6. Interface ErrorResponse no longer has parameter message -- Emitter

    Same root cause as row 5.

Open Questions

  1. ErrorResponse structural change (rows 5-6): Both old swagger (Layer A) and new swagger (Layer C) reference ARM common types ErrorResponse (v5 and v6 respectively), which have the nested {error: ErrorDetail} structure. AutoRest generated a flat {code, message} representation that did not match the swagger definition. The TypeSpec emitter now generates the correct structure. This is clearly an emitter difference, but does not exactly match any numbered architect-approved pattern. The closest is Pattern 3 (Common Type Name Changes), but this is a structural correction rather than a name change. Recommend architect review.

Total: 0 (Type 1: API Version Upgrade) + 6 (Type 2: TypeSpec/Emitter Migration) = 6 breaking changes

Type 2 breakdown: 0 items from TypeSpec conversion, 6 items from emitter differences.

4 of 6 items match architect-approved patterns. 2 items (ErrorResponse structural change) need reviewer attention.

JialinHuang803 added a commit that referenced this pull request Apr 30, 2026
## What this PR does

Adds a new Copilot agent (\mgmt-breaking-change-analysis\) that analyzes
breaking changes in ARM management SDK PRs migrating from
Swagger/AutoRest to TypeSpec/emitter.

### Files

- **\.github/agents/mgmt-breaking-change-analysis.agent.md\** -- Agent
definition with mandatory execution protocol, phase skeleton, state
tracking, cascade detection checklist, pattern matching step, and
validation rules
- **\.github/prompts/mgmt-breaking-change-analysis-guidelines.md\** --
Detailed workflow instructions covering context gathering, CHANGELOG
extraction, root cause investigation (with cascade detection algorithm),
four-layer swagger comparison model, sub-agent delegation, and report
templates
- **\.github/prompts/mgmt-breaking-change-patterns.md\** -- Lookup table
of 10 architect-approved breaking change patterns for the HLC-to-Modular
migration (sourced from autorest.typescript issues)

### How it works

The agent follows a structured multi-phase workflow:

1. **Phase 1: Gather Context** -- Extract PR metadata, build per-service
API version map, locate four spec layers (old swagger, new swagger
pre-TypeSpec, TypeSpec-generated swagger, SDK api.md)
2. **Phase 2: Extract Breaking Changes** -- Parse CHANGELOG entries from
PR branch
3. **Phase 3: Root Cause Analysis** -- Investigate model-level changes
first, signature entries last; build broken_models set and type
dependency graph; detect cascading breakings through nested type
references
4. **Phase 4: Pattern Matching** -- Match Type 2 (migration-related)
root causes against architect-approved patterns to pre-fill the Accepted
column
5. **Phase 5: Self-Review Checklist** -- Review root cause depth and
cascade completeness
6. **Phase 5: Verification and Report** -- Verify all entries classified
(Type 1 + Type 2 = total), build structured report

### Key design decisions

- **Agent as control plane**: The agent file defines mandatory execution
steps and validation rules. The guidelines file serves as the knowledge
base with full procedural details. This separation ensures the agent
always follows the workflow.
- **Explicit state tracking**: The agent externalizes intermediate
results (broken_models, type_dependency_graph, classified_entries) after
each phase to maintain consistency across long analysis chains.
- **Cascade detection checklist**: Every 'new signature' entry requires
documenting 4 checks (direct params, options changes, cascade from
broken models, emitter differences) to prevent premature attribution.

### Scope

- ARM management SDK packages migrating from Swagger/AutoRest to
TypeSpec/emitter only
- Not applicable to data-plane SDKs, RLC packages, or hand-written SDKs

### Examples:
Subscriptions:
#37800 (comment)
Monitor:
#38213 (comment)

---------

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@v-jiaodi v-jiaodi closed this May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Mgmt This issue is related to a management-plane library. mgmt-review-needed refresh PR for SDK refresh

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants