Migrate Devtestlabs to generate from TypeSpec#53452
Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR migrates the DevTestLabs SDK to generate from TypeSpec by updating the autorest configuration. The primary change is updating the OpenAPI specification reference to a newer commit and adding extensive swagger transformation directives to handle property definitions and parameter descriptions.
Key Changes:
- Updated the OpenAPI specification reference to a newer commit (471eab6)
- Removed an unused rename mapping for
WindowsOSState - Added multiple swagger transformation directives to remove
additionalPropertiesfrom various definitions and standardize parameter descriptions
sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/autorest.md.bak
Outdated
Show resolved
Hide resolved
…ndowsOSState name - Fix generator bug: parent detection now uses longest prefix match instead of first match, ensuring child resources are placed on the most specific parent (e.g., ServiceFabricSchedule on ServiceFabric instead of Lab) - Remove RP prefix from WindowsOSState in spec client.tsp - Regenerate with local generator to produce correct resource hierarchy - All ApiCompat errors resolved, build passes with 0 errors
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
b1c535f to
0bd353e
Compare
live1206
left a comment
There was a problem hiding this comment.
we should just remove autorest.md
sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/Generated/metadata.json
Outdated
Show resolved
Hide resolved
sdk/devtestlabs/Azure.ResourceManager.DevTestLabs/src/Customization/DevTestLabResource.cs
Outdated
Show resolved
Hide resolved
...testlabs/Azure.ResourceManager.DevTestLabs/src/Customization/DevTestLabVmScheduleResource.cs
Show resolved
Hide resolved
...testlabs/Azure.ResourceManager.DevTestLabs/src/Customization/DevTestLabScheduleCollection.cs
Show resolved
Hide resolved
ArcturusZhang
left a comment
There was a problem hiding this comment.
Mgmt SDK Review - DevTestLabs TypeSpec Migration
What Passes Review
- Version 1.2.0-beta.1 with ApiCompatVersion 1.1.1 no major version bump
- Zero API surface lines removed no breaking signature changes
- All existing type names preserved for backward compatibility
- PATCH model naming follows
[Model]Patchconvention - Content model naming follows
[Model]Contentconvention - Enum types use singular names
- New
DevTestLabVhdtype andGetDevTestLabVhdsmethods properly added - New model factory methods for mocking support
- Customization files well-structured with backward compat comments
tsp-location.yamlcorrectly configured
Pre-existing Issues (preserved for backward compat, no action needed)
DevTestLabCostDetails.Onpoor DateTimeOffset property name (just "On")DisallowPublicIPAddressboolean without Is/Can/Has prefixDevTestLabScheduleCreationParameter"Parameter" suffix
Issues Found (see inline comment + notes below)
[Should Fix] CHANGELOG.md is empty for a TypeSpec migration with new APIs.
The CHANGELOG for v1.2.0-beta.1 has no entries. This release should document at minimum:
- Features Added:
DevTestLabVhdtype andGetDevTestLabVhds/GetDevTestLabVhdsAsyncmethods, model factory methods for Patch/Content types - Breaking Changes:
GetVhds/GetVhdsAsyncnow throwsNotSupportedException(if kept as-is) - Other Changes: Migrated to TypeSpec-based code generation
[Should Fix] IncludeAutorestDependency in csproj should be removed.
src/Azure.ResourceManager.DevTestLabs.csproj line 10 has <IncludeAutorestDependency>true</IncludeAutorestDependency>. Since this package has been migrated to TypeSpec (tsp-location.yaml exists), the AutoRest dependency is no longer needed and should be removed.
Fixes #54747
Spec PR: Azure/azure-rest-api-specs#38481
Continue work of #51337
Contributing to the Azure SDK
Please see our CONTRIBUTING.md if you are not familiar with contributing to this repository or have questions.
For specific information about pull request etiquette and best practices, see this section.