Skip to content

[PS] Migrate SecurityInsights module to autorest v4#28447

Open
JoyerJin wants to merge 33 commits into
mainfrom
joyer/SecurityInsights-migrate-v4
Open

[PS] Migrate SecurityInsights module to autorest v4#28447
JoyerJin wants to merge 33 commits into
mainfrom
joyer/SecurityInsights-migrate-v4

Conversation

@JoyerJin
Copy link
Copy Markdown
Contributor

@JoyerJin JoyerJin commented Aug 25, 2025

Description

Preannouncement PR:

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
Copy Markdown

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

@JoyerJin JoyerJin marked this pull request as ready for review August 26, 2025 07:24
Copilot AI review requested due to automatic review settings August 26, 2025 07:24
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.

Pull Request Overview

This PR migrates the SecurityInsights module from AutoRest v3 to v4, updating API models and cmdlet structure. The migration involves significant changes to parameter types, output types, and method signatures to align with the newer AutoRest framework.

Key Changes

  • Type simplification from strongly-typed enums to string parameters for improved flexibility
  • Output type namespace updates from versioned API models to unversioned ones
  • Addition of new parameter sets and JSON-based input methods for cmdlets

Reviewed Changes

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

File Description
tools/StaticAnalysis/Exceptions/Az.SecurityInsights/BreakingChangeIssues.csv Documents expected breaking changes from the AutoRest v4 migration
Multiple help markdown files Updated parameter types, output types, and documentation to reflect API changes

Comment thread src/SecurityInsights/SecurityInsights/help/New-AzSentinelAlertRule.md Outdated
Comment thread src/SecurityInsights/SecurityInsights/help/New-AzSentinelIncidentTeam.md Outdated
@VeryEarly VeryEarly added the Contains Breaking Change This PR contains breaking change label Sep 2, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 2, 2025

To the author of the pull request,
This PR was labeled "Breaking Change Release" because it contains breaking changes.

  • 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.

@isra-fel isra-fel added the autorest v4 migration pr migrating module from generated by autorest.powershell v3 to v4 label Oct 2, 2025
@Pan-Qi Pan-Qi marked this pull request as draft January 8, 2026 07:19
@Pan-Qi Pan-Qi marked this pull request as ready for review January 9, 2026 05:13
Copilot AI review requested due to automatic review settings January 9, 2026 05:13
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.

Pull request overview

Copilot reviewed 152 out of 153 changed files in this pull request and generated no new comments.

@isra-fel isra-fel added this to the Az 16.0.0 (TBD) milestone Jan 28, 2026
@isra-fel
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings March 16, 2026 05:35
@NoriZC
Copy link
Copy Markdown
Contributor

NoriZC commented Mar 16, 2026

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

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.

Pull request overview

Copilot reviewed 152 out of 153 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

src/SecurityInsights/SecurityInsights.Autorest/test/Update-AzSentinelOnboardingState.Tests.ps1:24

  • Both test cases are marked -skip and contain only a NotImplementedException placeholder, so there is currently no automated coverage for Update-AzSentinelOnboardingState despite the cmdlet being introduced/updated in this PR.

Suggested fix: replace these placeholders with real tests (record/playback or mocking) that execute the cmdlet for the supported parameter sets, and remove -skip once they pass reliably.

Comment on lines +59 to 60
[Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.PSArgumentCompleterAttribute("Activity","Expansion")]
[Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Category('Body')]
@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines successfully started running 3 pipeline(s).

Copilot AI review requested due to automatic review settings April 8, 2026 02:49
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.

Pull request overview

Copilot reviewed 120 out of 232 changed files in this pull request and generated 1 comment.

Comment on lines +18 to 26
# The incidents/relations endpoint returns 409 when updating an existing relation's target.

