[PS] Migrate SecurityInsights module to autorest v4#28447
Conversation
| Thanks for your contribution! The pull request validation has started. Please revisit this comment for updated status. |
There was a problem hiding this comment.
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 |
|
To the author of the pull request, |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
|
/azp run |
|
Azure Pipelines successfully started running 3 pipeline(s). |
There was a problem hiding this comment.
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
-skipand contain only aNotImplementedExceptionplaceholder, so there is currently no automated coverage forUpdate-AzSentinelOnboardingStatedespite 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.
| [Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.PSArgumentCompleterAttribute("Activity","Expansion")] | ||
| [Microsoft.Azure.PowerShell.Cmdlets.SecurityInsights.Category('Body')] |
|
Azure Pipelines successfully started running 3 pipeline(s). |
…m/Azure/azure-powershell into jiaseng/main/SecurityInsight-v4
| # 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" | ||
| } |
There was a problem hiding this comment.
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.
|
/azp run |
|
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. |
…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>
Co-authored-by: JiaSeng-v <v-jiasenglaw@microsoft.com>
Co-authored-by: JunKai-v <v-juphang@microsoft.com>
Co-authored-by: JunKai-v <v-juphang@microsoft.com> Co-authored-by: JiaSeng-v <v-jiasenglaw@microsoft.com>
Co-authored-by: JiaSeng-v <v-jiasenglaw@microsoft.com>
Co-authored-by: JiaSeng-v <v-jiasenglaw@microsoft.com>
Description
Preannouncement PR:
Mandatory Checklist
Please choose the target release of Azure PowerShell. (⚠️ Target release is a different concept from API readiness. Please click below links for details.)
Check this box to confirm: I have read the Submitting Changes section of
CONTRIBUTING.mdand reviewed the following information:ChangeLog.mdfile(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md.## Upcoming Releaseheader in the past tense.ChangeLog.mdif no new release is required, such as fixing test case only.