Skip to content

Commit cd334d5

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 ab08a9a commit cd334d5

128 files changed

Lines changed: 478 additions & 740 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 & 44 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 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@4664",
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@4664",
13+
"@azure-tools/typespec-azure-rulesets": "https://pkg.pr.new/@azure-tools/typespec-azure-rulesets@4664",
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@4664",
1616
"@azure-tools/typespec-liftr-base": "0.13.0",
1717
"@azure-tools/typespec-metadata": "0.2.0",
1818
"@azure/avocado": "0.11.0",

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,10 @@ namespace Microsoft.Network;
1717
* Defines the admin rule collection.
1818
*/
1919
#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)
20+
@Azure.ResourceManager.featureFile(Features.networkManager)
2421
@parentResource(SecurityAdminConfiguration)
25-
@Http.Private.includeInapplicableMetadataInPayload(false)
26-
model AdminRuleCollection extends ChildResource {
27-
properties?: AdminRuleCollectionPropertiesFormat;
28-
22+
model AdminRuleCollection
23+
is ChildResourceInstance<AdminRuleCollectionPropertiesFormat> {
2924
@visibility(Lifecycle.Read)
3025
@path
3126
@key("ruleCollectionName")
@@ -40,7 +35,7 @@ model AdminRuleCollection extends ChildResource {
4035
}
4136

4237
#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)
38+
@Azure.ResourceManager.featureFile(Features.networkManager)
4439
@armResourceOperations
4540
interface AdminRuleCollections {
4641
/**

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

Lines changed: 4 additions & 10 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,10 @@ 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"
2218
#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-
19+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
20+
model ApplicationGateway
21+
is ResourceInstance<ApplicationGatewayPropertiesFormat> {
2822
@visibility(Lifecycle.Read)
2923
@path
3024
@key("applicationGatewayName")
@@ -48,7 +42,7 @@ model ApplicationGateway extends Common.Resource {
4842
}
4943

5044
#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)
45+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
5246
@armResourceOperations(#{ omitTags: true })
5347
interface ApplicationGateways {
5448
/**

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,12 @@ 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"
2118
#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)
19+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
2320
@singleton("default")
2421
@subscriptionResource
25-
@Http.Private.includeInapplicableMetadataInPayload(false)
26-
model ApplicationGatewayAvailableSslOptions extends Common.Resource {
27-
properties?: ApplicationGatewayAvailableSslOptionsPropertiesFormat;
28-
22+
model ApplicationGatewayAvailableSslOptions
23+
is ResourceInstance<ApplicationGatewayAvailableSslOptionsPropertiesFormat> {
2924
#suppress "@azure-tools/typespec-azure-core/documentation-required" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
3025
@visibility(Lifecycle.Read)
3126
@path
@@ -52,7 +47,7 @@ alias ApplicationGatewayAvailableSslOptionsOps = Azure.ResourceManager.Legacy.Ro
5247
>;
5348

5449
#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)
50+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
5651
@armResourceOperations(#{ allowStaticRoutes: true, omitTags: true })
5752
interface ApplicationGatewayAvailableSslOptionsOperationGroup {
5853
/**

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

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,16 +16,11 @@ 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"
2219
#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)
20+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
2421
@parentResource(ApplicationGateway)
25-
@Http.Private.includeInapplicableMetadataInPayload(false)
26-
model ApplicationGatewayPrivateEndpointConnection extends SubResourceModel {
27-
properties?: ApplicationGatewayPrivateEndpointConnectionProperties;
28-
22+
model ApplicationGatewayPrivateEndpointConnection
23+
is SubResourceInstance<ApplicationGatewayPrivateEndpointConnectionProperties> {
2924
@visibility(Lifecycle.Read)
3025
@path
3126
@key("connectionName")
@@ -39,7 +34,7 @@ model ApplicationGatewayPrivateEndpointConnection extends SubResourceModel {
3934
}
4035

4136
#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)
37+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
4338
@armResourceOperations
4439
interface ApplicationGatewayPrivateEndpointConnections {
4540
/**

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace Microsoft.Network;
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"
2121
#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)
22+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
2323
@Http.Private.includeInapplicableMetadataInPayload(false)
2424
@singleton("dafault")
2525
@subscriptionResource
@@ -62,7 +62,7 @@ alias ApplicationGatewayWafDynamicManifestResultOps = Azure.ResourceManager.Lega
6262
>;
6363

6464
#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)
65+
@Azure.ResourceManager.featureFile(Features.applicationGateway)
6666
@armResourceOperations(#{ omitTags: true })
6767
interface ApplicationGatewayWafDynamicManifestResults {
6868
/**

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ using Common;
1414
namespace Microsoft.Network;
1515

1616
#suppress "@azure-tools/typespec-azure-core/no-legacy-usage" "FIXME: Update justification, follow aka.ms/tsp/conversion-fix for details"
17-
@Azure.ResourceManager.Legacy.feature(Features.virtualNetwork)
17+
@Azure.ResourceManager.featureFile(Features.virtualNetwork)
1818
@armResourceOperations(#{ omitTags: true })
1919
interface ApplicationSecurityGroups {
2020
/**

0 commit comments

Comments
 (0)