Commit 4bdba75
Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script and modernize Azure.Template for TypeSpec (#53543)
* Initial plan
* Remove obsolete Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 script 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]>
* Delete redundant AzureSDKPackage_Setup.md and update reference
- 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]>
* Remove circular link from prerequisites doc
- 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]>
* Update template and prerequisites doc for TypeSpec
- 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]>
* Remove IncludeAutorestDependency from Azure.Template csproj
- Removed IncludeAutorestDependency property since template now uses TypeSpec with tsp-location.yaml instead of autorest.md
Co-authored-by: JoshLove-msft <[email protected]>
* Delete swagger folder from Azure.Template
- Removed sdk/template/Azure.Template/src/swagger folder as it's no longer needed for TypeSpec-based generation
Co-authored-by: JoshLove-msft <[email protected]>
* Update tsp-location.yaml to reference widget example
- Updated directory to point to specification/widget/data-plane/WidgetAnalytics as a concrete example instead of placeholder values
Co-authored-by: JoshLove-msft <[email protected]>
* Reference azure-rest-api-specs PR 38490 in tsp-location.yaml
- Added TODO comment to update commit once PR 38490 is merged
- Updated placeholder commit reference to indicate it should come from PR 38490
Co-authored-by: JoshLove-msft <[email protected]>
* Delete custom code from Azure.Template causing build failures
- Removed src/TemplateClient.cs (custom convenience methods for old swagger-based code)
- Removed src/Models/ directory (SecretBundle and TemplateModelFactory)
- These files referenced old autorest/swagger generated code that no longer exists after TypeSpec migration
Co-authored-by: JoshLove-msft <[email protected]>
* Remove tests and samples referencing deleted custom code
- Deleted tests/TemplateClientLiveTests.cs (referenced GetSecretValueAsync and SecretBundle)
- Deleted tests/Samples/Sample1_HelloWorld.cs and Sample1_HelloWorldAsync.cs (referenced GetSecretValue methods)
- Deleted samples/Sample1_HelloWorld.md and Sample1.HelloWorldAsync.md (contained old code examples)
- Deleted api/Azure.Template.net8.0.cs and Azure.Template.netstandard2.0.cs (API surface for deleted code)
- Updated README.md to be a generic TypeSpec template without specific code examples
- Updated samples/README.md to be a template guide
All removed files referenced the old swagger/autorest-based custom code that no longer exists after TypeSpec migration.
Co-authored-by: JoshLove-msft <[email protected]>
* Restore and adapt doc and tests as generic TypeSpec templates
- Restored doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md with three options:
1. Copy Azure.Template project (recommended for complete setup)
2. Use tsp-client init
3. Manual setup
- Restored and adapted test files as generic templates:
- TemplateClientLiveTests.cs: Removed specific implementation, added TODO comments with [Ignore] attribute
- Sample1_HelloWorld.cs and Sample1_HelloWorldAsync.cs: Updated to be generic template samples with [Ignore] attribute
- TemplateClientTestEnvironment.cs: Changed from KeyVaultUri to generic Endpoint
- All restored files now serve as templates that developers should adapt for their specific generated clients
Co-authored-by: JoshLove-msft <[email protected]>
* Fix tsp-client init command to include required --tsp-config parameter
Updated the documentation to show the correct usage of tsp-client init with the required --tsp-config parameter pointing to the tspconfig.yaml in the spec repo.
Co-authored-by: JoshLove-msft <[email protected]>
* Fix CS1998 warning in TemplateClientLiveTests.cs
Added await Task.CompletedTask to the async ExampleTest method to suppress the CS1998 compiler warning about async method lacking await operators.
Co-authored-by: JoshLove-msft <[email protected]>
* Update test templates to be buildable code with [Ignore] attributes
Converted tests and samples to be buildable without runtime exceptions:
- TemplateClientLiveTests.cs: Moved CreateClient() to comment as template example
- Sample1_HelloWorld.cs: Commented out client instantiation line
- Sample1_HelloWorldAsync.cs: Commented out client instantiation line
All tests remain marked with [Ignore] attribute so they won't run until developers update them for their specific generated clients.
Co-authored-by: JoshLove-msft <[email protected]>
* Generate TypeSpec client and update tests with actual generated code
- Updated tsp-location.yaml with merged commit hash 4ce7306
- Generated WidgetAnalyticsClient and related classes from the widget sample spec
- Updated tests to use the actual generated client:
- Renamed TemplateClientLiveTests.cs to WidgetAnalyticsClientLiveTests.cs
- Updated test code to use WidgetAnalyticsClient, WidgetAnalyticsClientOptions
- Updated samples to reference actual AzureWidgets and WidgetSuite types
- Fixed SA1028 trailing whitespace in TemplateClientTestEnvironment.cs
- Removed generated Samples_TemplateClient.cs (referenced non-existent TemplateClient)
The Azure.Template now contains actual generated code from the widget TypeSpec spec and buildable tests that reference the real generated client classes.
Co-authored-by: JoshLove-msft <[email protected]>
* Reorder options to make tsp-client init the first (recommended) option
Reordered the SDK package setup options in AzureSDKPackage_Setup.md:
- Option 1 (Recommended): Using tsp-client init
- Option 2: Copy the Azure.Template project
- Option 3: Manual Setup
Co-authored-by: JoshLove-msft <[email protected]>
* Remove Option 3 from setup doc and update API/snippets
- Removed "Option 3: Manual Setup" section from AzureSDKPackage_Setup.md per reviewer feedback
- Updated samples/README.md with actual snippet examples for GetWidgets and GetWidgetsAsync
- Added generated API surface files (Azure.Template.net8.0.cs, Azure.Template.netstandard2.0.cs)
- Ran Export-API.ps1 and Update-Snippets.ps1 to ensure generated code is up to date
Co-authored-by: JoshLove-msft <[email protected]>
* regen
* Uncomment test code in WidgetAnalyticsClientLiveTests
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]>
* Improve package description for Azure.Template
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]>
* api
* Update sdk/template/Azure.Template/src/Azure.Template.csproj
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JoshLove-msft <[email protected]>
Co-authored-by: jolov <[email protected]>1 parent 657d641 commit 4bdba75
File tree
62 files changed
+3193
-1199
lines changed- doc/DataPlaneCodeGeneration
- eng/scripts/automation
- sdk/template/Azure.Template
- api
- samples
- src
- Generated
- CollectionResults
- Docs
- Internal
- Models
- Models
- swagger
- tests
- Generated/Samples
- Samples
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
62 files changed
+3193
-1199
lines changedLines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
| 19 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
24 | 24 | | |
25 | | - | |
26 | | - | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | | - | |
30 | | - | |
| 31 | + | |
31 | 32 | | |
32 | | - | |
33 | | - | |
| 33 | + | |
| 34 | + | |
34 | 35 | | |
35 | 36 | | |
36 | | - | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
43 | 48 | | |
44 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
45 | 54 | | |
46 | | - | |
| 55 | + | |
47 | 56 | | |
48 | | - | |
| 57 | + | |
Lines changed: 0 additions & 91 deletions
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
| 8 | + | |
8 | 9 | | |
9 | | - | |
10 | | - | |
11 | | - | |
| 10 | + | |
12 | 11 | | |
13 | 12 | | |
14 | 13 | | |
| |||
61 | 60 | | |
62 | 61 | | |
63 | 62 | | |
64 | | - | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
| 63 | + | |
72 | 64 | | |
73 | | - | |
| 65 | + | |
74 | 66 | | |
75 | | - | |
76 | | - | |
77 | | - | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
78 | 70 | | |
79 | 71 | | |
80 | 72 | | |
| |||
0 commit comments