Skip to content

Conversation

@JoyerJin
Copy link
Contributor

@JoyerJin JoyerJin commented Jul 10, 2025

Description

Mandatory Checklist

  • SHOULD update ChangeLog.md file(s) appropriately
    • Update src/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.
      • A snippet outlining the change(s) made in the PR should be written under the ## Upcoming Release header in the past tense.
    • Should not change ChangeLog.md if no new release is required, such as fixing test case only.
  • SHOULD regenerate markdown help files if there is cmdlet API change. Instruction
  • SHOULD have proper test coverage for changes in pull request.
  • SHOULD NOT adjust version of module manually in pull request

@azure-client-tools-bot-prd
Copy link

Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status.

@JoyerJin JoyerJin changed the title [PS] migrate DiagnosticSetting module to autorest v4 [PS] migrate DiagnosticSetting in Monitor module to autorest v4 Jul 17, 2025
@isra-fel isra-fel added the autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 label Oct 20, 2025
@JoyerJin JoyerJin marked this pull request as ready for review October 31, 2025 08:23
Copilot AI review requested due to automatic review settings October 31, 2025 08:23
Copy link
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.

Pull Request Overview

This pull request adds Update cmdlets for Azure Diagnostic Settings and addresses breaking changes in the DiagnosticSetting AutoRest module. The key changes include:

  • Added two new Update cmdlets: Update-AzDiagnosticSetting and Update-AzSubscriptionDiagnosticSetting
  • Updated AutoRest configuration to use newer version and simplified model type names
  • Regenerated module to fix breaking changes (property type changes in API models)
  • Added exception handling for known breaking changes
  • Updated tests to include Update cmdlet scenarios
  • Added comprehensive documentation for new cmdlets

Reviewed Changes

Copilot reviewed 48 out of 48 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
tools/StaticAnalysis/Exceptions/Az.Monitor/BreakingChangeIssues.csv Adds exceptions for known breaking changes in property types
src/Monitor/Monitor/help/*.md Updates help documentation for new Update cmdlets and fixes type references
src/Monitor/Monitor/Az.Monitor.psd1 Adds new Update cmdlets to exported functions
src/Monitor/Monitor.sln Updates project GUID for DiagnosticSetting.Autorest project
src/Monitor/DiagnosticSetting.Autorest/test/*.ps1 Adds tests for Update cmdlets and updates existing tests
src/Monitor/DiagnosticSetting.Autorest/docs/*.md Adds documentation for Update cmdlets
src/Monitor/DiagnosticSetting.Autorest/README.md Updates AutoRest configuration to use newer directives
src/Monitor/DiagnosticSetting.Autorest/custom/autogen-model-cmdlets/*.ps1 Updates model cmdlets with simplified type names

Update-AzSubscriptionDiagnosticSetting -Name settingname -WorkspaceId 'workspaceid' -Log $log
```

These command update diagnostic setting for current subscription.
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

Corrected grammar: 'command' should be 'commands' to match plural subject.

Suggested change
These command update diagnostic setting for current subscription.
These commands update diagnostic setting for current subscription.

Copilot uses AI. Check for mistakes.
}
function cleanupEnv() {
# Clean resources you create for testing
Remove-AzResourceGroup -Name $env.resourceGroupName
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

The cleanup function should handle cases where the resource group doesn't exist or deletion fails. Add error handling with -ErrorAction SilentlyContinue or wrap in try-catch to prevent test failures during cleanup.

Copilot uses AI. Check for mistakes.
directive:
# Following is two common directive which are normally required in all the RPs
# 1. Remove the unexpanded parameter set
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
Copy link

Copilot AI Oct 31, 2025

Choose a reason for hiding this comment

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

This complex regex directive lacks a comment explaining its purpose. Based on CodingGuidelineID 1000002, all directives should have comments explaining the 'why'. Add a comment such as: '# Keep only Expanded, JsonFilePath, and JsonString parameter sets for Create and Update operations, removing unexpanded variants and CreateViaIdentityExpanded'.

Suggested change
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
# 2. For New-* cmdlets, ViaIdentity is not required, so CreateViaIdentityExpanded is removed as well
# Keep only Expanded, JsonFilePath, and JsonString parameter sets for Create and Update operations,
# removing unexpanded variants and CreateViaIdentityExpanded to simplify the cmdlet surface and avoid unsupported scenarios.

Copilot uses AI. Check for mistakes.
@dolauli dolauli added Contains Breaking Change This PR contains breaking change Breaking change PR reviewed Add this label after a PR with breaking change has been reviewed and approved. labels Nov 10, 2025
@github-actions
Copy link

To the author of the pull request,
This PR was labeled "Contains Breaking Change" because breaking changes have been detected by the static analysis pipeline.

  • According to our policy, breaking changes can only take place during major release and they must be preannounced.
  • Please follow our guide on the detailed steps.
  • Required: Please fill in the task below to facilitate our contact,you will receive notifications related to breaking changes.

@VeryEarly VeryEarly changed the base branch from main to yabo/monitor November 10, 2025 07:41
@VeryEarly VeryEarly merged commit aaa6beb into yabo/monitor Nov 10, 2025
1 of 6 checks passed
Francisco-Gamino pushed a commit to Francisco-Gamino/azure-powershell that referenced this pull request Nov 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 Breaking change PR reviewed Add this label after a PR with breaking change has been reviewed and approved. Contains Breaking Change This PR contains breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants