Skip to content

Commit ff9e9f9

Browse files
committed
Merge branch 'update-diagnostics-scope-for-pageable' into bump-azure-generator-version
2 parents d52b7d8 + 1bf1fe6 commit ff9e9f9

File tree

973 files changed

+46969
-28787
lines changed

Some content is hidden

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

973 files changed

+46969
-28787
lines changed

doc/GeneratorMigration/Library_Inventory.md

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,25 @@
22

33
## Summary
44

5-
- Total libraries: 404
5+
- Total libraries: 407
66
- Management Plane (Swagger): 170
7-
- Management Plane (TSP-Old): 45
7+
- Management Plane (TSP-Old): 48
88
- Management Plane (TypeSpec - @azure-typespec/http-client-csharp): 0
9-
- Data Plane (Swagger): 114
10-
- Data Plane (TSP-Old): 29
11-
- Data Plane (TypeSpec - @azure-typespec/http-client-csharp): 6
12-
- No generator: 40
9+
- Data Plane (Swagger): 115
10+
- Data Plane (TSP-Old): 28
11+
- Data Plane (TypeSpec - @azure-typespec/http-client-csharp): 7
12+
- No generator: 39
1313

1414

1515
## Data Plane Libraries using TypeSpec (@azure-typespec/http-client-csharp)
1616

17-
TypeSpec with @azure-typespec/http-client-csharp generator is detected by the presence of a tsp-location.yaml file with an emitterPackageJsonPath value referencing @azure-typespec/http-client-csharp, or through special handling for specific libraries. Total: 6
17+
TypeSpec with @azure-typespec/http-client-csharp generator is detected by the presence of a tsp-location.yaml file with an emitterPackageJsonPath value referencing @azure-typespec/http-client-csharp, or through special handling for specific libraries. Total: 7
1818

1919
| Service | Library | Path |
2020
| ------- | ------- | ---- |
2121
| appconfiguration | Azure.Data.AppConfiguration | sdk/appconfiguration/Azure.Data.AppConfiguration |
2222
| eventgrid | Azure.Messaging.EventGrid.Namespaces | sdk/eventgrid/Azure.Messaging.EventGrid.Namespaces |
23+
| eventgrid | Azure.Messaging.EventGrid.SystemEvents | sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents |
2324
| healthdataaiservices | Azure.Health.Deidentification | sdk/healthdataaiservices/Azure.Health.Deidentification |
2425
| keyvault | Azure.Security.KeyVault.Administration | sdk/keyvault/Azure.Security.KeyVault.Administration |
2526
| openai | Azure.AI.OpenAI | sdk/openai/Azure.AI.OpenAI |
@@ -28,7 +29,7 @@ TypeSpec with @azure-typespec/http-client-csharp generator is detected by the pr
2829

2930
## Data Plane Libraries using TypeSpec (Old Generator)
3031

31-
TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 29
32+
TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 28
3233

3334
| Service | Library | Path |
3435
| ------- | ------- | ---- |
@@ -49,7 +50,6 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f
4950
| devcenter | Azure.Developer.DevCenter | sdk/devcenter/Azure.Developer.DevCenter |
5051
| documentintelligence | Azure.AI.DocumentIntelligence | sdk/documentintelligence/Azure.AI.DocumentIntelligence |
5152
| easm | Azure.Analytics.Defender.Easm | sdk/easm/Azure.Analytics.Defender.Easm |
52-
| eventgrid | Azure.Messaging.EventGrid.SystemEvents | sdk/eventgrid/Azure.Messaging.EventGrid.SystemEvents |
5353
| face | Azure.AI.Vision.Face | sdk/face/Azure.AI.Vision.Face |
5454
| healthinsights | Azure.Health.Insights.CancerProfiling | sdk/healthinsights/Azure.Health.Insights.CancerProfiling |
5555
| healthinsights | Azure.Health.Insights.ClinicalMatching | sdk/healthinsights/Azure.Health.Insights.ClinicalMatching |
@@ -65,7 +65,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f
6565

6666
## Data Plane Libraries using Swagger
6767

68-
Total: 114
68+
Total: 115
6969

7070
| Service | Library | Path |
7171
| ------- | ------- | ---- |
@@ -114,6 +114,7 @@ Total: 114
114114
| eventgrid | Azure.Messaging.EventGrid | sdk/eventgrid/Azure.Messaging.EventGrid |
115115
| formrecognizer | Azure.AI.FormRecognizer | sdk/formrecognizer/Azure.AI.FormRecognizer |
116116
| iot | Azure.IoT.Hub.Service | sdk/iot/Azure.IoT.Hub.Service |
117+
| loadtestservice | Azure.Developer.Playwright | sdk/loadtestservice/Azure.Developer.Playwright |
117118
| maps | Azure.Maps.Common | sdk/maps/Azure.Maps.Common |
118119
| maps | Azure.Maps.Geolocation | sdk/maps/Azure.Maps.Geolocation |
119120
| maps | Azure.Maps.Rendering | sdk/maps/Azure.Maps.Rendering |
@@ -187,7 +188,7 @@ Total: 114
187188

188189
## Management Plane Libraries using TypeSpec (Old Generator)
189190

190-
TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 45
191+
TypeSpec with old generator is detected by the presence of a tsp-location.yaml file without an emitterPackageJsonPath value, tspconfig.yaml file, tsp directory, or *.tsp files. Total: 48
191192

192193
| Service | Library | Path |
193194
| ------- | ------- | ---- |
@@ -208,6 +209,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f
208209
| deviceregistry | Azure.ResourceManager.DeviceRegistry | sdk/deviceregistry/Azure.ResourceManager.DeviceRegistry |
209210
| devopsinfrastructure | Azure.ResourceManager.DevOpsInfrastructure | sdk/devopsinfrastructure/Azure.ResourceManager.DevOpsInfrastructure |
210211
| durabletask | Azure.ResourceManager.DurableTask | sdk/durabletask/Azure.ResourceManager.DurableTask |
212+
| elasticsan | Azure.ResourceManager.ElasticSan | sdk/elasticsan/Azure.ResourceManager.ElasticSan |
211213
| fabric | Azure.ResourceManager.Fabric | sdk/fabric/Azure.ResourceManager.Fabric |
212214
| grafana | Azure.ResourceManager.Grafana | sdk/grafana/Azure.ResourceManager.Grafana |
213215
| hardwaresecuritymodules | Azure.ResourceManager.HardwareSecurityModules | sdk/hardwaresecuritymodules/Azure.ResourceManager.HardwareSecurityModules |
@@ -223,6 +225,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f
223225
| oracle | Azure.ResourceManager.OracleDatabase | sdk/oracle/Azure.ResourceManager.OracleDatabase |
224226
| pineconevectordb | Azure.ResourceManager.PineconeVectorDB | sdk/pineconevectordb/Azure.ResourceManager.PineconeVectorDB |
225227
| planetarycomputer | Azure.ResourceManager.PlanetaryComputer | sdk/planetarycomputer/Azure.ResourceManager.PlanetaryComputer |
228+
| playwright | Azure.ResourceManager.Playwright | sdk/playwright/Azure.ResourceManager.Playwright |
226229
| playwrighttesting | Azure.ResourceManager.PlaywrightTesting | sdk/playwrighttesting/Azure.ResourceManager.PlaywrightTesting |
227230
| portalservices | Azure.ResourceManager.PortalServicesCopilot | sdk/portalservices/Azure.ResourceManager.PortalServicesCopilot |
228231
| purestorageblock | Azure.ResourceManager.PureStorageBlock | sdk/purestorageblock/Azure.ResourceManager.PureStorageBlock |
@@ -233,6 +236,7 @@ TypeSpec with old generator is detected by the presence of a tsp-location.yaml f
233236
| sitemanager | Azure.ResourceManager.SiteManager | sdk/sitemanager/Azure.ResourceManager.SiteManager |
234237
| standbypool | Azure.ResourceManager.StandbyPool | sdk/standbypool/Azure.ResourceManager.StandbyPool |
235238
| storageactions | Azure.ResourceManager.StorageActions | sdk/storageactions/Azure.ResourceManager.StorageActions |
239+
| storagediscovery | Azure.ResourceManager.StorageDiscovery | sdk/storagediscovery/Azure.ResourceManager.StorageDiscovery |
236240
| terraform | Azure.ResourceManager.Terraform | sdk/terraform/Azure.ResourceManager.Terraform |
237241
| weightsandbiases | Azure.ResourceManager.WeightsAndBiases | sdk/weightsandbiases/Azure.ResourceManager.WeightsAndBiases |
238242
| workloadssapvirtualinstance | Azure.ResourceManager.WorkloadsSapVirtualInstance | sdk/workloadssapvirtualinstance/Azure.ResourceManager.WorkloadsSapVirtualInstance |
@@ -306,7 +310,6 @@ Total: 170
306310
| edgeorder | Azure.ResourceManager.EdgeOrder | sdk/edgeorder/Azure.ResourceManager.EdgeOrder |
307311
| edgezones | Azure.ResourceManager.EdgeZones | sdk/edgezones/Azure.ResourceManager.EdgeZones |
308312
| elastic | Azure.ResourceManager.Elastic | sdk/elastic/Azure.ResourceManager.Elastic |
309-
| elasticsan | Azure.ResourceManager.ElasticSan | sdk/elasticsan/Azure.ResourceManager.ElasticSan |
310313
| eventgrid | Azure.ResourceManager.EventGrid | sdk/eventgrid/Azure.ResourceManager.EventGrid |
311314
| eventhub | Azure.ResourceManager.EventHubs | sdk/eventhub/Azure.ResourceManager.EventHubs |
312315
| extendedlocation | Azure.ResourceManager.ExtendedLocations | sdk/extendedlocation/Azure.ResourceManager.ExtendedLocations |
@@ -385,6 +388,7 @@ Total: 170
385388
| resourcemanager | Azure.ResourceManager | sdk/resourcemanager/Azure.ResourceManager |
386389
| resourcemover | Azure.ResourceManager.ResourceMover | sdk/resourcemover/Azure.ResourceManager.ResourceMover |
387390
| resources | Azure.ResourceManager.Resources | sdk/resources/Azure.ResourceManager.Resources |
391+
| resources | Azure.ResourceManager.Resources.DeploymentStacks | sdk/resources/Azure.ResourceManager.Resources.DeploymentStacks |
388392
| search | Azure.ResourceManager.Search | sdk/search/Azure.ResourceManager.Search |
389393
| securitycenter | Azure.ResourceManager.SecurityCenter | sdk/securitycenter/Azure.ResourceManager.SecurityCenter |
390394
| securitydevops | Azure.ResourceManager.SecurityDevOps | sdk/securitydevops/Azure.ResourceManager.SecurityDevOps |
@@ -418,7 +422,7 @@ Total: 170
418422

