-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script and modernize Azure.Template for TypeSpec #53543
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
Conversation
… and update documentation - Deleted eng/scripts/automation/Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 as it is not using the new emitter path - Updated doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md to recommend using tsp-client init or manually creating tsp-location.yaml - Added guidance on required emitterPackageJsonPath property for new services Co-authored-by: JoshLove-msft <[email protected]>
- Deleted doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md as requested - content is covered in AzureSDKCodeGeneration_DataPlane_Quickstart.md - Updated reference in AzureSDKGeneration_Prerequistites.md to point to the quickstart guide instead Co-authored-by: JoshLove-msft <[email protected]>
doc/DataPlaneCodeGeneration/AzureSDKGeneration_Prerequistites.md
Outdated
Show resolved
Hide resolved
- Removed link from AzureSDKGeneration_Prerequistites.md that was linking back to AzureSDKCodeGeneration_DataPlane_Quickstart.md - The quickstart already references the prerequisites, so this created a circular reference Co-authored-by: JoshLove-msft <[email protected]>
doc/DataPlaneCodeGeneration/AzureSDKGeneration_Prerequistites.md
Outdated
Show resolved
Hide resolved
- Added link to Azure.Template in AzureSDKGeneration_Prerequistites.md as an example - Removed autorest.md from Azure.Template (obsolete for TypeSpec) - Added tsp-location.yaml to Azure.Template with placeholder values as a template for new services Co-authored-by: JoshLove-msft <[email protected]>
- Removed IncludeAutorestDependency property since template now uses TypeSpec with tsp-location.yaml instead of autorest.md Co-authored-by: JoshLove-msft <[email protected]>
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 removes the obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script and comprehensively modernizes the Azure.Template project to serve as a complete, buildable reference for TypeSpec-based SDK generation. The template now contains actual generated client code (WidgetAnalyticsClient) from the widget TypeSpec specification, replacing the previous swagger/autorest-based approach.
Key changes:
- Removed obsolete automation script superseded by
tsp-client init - Added TypeSpec configuration with widget example reference
- Generated real client code from TypeSpec that compiles
- Updated all tests, samples, and documentation to use the new client
Reviewed changes
Copilot reviewed 21 out of 61 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
eng/scripts/automation/Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 |
Deleted obsolete script replaced by tsp-client init |
doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md |
Updated with tsp-client init recommendation and template usage options |
doc/DataPlaneCodeGeneration/AzureSDKGeneration_Prerequistites.md |
Updated to reference Azure.Template as example |
sdk/template/Azure.Template/tsp-location.yaml |
Added TypeSpec configuration pointing to widget spec |
sdk/template/Azure.Template/src/autorest.md |
Removed obsolete autorest configuration |
sdk/template/Azure.Template/src/swagger/mini-secrets.json |
Removed obsolete swagger spec |
sdk/template/Azure.Template/src/Generated/* |
Added complete TypeSpec-generated client code |
sdk/template/Azure.Template/tests/* |
Updated all tests to use WidgetAnalyticsClient with [Ignore] attributes |
sdk/template/Azure.Template/samples/* |
Updated samples with widget examples |
sdk/template/Azure.Template/README.md |
Updated to reflect TypeSpec template purpose |
sdk/template/Azure.Template/api/*.cs |
Added API surface files for the generated code |
sdk/template/Azure.Template/src/Azure.Template.csproj |
Removed IncludeAutorestDependency property |
…o copilot/investigate-script-emitter-path
sdk/template/Azure.Template/tests/WidgetAnalyticsClientLiveTests.cs
Outdated
Show resolved
Hide resolved
Uncommented the actual test code for GetWidgetsTest method since the WidgetAnalyticsClient is now generated and available. The test still has [Ignore] attribute since the widget service isn't available for live testing. Co-authored-by: JoshLove-msft <[email protected]>
sdk/template/Azure.Template/src/Generated/Internal/CodeGenSuppressAttribute.cs
Show resolved
Hide resolved
Updated the description and assembly title in Azure.Template.csproj to better describe the Widget Analytics template project and its purpose for demonstrating TypeSpec-based SDK generation patterns. Co-authored-by: JoshLove-msft <[email protected]>
…hub.com/Azure/azure-sdk-for-net into copilot/investigate-script-emitter-path
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Description
This PR addresses issue #53507 by removing the obsolete
Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1script and modernizing the Azure.Template project to fully support TypeSpec-based SDK generation with the new emitter path.Changes Made
Deleted obsolete script:
eng/scripts/automation/Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1(functionality superseded bytsp-client init)Updated documentation:
doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.mdwith two setup options (in order of recommendation):tsp-client init --tsp-config <url>(Recommended) - Initialize TypeSpec configuration with the correct emitter pathdoc/DataPlaneCodeGeneration/AzureSDKGeneration_Prerequistites.mdto link to Azure.Template as an exampleModernized Azure.Template for TypeSpec:
src/autorest.md(obsolete for TypeSpec)tsp-location.yamlreferencing widget example (specification/widget/data-plane/WidgetAnalytics) with merged commit4ce7306a1673ba7f84857a31d8d3577fe5f8e9e1from azure-rest-api-specs PR #38490IncludeAutorestDependencyproperty fromsrc/Azure.Template.csprojsrc/swagger/folder and all swagger-based filesWidgetAnalyticsClient,AzureWidgets,WidgetSuite, etc.api/Azure.Template.net8.0.cs,api/Azure.Template.netstandard2.0.cs)Updated tests and samples to use actual generated client:
tests/TemplateClientLiveTests.cstotests/WidgetAnalyticsClientLiveTests.csWidgetAnalyticsClientandWidgetAnalyticsClientOptionswith fully buildable test methodstests/Samples/Sample1_HelloWorld.csandSample1_HelloWorldAsync.csto use actualAzureWidgetsandWidgetSuitetypestests/TemplateClientTestEnvironment.csto use genericEndpointinstead ofKeyVaultUrisamples/README.mdwith actual snippet examples[Ignore]since the widget service isn't available for live testingThe Azure.Template now serves as a complete, buildable reference for TypeSpec-based SDK generation with actual generated code from the widget spec that compiles and can be used as a real-world example.
Rationale
The team determined that
tsp-client initnow automatically configures the correct emitter path for new services, making the custom script obsolete. The Azure.Template has been fully migrated from swagger/autorest to TypeSpec and now contains actual generated client code (WidgetAnalyticsClient) that compiles and demonstrates a complete TypeSpec-based SDK project.Fixes #53507
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.