Skip to content

Commit 356cbce

Browse files
author
Changjian Wang
committed
Merge branch 'yslin/cu_ga_sdk_tsp_client' of https://github.com/Azure/azure-sdk-for-net into changjian-wang/improve_tests_for_cu_ga_sdk_tsp_client
2 parents c6d405e + aaadc7d commit 356cbce

File tree

4,028 files changed

+69808
-122287
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

4,028 files changed

+69808
-122287
lines changed

.github/CODEOWNERS

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -796,11 +796,10 @@
796796
# ServiceOwners: @axisc @sjkwak @hmlam
797797

798798
# PRLabel: %Search
799-
/sdk/search/ @Azure/azure-sdk-write-search @Azure/azsdk-search
799+
/sdk/search/ @Azure/azure-sdk-write-search
800800

801801
# ServiceLabel: %Search
802-
# AzureSdkOwners: @ShivangiReja
803-
# ServiceOwners: @kuanlu95 @mattgotteiner
802+
# ServiceOwners: @efrainretana @kuanlu95 @mattgotteiner
804803

805804
# ServiceLabel: %Security
806805
# ServiceOwners: @chlahav
@@ -1007,10 +1006,7 @@
10071006
# ServiceOwners: @emmeliaAra
10081007

10091008
# PRLabel: %HybridConnectivity
1010-
/sdk/hybridconnectivity/Azure.ResourceManager.*/ @apmehrotra
1011-
1012-
# ServiceLabel: %HybridConnectivity %Mgmt
1013-
# ServiceOwners: @apmehrotra
1009+
/sdk/hybridconnectivity/Azure.ResourceManager.*/ @ArcturusZhang @ArthurMa1978
10141010

10151011
# PRLabel: %LambdaTest HyperExecute
10161012
/sdk/lambdatesthyperexecute/Azure.ResourceManager.*/ @ArcturusZhang @ArthurMa1978

doc/DataPlaneCodeGeneration/AzureSDKGeneration_Prerequistites.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ Make sure you have a TypeSpec project in the `main` branch of the public API spe
1616

1717
## Set up SDK Project Folder
1818

19-
You will need to generate the SDK library under an SDK project folder following the repository [guidelines](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md).
19+
You will need to generate the SDK library under an SDK project folder following the repository guidelines. You can use the [Azure.Template](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/template/Azure.Template) as an example.

doc/DataPlaneCodeGeneration/AzureSDKPackage_Setup.md

Lines changed: 26 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,40 @@ sdk\<service name>\<package name>\<package name>.sln
1818

1919
## Create sdk package
2020