419423
## Libraries with No Generator
420424

421-
Libraries with no generator have neither autorest.md nor tsp-location.yaml files. Total: 40
425+
Libraries with no generator have neither autorest.md nor tsp-location.yaml files. Total: 39
422426

423427
| Service | Library | Path |
424428
| ------- | ------- | ---- |
@@ -446,7 +450,6 @@ Libraries with no generator have neither autorest.md nor tsp-location.yaml files
446450
| keyvault | Azure.Security.KeyVault.Keys | sdk/keyvault/Azure.Security.KeyVault.Keys |
447451
| keyvault | Azure.Security.KeyVault.Secrets | sdk/keyvault/Azure.Security.KeyVault.Secrets |
448452
| keyvault | Azure.Security.KeyVault.Shared | sdk/keyvault/Azure.Security.KeyVault.Shared |
449-
| loadtestservice | Azure.Developer.Playwright | sdk/loadtestservice/Azure.Developer.Playwright |
450453
| loadtestservice | Azure.Developer.Playwright.MSTest | sdk/loadtestservice/Azure.Developer.Playwright.MSTest |
451454
| loadtestservice | Azure.Developer.Playwright.NUnit | sdk/loadtestservice/Azure.Developer.Playwright.NUnit |
452455
| modelsrepository | Azure.IoT.ModelsRepository | sdk/modelsrepository/Azure.IoT.ModelsRepository |

