Skip to content

[Python] TypeSpec migration for azure-mgmt-security#46465

Draft
ChenxiJiang333 wants to merge 15 commits intoAzure:mainfrom
ChenxiJiang333:sdk-azure-mgmt-security
Draft

[Python] TypeSpec migration for azure-mgmt-security#46465
ChenxiJiang333 wants to merge 15 commits intoAzure:mainfrom
ChenxiJiang333:sdk-azure-mgmt-security

Conversation

@ChenxiJiang333
Copy link
Copy Markdown
Member

[Python] TypeSpec migration for azure-mgmt-security

Spec PR: Azure/azure-rest-api-specs#41888

Pre-migration swagger source: specification/security/resource-manager@5edf687e

Default tag package-composite-v3 contains multiple API versions: 2015-06-01-preview / 2017-08-01 / 2017-08-01-preview / 2019-01-01 / 2019-01-01-preview / 2019-08-01 / 2020-01-01 / 2021-05-01-preview / 2021-10-01-preview / 2022-01-01 / 2022-01-01-preview / 2022-05-01 / 2022-07-01-preview / 2023-01-01-preview / 2023-02-15-preview / 2023-05-01 / 2023-05-01-preview / 2023-11-15 / 2023-12-01-preview / 2024-08-01 / 2024-08-01-preview / 2025-05-04 / 2025-09-01-preview / 2025-10-01-preview / 2025-11-01-preview / 2026-01-01 / 2026-04-01-preview

Breaking Change Analysis Summary

  • Total breaking change items: 483
  • Mitigated: 6 (via @@clientName decorators in spec PR)
  • Accepted: 477 (expected TypeSpec migration changes)

Spec Mitigation PR

welovej/azure-rest-api-specs#15

Mitigated Breaking Changes (6 items)

Breaking Change Mitigation
Client renamed SecurityCenterSecurityManagementClient @@clientName to restore SecurityCenter
Enum AadConnectivityStateEnumAadConnectivityState @@clientName to restore AadConnectivityStateEnum
Enum ExternalSecuritySolutionKindEnumExternalSecuritySolutionKind @@clientName to restore ExternalSecuritySolutionKindEnum
Enum ProtocolEnumProtocol @@clientName to restore ProtocolEnum
Enum KindEnumKind @@clientName to restore KindEnum
Enum Status collides with model Status @@clientName to rename to StatusEnum

Accepted Breaking Changes (by category)

Category Count Examples
Pageable models removed (*List) ~40 AlertList, PricingList, SecurityConnectorsList
Common/error types removed ~40 CloudErrorAutoGenerated*, ErrorDetailAutoGenerated*
Unreferenced models removed ~60 OnPremiseResourceDetails, Software, Code, Location
Flattened properties removed ~100 Pricing.pricing_tier, IoTSecuritySolutionModel.workspace
List methods async→sync 4 MdeOnboardingsOperations.list, SecurityOperatorsOperations.list
Enum string method noise ~97 OperationResult.capitalize (code report artifact)
OperationResult enum→model 3 Structural change: now OperationResultStatus enum
__init__ methods removed 3 AadConnectivityState.__init__, Kind.__init__
IoT threshold subtypes removed ~30 ActiveConnectionsNotInAllowedRange, AmqpC2DMessagesNotInAllowedRange

Python Codegen Bug

⚠️ The Python emitter (@typespec/http-client-python@0.28.3) has a bug causing ValueError: We have already generated a schema with name createOrUpdateRequest. Root cause: LRO operations with @@override generate duplicate body model instances with the same name. A local pygen patch was applied to work around this. This should be tracked at https://github.com/microsoft/typespec/issues.

Additional collisions found: ArcAutoProvisioningGcp (2x), VmScannersGcp (2x) from discriminated subtypes, and Status model/enum name collision.

@ChenxiJiang333 ChenxiJiang333 force-pushed the sdk-azure-mgmt-security branch 4 times, most recently from 5872835 to 4539356 Compare April 24, 2026 05:15
@ChenxiJiang333 ChenxiJiang333 force-pushed the sdk-azure-mgmt-security branch from 4539356 to d0eb7b5 Compare April 24, 2026 05:45
@GalGoldi72 GalGoldi72 marked this pull request as ready for review May 5, 2026 09:23
@GalGoldi72 GalGoldi72 requested a review from msyyc as a code owner May 5, 2026 09:23
Copilot AI review requested due to automatic review settings May 5, 2026 09:23
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

@GalGoldi72
Copy link
Copy Markdown

Hi @msyyc @ChenxiJiang333 — this PR was just marked as ready for review. Could you provide an ETA for when this can be reviewed and merged? The Microsoft.Security service team is waiting on this SDK release.

We understand there are CI failures related to a Python emitter bug (duplicate schema names from LRO + @@OverRide). Is there a timeline for the upstream fix, or is there a workaround we can help with?

cc @welovej

@ChenxiJiang333 ChenxiJiang333 marked this pull request as draft May 6, 2026 02:30
@ChenxiJiang333
Copy link
Copy Markdown
Member Author

Hi @msyyc @ChenxiJiang333 — this PR was just marked as ready for review. Could you provide an ETA for when this can be reviewed and merged? The Microsoft.Security service team is waiting on this SDK release.

We understand there are CI failures related to a Python emitter bug (duplicate schema names from LRO + @@OverRide). Is there a timeline for the upstream fix, or is there a workaround we can help with?

cc @welovej

Sorry, this pr is only for debug. Please let security service team follow https://eng.ms/docs/products/azure-developer-experience/plan/release-plan-create to create a release plan for sdk release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants