Skip to content

Commit cb2091a

Browse files
markcowlCopilot
andcommitted
Minimize suppressions in network spec
- Replace Legacy @features/@feature/@featureOptions with new @featureFiles/@featureFile/@featureFileOptions decorators - Create model templates (ResourceInstance, ChildResourceInstance, SubResourceInstance) that encapsulate common suppressions - Convert 62 resources to use templates, removing per-resource suppressions for no-private-usage, arm-custom-resource-usage-discourage, and composition-over-inheritance Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 049bc1c commit cb2091a

127 files changed

Lines changed: 667 additions & 1170 deletions

File tree

Some content is hidden

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

package-lock.json

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

package.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@
66
"@azure-tools/spec-gen-sdk": "~0.9.1",
77
"@azure-tools/specs-shared": "file:.github/shared",
88
"@azure-tools/typespec-apiview": "0.7.2",
9-
"@azure-tools/typespec-autorest": "0.69.1",
9+
"@azure-tools/typespec-autorest": "https://pkg.pr.new/@azure-tools/typespec-autorest@0dc60f5",
1010
"@azure-tools/typespec-azure-core": "0.69.0",
1111
"@azure-tools/typespec-azure-portal-core": "0.69.0",
12-
"@azure-tools/typespec-azure-resource-manager": "0.69.1",
13-
"@azure-tools/typespec-azure-rulesets": "0.69.1",
12+
"@azure-tools/typespec-azure-resource-manager": "https://pkg.pr.new/@azure-tools/typespec-azure-resource-manager@0dc60f5",
13+
"@azure-tools/typespec-azure-rulesets": "https://pkg.pr.new/@azure-tools/typespec-azure-rulesets@0dc60f5",
1414
"@azure-tools/typespec-client-generator-cli": "0.33.1",
15-
"@azure-tools/typespec-client-generator-core": "0.69.0",
15+
"@azure-tools/typespec-client-generator-core": "https://pkg.pr.new/@azure-tools/typespec-client-generator-core@0dc60f5",
1616
"@azure-tools/typespec-liftr-base": "0.13.0",
1717
"@azure-tools/typespec-metadata": "0.2.0",
1818
"@azure/avocado": "0.11.0",
@@ -37,6 +37,8 @@
3737
"typescript": "~6.0.2"
3838
},
3939
"overrides": {
40+
"@azure-tools/typespec-azure-resource-manager": "$@azure-tools/typespec-azure-resource-manager",
41+
"@azure-tools/typespec-client-generator-core": "$@azure-tools/typespec-client-generator-core",
4042
"@typespec/asset-emitter": "0.79.1",
4143
"get-uri": "^6.0.5",
4244
"lodash": "^4.18.1",

specification/network/resource-manager/Microsoft.Network/Network/Network/AdminRuleCollection.tsp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@ namespace Microsoft.Network;
1616
/**
1717
* Defines the admin rule collection.
1818
*/
19-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
20-
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
21-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
22-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
23-
@Azure.ResourceManager.Legacy.feature(Features.networkManager)
19+
@featureFile(Features.networkManager)
2420
@parentResource(SecurityAdminConfiguration)
25-
@Http.Private.includeInapplicableMetadataInPayload(false)
26-
model AdminRuleCollection extends ChildResource {
27-
properties?: AdminRuleCollectionPropertiesFormat;
28-
21+
model AdminRuleCollection
22+
is ChildResourceInstance<AdminRuleCollectionPropertiesFormat> {
2923
@visibility(Lifecycle.Read)
3024
@path
3125
@key("ruleCollectionName")
@@ -39,8 +33,7 @@ model AdminRuleCollection extends ChildResource {
3933
systemData?: Azure.ResourceManager.Foundations.SystemData;
4034
}
4135

42-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
43-
@Azure.ResourceManager.Legacy.feature(Features.networkManager)
36+
@featureFile(Features.networkManager)
4437
@armResourceOperations
4538
interface AdminRuleCollections {
4639
/**

specification/network/resource-manager/Microsoft.Network/Network/Network/ApplicationGateway.tsp

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import "../Common/main.tsp";
77

88
using TypeSpec.Rest;
99
using Azure.ResourceManager;
10-
using Azure.ResourceManager.Legacy;
1110
using TypeSpec.Http;
1211
using TypeSpec.OpenAPI;
1312
using Common;
@@ -16,15 +15,9 @@ namespace Microsoft.Network;
1615
/**
1716
* Application gateway resource.
1817
*/
19-
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
20-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
21-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
22-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
23-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
24-
@Http.Private.includeInapplicableMetadataInPayload(false)
25-
model ApplicationGateway extends Common.Resource {
26-
properties?: ApplicationGatewayPropertiesFormat;
27-
18+
@featureFile(Features.applicationGateway)
19+
model ApplicationGateway
20+
is ResourceInstance<ApplicationGatewayPropertiesFormat> {
2821
@visibility(Lifecycle.Read)
2922
@path
3023
@key("applicationGatewayName")
@@ -47,8 +40,7 @@ model ApplicationGateway extends Common.Resource {
4740
identity?: Common.ManagedServiceIdentity;
4841
}
4942

50-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
51-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
43+
@featureFile(Features.applicationGateway)
5244
@armResourceOperations(#{ omitTags: true })
5345
interface ApplicationGateways {
5446
/**

specification/network/resource-manager/Microsoft.Network/Network/Network/ApplicationGatewayAvailableSslOptions.tsp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,11 @@ namespace Microsoft.Network;
1515
/**
1616
* Response for ApplicationGatewayAvailableSslOptions API service call.
1717
*/
18-
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
19-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
20-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
21-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
22-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
18+
@featureFile(Features.applicationGateway)
2319
@singleton("default")
2420
@subscriptionResource
25-
@Http.Private.includeInapplicableMetadataInPayload(false)
26-
model ApplicationGatewayAvailableSslOptions extends Common.Resource {
27-
properties?: ApplicationGatewayAvailableSslOptionsPropertiesFormat;
28-
21+
model ApplicationGatewayAvailableSslOptions
22+
is ResourceInstance<ApplicationGatewayAvailableSslOptionsPropertiesFormat> {
2923
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
3024
@visibility(Lifecycle.Read)
3125
@path
@@ -51,8 +45,7 @@ alias ApplicationGatewayAvailableSslOptionsOps = Azure.ResourceManager.Legacy.Ro
5145
}
5246
>;
5347

54-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
55-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
48+
@featureFile(Features.applicationGateway)
5649
@armResourceOperations(#{ allowStaticRoutes: true, omitTags: true })
5750
interface ApplicationGatewayAvailableSslOptionsOperationGroup {
5851
/**

specification/network/resource-manager/Microsoft.Network/Network/Network/ApplicationGatewayPrivateEndpointConnection.tsp

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,10 @@ namespace Microsoft.Network;
1616
/**
1717
* Private Endpoint connection on an application gateway.
1818
*/
19-
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
20-
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
21-
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
22-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
23-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
19+
@featureFile(Features.applicationGateway)
2420
@parentResource(ApplicationGateway)
25-
@Http.Private.includeInapplicableMetadataInPayload(false)
26-
model ApplicationGatewayPrivateEndpointConnection extends SubResourceModel {
27-
properties?: ApplicationGatewayPrivateEndpointConnectionProperties;
28-
21+
model ApplicationGatewayPrivateEndpointConnection
22+
is SubResourceInstance<ApplicationGatewayPrivateEndpointConnectionProperties> {
2923
@visibility(Lifecycle.Read)
3024
@path
3125
@key("connectionName")
@@ -38,8 +32,7 @@ model ApplicationGatewayPrivateEndpointConnection extends SubResourceModel {
3832
etag?: string;
3933
}
4034

41-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
42-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
35+
@featureFile(Features.applicationGateway)
4336
@armResourceOperations
4437
interface ApplicationGatewayPrivateEndpointConnections {
4538
/**

specification/network/resource-manager/Microsoft.Network/Network/Network/ApplicationGatewayWafDynamicManifestResult.tsp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ namespace Microsoft.Network;
1818
#suppress "@azure-tools/typespec-azure-core/no-private-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
1919
#suppress "@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
2020
#suppress "@azure-tools/typespec-azure-core/composition-over-inheritance" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
21-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
22-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
21+
@featureFile(Features.applicationGateway)
2322
@Http.Private.includeInapplicableMetadataInPayload(false)
2423
@singleton("dafault")
2524
@subscriptionResource
@@ -61,8 +60,7 @@ alias ApplicationGatewayWafDynamicManifestResultOps = Azure.ResourceManager.Lega
6160
}
6261
>;
6362

64-
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
65-
@Azure.ResourceManager.Legacy.feature(Features.applicationGateway)
63+
@featureFile(Features.applicationGateway)
6664
@armResourceOperations(#{ omitTags: true })
6765
interface ApplicationGatewayWafDynamicManifestResults {
6866
/**

0 commit comments

Comments
 (0)