-
Notifications
You must be signed in to change notification settings - Fork 4k
[PS] Migrate LabServices module to autorest v4 #27877
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
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.
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 LabServices PowerShell module to AutoRest v4 by updating model namespaces, unifying command implementations, and refreshing generation directives and assembly metadata.
- Updated cmdlet scripts to use the new
Microsoft.Azure.PowerShell.Cmdlets.LabServices.Models
types instead ofApi20211001Preview
variants. - Adjusted internal invocations in list commands to point at private helper functions.
- Refreshed UX JSON descriptions, updated autorest directives, and added an
AssemblyInfo.cs
for module metadata.
Reviewed Changes
Copilot reviewed 142 out of 142 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
src/LabServices/.../custom/*.ps1 | Swapped out Api20211001Preview model types for Models.* ; updated OutputType and parameter type references. |
src/LabServices/.../Get-AzLabServicesLab_ListBySubscription.ps1 | Changed internal call from internal\Get-AzLabServicesLab to private\Get-AzLabServicesLab_List . |
src/LabServices/.../Get-AzLabServicesLab_ListByResourceGroup.ps1 | Changed internal call to private\Get-AzLabServicesLab_List1 . |
src/LabServices/.../UX/Microsoft.LabServices/labs.json | Revised the “Publish-AzLabServicesLab” description text. |
src/LabServices/.../README.md | Updated AutoRest directives for deprecation, password handling, and command variants. |
src/LabServices/.../AssemblyInfo.cs | Added assembly metadata file with version and licensing. |
Comments suppressed due to low confidence (2)
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_ListBySubscription.ps1:86
- [nitpick] The helper function name
Get-AzLabServicesLab_List
is too generic and may confuse readers. Consider renaming it to reflect the context (e.g.,Get-AzLabServicesLab_ListBySubscriptionPrivate
) for clarity.
return Az.LabServices.private\Get-AzLabServicesLab_List @PSBoundParameters
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_ListByResourceGroup.ps1:90
- [nitpick] The numeric suffix in
Get-AzLabServicesLab_List1
is unclear. A more descriptive name matching the cmdlet (e.g.,Get-AzLabServicesLab_ListByResourceGroupPrivate
) would improve maintainability.
return Az.LabServices.private\Get-AzLabServicesLab_List1 @PSBoundParameters
.Link | ||
https://learn.microsoft.com/powershell/module/az.labservices/add-azlabservicesuserquota | ||
#> | ||
function Add-AzLabServicesUserQuota_Email { | ||
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LabServices.Models.Api20211001Preview.IUser])] | ||
[OutputType([Microsoft.Azure.PowerShell.Cmdlets.LabServices.Models.IUser])] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove the trailing whitespace after the OutputType
attribute to adhere to formatting standards and avoid diff noise.
Copilot uses AI. Check for mistakes.
src/LabServices/LabServices.Autorest/UX/Microsoft.LabServices/labs.json
Outdated
Show resolved
Hide resolved
|
src/LabServices/LabServices.Autorest/UX/Microsoft.LabServices/labs.json
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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 LabServices PowerShell module to use AutoRest v4 schemas and updated codegen artifacts.
- Updated all cmdlet scripts to reference the general
Microsoft.Azure.PowerShell.Cmdlets.LabServices.Models.*
interfaces instead of the versionedApi20211001Preview
types - Swapped internal invocation namespace to
Az.LabServices.private
and adjusted private helper names in list cmdlets - Refreshed Autorest directives in
README.md
and added a newAssemblyInfo.cs
with metadata
Reviewed Changes
Copilot reviewed 141 out of 141 changed files in this pull request and generated no comments.
Show a summary per file
File | Description |
---|---|
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesUserVM_Get.ps1 | Updated .Outputs and OutputType to use Models.IVirtualMachine |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesTemplateVM_Lab.ps1 | Updated .Outputs and OutputType to use Models.IVirtualMachine and reference Models.Lab |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesTemplateVM_Get.ps1 | Updated .Outputs and OutputType to use Models.IVirtualMachine |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesSchedule_ResourceId.ps1 | Updated .Outputs and OutputType to use Models.ISchedule |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesSchedule_Lab.ps1 | Updated .Outputs and OutputType to use Models.ISchedule and reference Models.Lab |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesPlanImage_ResourceId.ps1 | Updated .Outputs and OutputType to use Models.IImage |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesPlanImage_ListByDisplayName.ps1 | Updated .Outputs and OutputType to use Models.IImage |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesPlanImage_LabPlan.ps1 | Updated .Outputs and OutputType to use Models.IImage and reference Models.LabPlan |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLabforVM.ps1 | Updated .Outputs and OutputType to use Models.ILab |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_ResourceId.ps1 | Updated .Outputs and OutputType to use Models.ILab |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_ListBySubscription.ps1 | Updated .Outputs, OutputType, and switched to Az.LabServices.private\Get-AzLabServicesLab_List |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_ListByResourceGroup.ps1 | Updated .Outputs, OutputType, and switched to Az.LabServices.private\Get-AzLabServicesLab_List1 |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_ListByLabName.ps1 | Updated .Outputs and OutputType to use Models.ILab |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_LabPlan.ps1 | Updated .Outputs and OutputType to use Models.ILab and reference Models.LabPlan |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLabPlan_ResourceId.ps1 | Updated .Outputs and OutputType to use Models.ILabPlan |
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLabPlan_ListByLabPlanName.ps1 | Updated .Outputs and OutputType to use Models.ILabPlan |
src/LabServices/LabServices.Autorest/custom/Add-AzLabServicesUserQuota_User.ps1 | Updated .Outputs and OutputType to use Models.IUser and reference Models.User |
src/LabServices/LabServices.Autorest/custom/Add-AzLabServicesUserQuota_Email.ps1 | Updated .Outputs and OutputType to use Models.IUser |
src/LabServices/LabServices.Autorest/README.md | Refreshed Autorest v4 directives, deprecation notices, transforms, and removed old extension block |
src/LabServices/LabServices.Autorest/Properties/AssemblyInfo.cs | Added new AssemblyInfo with license header and assembly metadata |
Comments suppressed due to low confidence (2)
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesSchedule_ResourceId.ps1:26
- The function name
Get-AzLabServicesSchedule_LabObject
does not match the file nameGet-AzLabServicesSchedule_ResourceId.ps1
. Rename the function toGet-AzLabServicesSchedule_ResourceId
for consistency.
function Get-AzLabServicesSchedule_LabObject {
src/LabServices/LabServices.Autorest/custom/Get-AzLabServicesLab_ListByResourceGroup.ps1:90
- The helper invocation references
Get-AzLabServicesLab_List1
, which is an unexpected suffix. Verify and correct the function name (e.g.,Get-AzLabServicesLab_ListByResourceGroup
or a consistent private helper) to prevent runtime errors.
return Az.LabServices.private\Get-AzLabServicesLab_List1 @PSBoundParameters
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.
Description
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.md
and reviewed the following information:ChangeLog.md
file(s) appropriatelysrc/{{SERVICE}}/{{SERVICE}}/ChangeLog.md
.## Upcoming Release
header in the past tense.ChangeLog.md
if no new release is required, such as fixing test case only.