eng/azure-typespec-http-client-csharp-emitter-package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/azure-typespec-http-client-csharp-emitter-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"main": "dist/src/index.js",
33
"dependencies": {
4-
"@azure-typespec/http-client-csharp": "1.0.0-alpha.20250811.6"
4+
"@azure-typespec/http-client-csharp": "1.0.0-alpha.20250812.3"
55
},
66
"devDependencies": {
77
"@azure-tools/typespec-azure-core": "0.59.0",

eng/azure-typespec-http-client-csharp-mgmt-emitter-package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eng/azure-typespec-http-client-csharp-mgmt-emitter-package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"main": "dist/src/index.js",
33
"dependencies": {
4-
"@azure-typespec/http-client-csharp-mgmt": "1.0.0-alpha.20250811.7"
4+
"@azure-typespec/http-client-csharp-mgmt": "1.0.0-alpha.20250812.1"
55
},
66
"devDependencies": {
77
"@azure-tools/typespec-azure-core": "0.57.0",

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/ManagementOutputLibrary.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ public class ManagementOutputLibrary : AzureOutputLibrary
3030
private ProviderConstantsProvider? _providerConstants;
3131
internal ProviderConstantsProvider ProviderConstants => _providerConstants ??= new ProviderConstantsProvider();
3232

33+
// TODO -- this is really a bad practice that this map is not built in one place, but we are building it while generating stuff and in the meantime we might read it.
34+
// but currently this is the best we could do right now.
35+
internal Dictionary<TypeProvider, string> PageableMethodScopes { get; } = new();
36+
3337
private IReadOnlyList<ResourceClientProvider>? _resourceClients;
3438
private IReadOnlyList<ResourceCollectionClientProvider>? _resourceCollections;
3539
private IReadOnlyList<MockableResourceProvider>? _mockableResourceProviders;

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Providers/OperationMethodProviders/PageableOperationMethodProvider.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,11 @@ protected MethodBodyStatement[] BuildBodyStatements()
102102
{
103103
var statements = new List<MethodBodyStatement>();
104104

105-
var collectionResultOfT = ((ScmMethodProvider)_convenienceMethod).CollectionDefinition!.Type;
105+
var collectionResult = ((ScmMethodProvider)_convenienceMethod).CollectionDefinition!;
106+
var diagnosticScope = ResourceHelpers.GetDiagnosticScope(_enclosingType, _methodName, _isAsync);
107+
ManagementClientGenerator.Instance.OutputLibrary.PageableMethodScopes.Add(collectionResult, diagnosticScope);
108+
109+
var collectionResultOfT = collectionResult.Type;
106110
statements.Add(ResourceMethodSnippets.CreateRequestContext(KnownParameters.CancellationTokenParameter, out var contextVariable));
107111

108112
var requestMethod = _restClientInfo.RestClientProvider.GetRequestMethodByOperation(_method.Operation);

eng/packages/http-client-csharp-mgmt/generator/Azure.Generator.Management/src/Utilities/ResourceHelpers.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
using Azure.ResourceManager.Resources;
77
using Microsoft.TypeSpec.Generator.Input.Extensions;
88
using Microsoft.TypeSpec.Generator.Primitives;
9+
using Microsoft.TypeSpec.Generator.Providers;
910
using System;
1011
using System.Runtime.CompilerServices;
1112

@@ -60,6 +61,12 @@ public static string GetRestClientPropertyName(string clientName)
6061
};
6162
}
6263

64+
public static string GetDiagnosticScope(TypeProvider enclosingType, string methodName, bool isAsync)
65+
{
66+
var rawMethodName = isAsync ? methodName.Substring(0, methodName.Length - 5) : methodName; // trim "Async" if the method is async method
67+
return $"{enclosingType.Type.Name}.{rawMethodName}";
68+
}
69+
6370
/// <summary>
6471
/// Determines if the given resource operation kind should also be treated as an LRO (Long-Running Operation).
6572
/// When this happens, an operation is not a true long-running operation at the REST API level,

0 commit comments

Comments
 (0)