21-
We will use the Azure SDK template [Azure.Template](https://github.com/Azure/azure-sdk-for-net/blob/main/sdk/template/Azure.Template) to create the initial project skeleton for SDKs generated from TypeSpec.
21+
You have several options to create the initial project skeleton for SDKs generated from TypeSpec:
2222

23-
You can run `eng\scripts\automation\Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1` to generate the starting SDK client library package directly as following:
23+
### Option 1: Using tsp-client init (Recommended)
2424

25-
```powershell
26-
eng/scripts/automation/Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 -sdkFolder <sdk-folder-path> -typespecSpecDirectory <relativeTypeSpecProjectFolderPath> -commit <commitId> [-repo <specRepo>] [-additionalSubDirectories <relativeFolders>]
25+
You can use the `tsp-client init` command to initialize the TypeSpec configuration. This tool automatically sets up the correct emitter path for new services. You must pass the `--tsp-config` parameter pointing to the tspconfig.yaml in the spec repo:
26+
27+
```bash
28+
tsp-client init --tsp-config https://github.com/Azure/azure-rest-api-specs/blob/<commit>/specification/<service>/<typespec-project-folder>/tspconfig.yaml
2729
```
2830

29-
e.g.
30-
Use git url
31+
**Example:**
3132

32-
```powershell
33-
pwsh /home/azure-sdk-for-net/eng/scripts/automation/Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1 -sdkFolder /home/azure-sdk-for-net/sdk/anomalyDetector/Azure.AI.AnomalyDetector -typespecSpecDirectory specification/cognitiveservices/AnomalyDetector -commit ac8e06a2ed0fc1c54663c98f12c8a073f8026b90 -repo Azure/azure-rest-api-specs
33+
```bash
34+
tsp-client init --tsp-config https://github.com/Azure/azure-rest-api-specs/blob/c226a37cdb9a3f756aff9edb33435ba7c90a5b91/specification/ai/ContentUnderstanding/tspconfig.yaml
3435
```
3536

36-
**Note**:
37+
This will initialize the `tsp-location.yaml` file with the correct configuration. After running this command, you'll still need to create the project structure and files manually.
38+
39+
### Option 2: Copy the Azure.Template project
40+
41+
You can copy the [Azure.Template](https://github.com/Azure/azure-sdk-for-net/tree/main/sdk/template/Azure.Template) project as a starting point. This template includes the complete project structure with:
3742

38-
- `-sdkFolder` take the address of the sdk folder in azure-sdk-for-net repo. e.g. /home/azure-sdk-for-net/sdk/anomalyDetector/Azure.AI.AnomalyDetector. [Required]
39-
- `-typespecSpecDirectory` takes the relative path of the typespec project folder in spec repo. e.g. specification/cognitiveservices/AnomalyDetector [Required]
40-
- `-additionalSubDirectories` takes the relative paths of the additional directories needed by the typespec project, such as share library folder, separated by semicolon if there is more than one folder. [Optional]
41-
- `-commit` takes the git commit hash (e.g. ac8e06a2ed0fc1c54663c98f12c8a073f8026b90) [Required]
42-
- `-repo` takes the `<owner>/<repo>` of the REST API specification repository. (e.g. Azure/azure-rest-api-specs), [Optional], default is `Azure/azure-rest-api-specs`
43+
- Project files (`.csproj`, `.sln`)
44+
- TypeSpec configuration (`tsp-location.yaml`)
45+
- Test infrastructure
46+
- Sample structure
47+
- CI/CD configuration
4348

44-
When you run `eng\scripts\automation\Invoke-TypeSpecDataPlaneGenerateSDKPackage.ps1`, it will:
49+
**Steps:**
50+
1. Copy the `sdk/template/Azure.Template` directory to your new location `sdk/<service name>/<package name>/`
51+
2. Rename the project files and namespaces to match your service
52+
3. Update the `tsp-location.yaml` file to point to your TypeSpec specification
53+
4. Update the package name, version, and other metadata in the `.csproj` file
4554

46-
- Create a project folder, install template files from `sdk/template/Azure.Template`, and create `.csproj` and `.sln` files for your new library.
55+
These files are created following the guidance for the [Azure SDK Repository Structure](https://github.com/Azure/azure-sdk/blob/master/docs/policies/repostructure.md).
4756

48-
These files are created following the guidance for the [Azure SDK Repository Structure](https://github.com/Azure/azure-sdk/blob/master/docs/policies/repostructure.md).
57+
For more information on code generation, see the [Azure SDK Code Generation Quickstart Tutorial](https://github.com/Azure/azure-sdk-for-net/blob/main/doc/DataPlaneCodeGeneration/AzureSDKCodeGeneration_DataPlane_Quickstart.md).

doc/GeneratorMigration/Library_Inventory.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212

1313
## Summary
1414

15-
- Total libraries: 395
16-
- Management Plane (MPG): 226
17-
- Autorest/Swagger: 160
18-
- New Emitter (TypeSpec): 24
19-
- Old TypeSpec: 42
15+
- Total libraries: 394
16+
- Management Plane (MPG): 225
17+
- Autorest/Swagger: 159
18+
- New Emitter (TypeSpec): 25
19+
- Old TypeSpec: 41
2020
- Data Plane (DPG): 169
21-
- Autorest/Swagger: 87
22-
- New Emitter (TypeSpec): 16
23-
- Old TypeSpec: 17
21+
- Autorest/Swagger: 86
22+
- New Emitter (TypeSpec): 18
23+
- Old TypeSpec: 16
2424
- No generator: 49
2525

2626

2727
## Data Plane Libraries (DPG) - Migrated to New Emitter
2828

2929
Libraries that provide client APIs for Azure services and have been migrated to the new TypeSpec emitter.
3030

31-
**Migration Status**: 16 / 32 (50%)
31+
**Migration Status**: 18 / 34 (52.9%)
3232

3333
| Service | Library | New Emitter |
3434
| ------- | ------- | ----------- |
@@ -54,21 +54,23 @@ Libraries that provide client APIs for Azure services and have been migrated to
5454
| eventgrid | Azure.Messaging.EventGrid.SystemEvents ||
5555
| healthdataaiservices | Azure.Health.Deidentification ||
5656
| keyvault | Azure.Security.KeyVault.Administration ||
57-
| loadtestservice | Azure.Developer.LoadTesting | |
57+
| loadtestservice | Azure.Developer.LoadTesting | |
5858
| monitor | Azure.Monitor.Ingestion ||
5959
| monitor | Azure.Monitor.Query.Logs ||
6060
| monitor | Azure.Monitor.Query.Metrics ||
6161
| onlineexperimentation | Azure.Analytics.OnlineExperimentation | |
62+
| openai | Azure.AI.OpenAI ||
6263
| purview | Azure.Analytics.Purview.DataMap | |
6364
| schemaregistry | Azure.Data.SchemaRegistry ||
65+
| template | Azure.Template ||
6466
| translation | Azure.AI.Translation.Document | |
6567
| translation | Azure.AI.Translation.Text ||
6668
| vision | Azure.AI.Vision.ImageAnalysis ||
6769

6870

6971
## Data Plane Libraries (DPG) - Still on Swagger
7072

71-
Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 87
73+
Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 86
7274

7375
| Service | Library |
7476
| ------- | ------- |
@@ -153,7 +155,6 @@ Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 87
153155
| synapse | Azure.Analytics.Synapse.Monitoring |
154156
| synapse | Azure.Analytics.Synapse.Spark |
155157
| tables | Azure.Data.Tables |
156-
| template | Azure.Template |
157158
| textanalytics | Azure.AI.TextAnalytics |
158159
| textanalytics | Azure.AI.TextAnalytics.Legacy.Shared |
159160
| timeseriesinsights | Azure.IoT.TimeSeriesInsights |
@@ -165,7 +166,7 @@ Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 87
165166

166167
Libraries that provide resource management APIs for Azure services and have been migrated to the new TypeSpec emitter.
167168

168-
**Migration Status**: 24 / 66 (36.4%)
169+
**Migration Status**: 25 / 66 (37.9%)
169170

170171
| Service | Library | New Emitter |
171172
| ------- | ------- | ----------- |
@@ -181,7 +182,7 @@ Libraries that provide resource management APIs for Azure services and have been
181182
| computerecommender | Azure.ResourceManager.Compute.Recommender ||
182183
| computeschedule | Azure.ResourceManager.ComputeSchedule | |
183184
| connectedcache | Azure.ResourceManager.ConnectedCache ||
184-
| containerorchestratorruntime | Azure.ResourceManager.ContainerOrchestratorRuntime | |
185+
| containerorchestratorruntime | Azure.ResourceManager.ContainerOrchestratorRuntime | |
185186
| databasewatcher | Azure.ResourceManager.DatabaseWatcher ||
186187
| databox | Azure.ResourceManager.DataBox | |
187188
| dellstorage | Azure.ResourceManager.Dell.Storage ||
@@ -239,7 +240,7 @@ Libraries that provide resource management APIs for Azure services and have been
239240

240241
## Management Plane Libraries (MPG) - Still on Swagger
241242

242-
Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 160
243+
Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 159
243244

244245
| Service | Library |
245246
| ------- | ------- |
@@ -312,7 +313,6 @@ Libraries that have not yet been migrated to the new TypeSpec emitter. Total: 16
312313
| graphservices | Azure.ResourceManager.GraphServices |
313314
| guestconfiguration | Azure.ResourceManager.GuestConfiguration |
314315
| hdinsight | Azure.ResourceManager.HDInsight |
315-
| hdinsightcontainers | Azure.ResourceManager.HDInsight.Containers |
316316
| healthbot | Azure.ResourceManager.HealthBot |
317317
| healthcareapis | Azure.ResourceManager.HealthcareApis |
318318
| hybridaks | Azure.ResourceManager.HybridContainerService |

doc/GeneratorMigration/Library_Inventory.ps1

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,9 @@ function New-MarkdownReport {
178178
$dataNewEmitter = $dataLibraries | Where-Object { $_.generator -notin @("Swagger", "TSP-Old", "No Generator") }
179179
$dataTspOld = $dataLibraries | Where-Object { $_.generator -eq "TSP-Old" }
180180

181-
# Calculate TypeSpec library counts (only those with tsp-location.yaml)
181+
# Calculate TypeSpec library counts (only those with tsp-location.yaml or Azure.AI.OpenAI with special handling)
182182
$mgmtTypeSpecLibs = $mgmtLibraries | Where-Object { $_.hasTspLocation -eq $true }
183-
$dataTypeSpecLibs = $dataLibraries | Where-Object { $_.hasTspLocation -eq $true }
183+
$dataTypeSpecLibs = $dataLibraries | Where-Object { $_.hasTspLocation -eq $true -or $_.library -eq "Azure.AI.OpenAI" }
184184

185185
# Calculate migration percentages (migrated / total TypeSpec libraries)
186186
$mgmtMigrated = $mgmtNewEmitter.Count
@@ -223,8 +223,8 @@ function New-MarkdownReport {
223223
$report += "**Migration Status**: $dataMigrated / $dataTypeSpecTotal ($dataPercentage%)`n"
224224
$report += "| Service | Library | New Emitter |"
225225
$report += "| ------- | ------- | ----------- |"
226-
# Only include libraries that have tsp-location.yaml
227-
$sortedDataLibs = $dataLibraries | Where-Object { $_.hasTspLocation -eq $true } | Sort-Object service, library
226+
# Only include libraries that have tsp-location.yaml or are Azure.AI.OpenAI (special case with hardcoded handling)
227+
$sortedDataLibs = $dataLibraries | Where-Object { $_.hasTspLocation -eq $true -or $_.library -eq "Azure.AI.OpenAI" } | Sort-Object service, library
228228
foreach ($lib in $sortedDataLibs) {
229229
$newEmitter = if ($lib.generator -notin @("Swagger", "TSP-Old", "No Generator")) { "" } else { "" }
230230
$report += "| $($lib.service) | $($lib.library) | $newEmitter |"

0 commit comments

Comments
 (0)