It 'UpdateExpanded' {
$bookmark = New-AzSentinelBookmark -ResourceGroupName $env.resourceGroupName `
-Id $env.UpdateincidentRelationBookmarkId2 -WorkspaceName $env.workspaceName -DisplayName $env.UpdateincidentRelationBookmarkName2 -Query "SecurityEvent\n| take 1" `
-QueryStartTime (get-date).ToUniversalTime() -QueryEndTime (get-date).AddDays(-1).ToUniversalTime() -EventTime (get-date).ToUniversalTime()
$incidentRelation = Update-AzSentinelIncidentRelation -ResourceGroupName $env.resourceGroupName -WorkspaceName $env.workspaceName `
-IncidentId $env.UpdateincidentRelationIncidentId -RelationName $env.UpdateincidentRelationId -RelatedResourceId $bookmark.Id
$incidentRelation.RelatedResourceId | should -be $bookmark.id
{ Update-AzSentinelIncidentRelation -ResourceGroupName $env.resourceGroupName -WorkspaceName $env.workspaceName `
-IncidentId $env.UpdateincidentRelationIncidentId -RelationName $env.UpdateincidentRelationId -RelatedResourceId $bookmark.Id } | Should -Throw "already exists on incident"
}
Copy link

Copilot AI Apr 8, 2026

Choose a reason for hiding this comment

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

The test now asserts Should -Throw "already exists on incident", which couples the test to an exact/partial error message that can change with service wording, localization, or SDK error formatting. Prefer asserting on a stable signal (e.g., HTTP status code 409, an error code, or exception type) while still documenting the expected conflict behavior in the comment.

Copilot uses AI. Check for mistakes.
@VeryEarly
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown
Contributor

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

lijinpei2008 and others added 4 commits April 28, 2026 16:53
…3->v4 (#28572)

Co-authored-by: JunKai-v <v-juphang@microsoft.com>
…shell v3->v4 (#28376)

Co-authored-by: JunKai-v <v-juphang@microsoft.com>
Co-authored-by: Azure PowerShell <65331932+azure-powershell-bot@users.noreply.github.com>
Co-authored-by: Thomas Temby <thomastemby@microsoft.com>
Co-authored-by: Audrey Toney <audreytoney@microsoft.com>
Co-authored-by: Meghana Gupta <93553451+meghanagupta95@users.noreply.github.com>
Co-authored-by: Yeming Liu <11371776+isra-fel@users.noreply.github.com>
Co-authored-by: Yeming Liu <yeliu@microsoft.com>
Co-authored-by: JunKai-v <v-juphang@microsoft.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Yabo Hu <yabhu@microsoft.com>
Co-authored-by: Sam Lee <32776898+minhsuanlee@users.noreply.github.com>
Co-authored-by: Sam Lee <samlee3@microsoft.com>
Co-authored-by: Ptnan7 <148527582+Ptnan7@users.noreply.github.com>
Co-authored-by: JingnanXu <jingnanxu@microsoft.com>
Co-authored-by: Matthew Metcalf <mrm9084@gmail.com>
Co-authored-by: DevanshG1 <108400981+DevanshG1@users.noreply.github.com>
Co-authored-by: Devansh Goswami <degoswami@microsoft.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Jeffrey Bulanadi <41933086+jeffreybulanadi@users.noreply.github.com>
Co-authored-by: Bhaskar Brahma <bhbrahma@microsoft.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: audreyttt <225061541+audreyttt@users.noreply.github.com>
Co-authored-by: Auðunn <audunnb@gmail.com>
Co-authored-by: Komla-Ansah <selasiekmortey@gmail.com>
Co-authored-by: Selasie Mortey <smortey@microsoft.com>
Co-authored-by: MaddyMicrosoft <maddisondas@microsoft.com>
Co-authored-by: jruttle <jruttle+github@microsoft.com>
Co-authored-by: Jonathan Ruttle <jruttle@microsoft.com>
Co-authored-by: Balashivaram Ganesan <71939272+Balashivaram@users.noreply.github.com>
Co-authored-by: Balashivaram Ganesan <bganesan@microsoft.com>
Co-authored-by: JiaSeng-v <v-jiasenglaw@microsoft.com>
Co-authored-by: JaysonTaiMicrosoft <jaysontai@microsoft.com>
@khang-11 khang-11 changed the base branch from main to autorest-v4-breakingchange May 6, 2026 00:51
@khang-11 khang-11 changed the base branch from autorest-v4-breakingchange to main May 12, 2026 03:47
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 Contains Breaking Change This PR contains breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.