Skip to content

[PS] Migrate LabServices module to autorest v4#27877

Merged
YanaXu merged 14 commits into
mainfrom
joyer/labservices-migrate-v4
Jul 11, 2025
Merged

[PS] Migrate LabServices module to autorest v4#27877
YanaXu merged 14 commits into
mainfrom
joyer/labservices-migrate-v4

Conversation

@JoyerJin
Copy link
Copy Markdown
Contributor

@JoyerJin JoyerJin commented May 30, 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

Copilot AI review requested due to automatic review settings May 30, 2025 10:24
@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.

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 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 of Api20211001Preview 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

Comment thread src/LabServices/LabServices.Autorest/UX/Microsoft.LabServices/labs.json Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 3, 2025

‼️ DO NOT MERGE THIS PR ‼️
This PR was labeled "Do Not Merge" because it contains code change that cannot be merged. Please contact the reviewer for more information.

Comment thread src/LabServices/LabServices.Autorest/UX/Microsoft.LabServices/labs.json Outdated
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 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 versioned Api20211001Preview 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 new AssemblyInfo.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 name Get-AzLabServicesSchedule_ResourceId.ps1. Rename the function to Get-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

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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@Azure Azure deleted a comment from Copilot AI Jun 14, 2025
Copy link
Copy Markdown
Contributor

@vidai-msft vidai-msft left a comment

Choose a reason for hiding this comment

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

A few parameters like Lab, LabPlan, Schedule, User, VM and etc are missing descriptions. Please confirm if this is expected.

Comment thread src/LabServices/LabServices.Autorest/docs/Add-AzLabServicesUserQuota.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Get-AzLabServicesLab.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Get-AzLabServicesSchedule.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Get-AzLabServicesTemplateVM.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Remove-AzLabServicesLabPlan.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Remove-AzLabServicesSchedule.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Reset-AzLabServicesVMPassword.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Get-AzLabServicesUser.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Get-AzLabServicesVM.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Publish-AzLabServicesLab.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Remove-AzLabServicesLab.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Sync-AzLabServicesLabUser.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Update-AzLabServicesPlanImage.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Update-AzLabServicesSchedule.md Outdated
Comment thread src/LabServices/LabServices.Autorest/docs/Update-AzLabServicesVMReimage.md Outdated
Comment thread src/LabServices/LabServices.Autorest/README.md
@YanaXu
Copy link
Copy Markdown
Contributor

YanaXu commented Jul 10, 2025

Please check the CI results and remove the secrets.

@YanaXu YanaXu closed this Jul 10, 2025
@YanaXu YanaXu merged commit 603ee4f into main Jul 11, 2025
12 checks passed
@YanaXu YanaXu deleted the joyer/labservices-migrate-v4 branch July 11, 2025 07:47
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.

5 participants