Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Oct 28, 2025

Description

This PR addresses issue #53507 by removing the obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script and modernizing the Azure.Template project to fully support TypeSpec-based SDK generation with the new emitter path.

Changes Made

Deleted obsolete script:

  • Removed eng/scripts/automation/Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 (functionality superseded by tsp-client init)

Updated documentation:

  • Updated doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md with two setup options (in order of recommendation):
    1. Use tsp-client init --tsp-config <url> (Recommended) - Initialize TypeSpec configuration with the correct emitter path
    2. Copy the Azure.Template project for complete setup
  • Updated doc/DataPlaneCodeGeneration/AzureSDKGeneration_Prerequistites.md to link to Azure.Template as an example

Modernized Azure.Template for TypeSpec:

  • Removed src/autorest.md (obsolete for TypeSpec)
  • Added tsp-location.yaml referencing widget example (specification/widget/data-plane/WidgetAnalytics) with merged commit 4ce7306a1673ba7f84857a31d8d3577fe5f8e9e1 from azure-rest-api-specs PR #38490
  • Removed IncludeAutorestDependency property from src/Azure.Template.csproj
  • Updated package description to better describe the Widget Analytics template
  • Deleted src/swagger/ folder and all swagger-based files
  • Removed all custom code built on swagger/autorest
  • Generated actual client code from the widget TypeSpec spec: WidgetAnalyticsClient, AzureWidgets, WidgetSuite, etc.
  • Added API surface files (api/Azure.Template.net8.0.cs, api/Azure.Template.netstandard2.0.cs)

Updated tests and samples to use actual generated client:

  • Renamed tests/TemplateClientLiveTests.cs to tests/WidgetAnalyticsClientLiveTests.cs
  • Updated test code to use WidgetAnalyticsClient and WidgetAnalyticsClientOptions with fully buildable test methods
  • Updated tests/Samples/Sample1_HelloWorld.cs and Sample1_HelloWorldAsync.cs to use actual AzureWidgets and WidgetSuite types
  • Updated tests/TemplateClientTestEnvironment.cs to use generic Endpoint instead of KeyVaultUri
  • Updated samples/README.md with actual snippet examples
  • Tests are marked with [Ignore] since the widget service isn't available for live testing

The 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 init now 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

This section details on the original issue you should resolve

<issue_title>Invoke-TypeSepcDataPlaneGenerateSDKPackage.ps1 is not using new emitter path</issue_title>
<issue_description>tsp-client init was updated to automatically use the new emitter path for new services. We need to investigate why this script is not doing that.</issue_description>

Comments on the Issue (you are @copilot in this section)

@jsquire Do we even need this script? There seem to be so many scripts like this floating around and I'm not sure where many are used. @JoshLove-msft @raych1 do you have context as to where this script is used? If it is not needed for the pipeline automation, agreed we can probably remove it and any references to it. @JoshLove-msft Here is where it is referenced https://github.com/Azure/azure-sdk-for-net/blob/9b64c749219efbaafc48a578fba59c2f8a60fecc/doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md. I don't know if we are at the point yet where the REST spec pipeline automation can fully replace this script which sets up the scaffolding for a brand new service library. That said, it doesn't do much more than tsp-client init, so maybe we can just recommend that instead. @raych1 This script isn't used by the REST spec pipeline automation. I agreed that it could be replaced by calling `tsp-client init` directly. @JoshLove-msft We will update the docs to recommend either using `tsp-client init` or just manually create the tsp-location.yaml and will delete this script.

💡 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.

… 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]>
Copilot AI changed the title [WIP] Fix Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 emitter path issue Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 and update setup docs Oct 28, 2025
Copilot finished work on behalf of JoshLove-msft October 28, 2025 21:45
Copilot AI requested a review from JoshLove-msft October 28, 2025 21:45
- 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]>
Copilot AI changed the title Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 and update setup docs Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script and clean up docs Oct 28, 2025
Copilot AI requested a review from JoshLove-msft October 28, 2025 22:02
Copilot finished work on behalf of JoshLove-msft October 28, 2025 22:02
- 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]>
Copilot AI requested a review from JoshLove-msft October 28, 2025 22:51
Copilot finished work on behalf of JoshLove-msft October 28, 2025 22:51
- 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]>
Copilot AI changed the title Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script and clean up docs Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script and modernize template for TypeSpec Oct 28, 2025
Copilot AI requested a review from JoshLove-msft October 28, 2025 23:15
Copilot finished work on behalf of JoshLove-msft October 28, 2025 23:15
Copilot finished work on behalf of JoshLove-msft October 28, 2025 23:18
- Removed IncludeAutorestDependency property since template now uses TypeSpec with tsp-location.yaml instead of autorest.md

Co-authored-by: JoshLove-msft <[email protected]>
Copilot finished work on behalf of JoshLove-msft October 28, 2025 23:23
Copilot AI review requested due to automatic review settings November 25, 2025 04:16
Copilot finished work on behalf of JoshLove-msft November 25, 2025 04:17
Copilot finished reviewing on behalf of JoshLove-msft November 25, 2025 04:18
Copy link
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 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

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]>
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]>
@github-actions
Copy link

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Azure.Template

Copilot AI requested a review from JoshLove-msft November 25, 2025 18:10
Copilot finished work on behalf of JoshLove-msft November 25, 2025 18:10
@JoshLove-msft JoshLove-msft merged commit 4bdba75 into main Nov 25, 2025
21 checks passed
@JoshLove-msft JoshLove-msft deleted the copilot/investigate-script-emitter-path branch November 25, 2025 18:41
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.

Invoke-TypeSepcDataPlaneGenerateSDKPackage.ps1 is not using new emitter path

3 participants