Skip to content

[AutoPR @azure-arm-previewalertrule]-generated-from-SDK Generation - JS-6026291#37710

Closed
azure-sdk wants to merge 1 commit into
mainfrom
sdkauto/@azure-arm-previewalertrule-6026291
Closed

[AutoPR @azure-arm-previewalertrule]-generated-from-SDK Generation - JS-6026291#37710
azure-sdk wants to merge 1 commit into
mainfrom
sdkauto/@azure-arm-previewalertrule-6026291

Conversation

@azure-sdk
Copy link
Copy Markdown
Collaborator

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

…osoft.AlertsManagement/PreviewAlertRule/tspconfig.yaml', API Version: 2025-07-01-preview, SDK Release Type: beta, and CommitSHA: 'e5b00c3c8ccc7ade30c0e347f7e655c4447a72e7' in SpecRepo: 'https://github.com/Azure/azure-rest-api-specs' Pipeline run: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=6026291 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 18, 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-previewalertrule

Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review for @azure/arm-previewalertrule (PR #37710)

CI is fully passing ✅. This is the initial 1.0.0-beta.1 release for the 2025-07-01-preview API, and versions are consistent across package.json, CHANGELOG.md, and previewAlertRuleManagementContext.ts. One design concern was found in the public API surface: the KnownAlertSeverity enum exposes member names with leading underscores (_0_4) due to the generator's inability to produce identifiers starting with digits. A spec-side @clientName fix is needed.

📊 Structured Report
{"agent":"mgmt-reviewer","pr":37710,"summary":"issues_found","findings":[{"file":"sdk/previewalertrule/arm-previewalertrule/review/arm-previewalertrule-node.api.md","line":84,"issueType":"design","category":"naming","description":"KnownAlertSeverity enum members have leading underscore prefixes (_0, _1, _2, _3, _4) because TypeScript identifiers cannot start with digits. Fix by adding `@clientName` decorators in the TypeSpec spec to give human-readable names (e.g. Sev0–Sev4), then regenerate the SDK."}]}

Benchmarked by Management SDK PR Review

export type Kind = string;

// @public
export enum KnownAlertSeverity {
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 ConcernKnownAlertSeverity enum member names have _ prefixes

export enum KnownAlertSeverity {
    _0 = 0,
    _1 = 1,
    _2 = 2,
    _3 = 3,
    _4 = 4
}

TypeScript identifiers cannot begin with a digit, so the generator automatically prefixes numeric severity values with _. Per the [naming validation guidelines]((azure.github.io/redacted), enum member names with _ prefixes should be avoided — they produce a confusing public API (e.g. KnownAlertSeverity._0).

Fix: In the TypeSpec spec, use @clientName to give each enum member a human-readable name (e.g. Sev0, Sev1, Sev2, Sev3, Sev4), then trigger SDK regeneration. No changes should be made to the generated code directly.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants