Skip to content

Generate Generic Breaking Change Attribute#1508

Merged
VeryEarly merged 2 commits into
mainfrom
isra-fel/generic-breaking-change
Aug 26, 2025
Merged

Generate Generic Breaking Change Attribute#1508
VeryEarly merged 2 commits into
mainfrom
isra-fel/generic-breaking-change

Conversation

@isra-fel

@isra-fel isra-fel commented Aug 25, 2025

Copy link
Copy Markdown
Member

This pull request refactors how breaking change attributes are added to PowerShell cmdlet classes.
It removes the extra sentence "The cmdlet is being deprecated. There will be no replacement for it." by generating different type of breaking change attribute. From CmdletBreakingChangeAttribute to GenericBreakingChangeAttribute.
That sentence can be misleading in many scenarios. See #1487 Azure/azure-powershell#28134

Test

Old:

image

New:

image

Bug Fix

  • Fixed a typo in the ClientRuntime mapping by renaming GeneraricBreakingChangeAttribute to GenericBreakingChangeAttribute.

@isra-fel
isra-fel requested a review from VeryEarly August 25, 2025 16:17
autorest.powershell\powershell\cmdlets\class.ts
  2313:25  error  Strings must use singlequote  quotes
throw new Error('Cmdlet breaking change requires both \'deprecateByVersion\' and \'deprecateByAzVersion\', please refer to https://github.com/Azure/azure-powershell/blob/main/documentation/development-docs/breakingchange-for-autogen-module.md for more details.');
}

if (!breakingChange.cmdlet.replacement && breakingChange.cmdlet.changeDescription) {

@isra-fel isra-fel Aug 26, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

The core logic of this PR is this if-else. In the case when user preannounces a breaking change with changeDescription, we should prioritize showing it instead of the hardcoded "The cmdlet is being deprecated without replacement".

On the other hand, GenericBreakingChangeAttribute is a more fitting type than CmdletBreakingChangeAttribute in this case.

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.

2 participants