Skip to content

Add @featureFile decorators in Azure.ResourceManager and fix template suppression propagation#4664

Open
markcowl wants to merge 2 commits into
Azure:release/june-2026from
markcowl:markcowl/move-feature-fix-suppression
Open

Add @featureFile decorators in Azure.ResourceManager and fix template suppression propagation#4664
markcowl wants to merge 2 commits into
Azure:release/june-2026from
markcowl:markcowl/move-feature-fix-suppression

Conversation

@markcowl

@markcowl markcowl commented Jun 19, 2026

Copy link
Copy Markdown
Member

Changes

New decorators in Azure.ResourceManager namespace

Adds new decorators as alternatives to the Legacy versions:

  • @featureFiles\ (replaces @Azure.ResourceManager.Legacy.features)
  • @featureFile\ (replaces @Azure.ResourceManager.Legacy.feature)
  • @featureFileOptions\ (replaces @Azure.ResourceManager.Legacy.featureOptions)

The Legacy decorators remain unchanged for backward compatibility.

Fix @customAzureResource suppression propagation

Adjusts the \�rm-custom-resource-usage-discourage\ linter rule so that if a @@Suppress\ directive is applied to a model template with @customAzureResource, the suppression propagates to all instantiations of that template.

Files changed

  • \lib/decorators.tsp\ - New decorator declarations
  • \generated-defs/Azure.ResourceManager.ts\ - New type definitions
  • \src/resource.ts\ - New exports delegating to existing implementations
  • \src/tsp-index.ts\ - New decorator registrations
  • \src/rules/arm-custom-resource-usage-discourage.ts\ - Suppression propagation logic
  • Tests, README, and reference docs updated

@markcowl markcowl requested a review from bterlson as a code owner June 19, 2026 00:24
@markcowl markcowl added the int:azure-specs Run integration tests against azure-rest-api-specs label Jun 19, 2026
@markcowl markcowl requested a review from timotheeguerin as a code owner June 19, 2026 00:24
@markcowl markcowl added the int:azure-specs Run integration tests against azure-rest-api-specs label Jun 19, 2026
@microsoft-github-policy-service microsoft-github-policy-service Bot added lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library emitter:autorest Issues for @azure-tools/typespec-autorest emitter meta:website TypeSpec.io updates labels Jun 19, 2026
@azure-sdk

azure-sdk commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

❌ There is undocummented changes. Run chronus add to add a changeset or click here.

The following packages have changes but are not documented.

  • @azure-tools/typespec-client-generator-core
  • @azure-tools/typespec-ts

The following packages have already been documented:

  • @azure-tools/typespec-autorest
  • @azure-tools/typespec-azure-resource-manager
  • @azure-tools/typespec-azure-rulesets
Show changes

@azure-tools/typespec-azure-resource-manager - feature ✏️

Add @featureFile, @featureFiles, and @featureFileOptions decorators in Azure.ResourceManager namespace as alternatives to the Legacy @feature, @features, and @featureOptions decorators. Add arm-feature-file-usage-discourage linting rule. Fix arm-custom-resource-usage-discourage rule to propagate suppressions from model templates to their instantiations.

@azure-tools/typespec-autorest - feature ✏️

Add @featureFile, @featureFiles, and @featureFileOptions decorators in Azure.ResourceManager namespace as alternatives to the Legacy @feature, @features, and @featureOptions decorators. Add arm-feature-file-usage-discourage linting rule. Fix arm-custom-resource-usage-discourage rule to propagate suppressions from model templates to their instantiations.

@azure-tools/typespec-azure-rulesets - feature ✏️

Add @featureFile, @featureFiles, and @featureFileOptions decorators in Azure.ResourceManager namespace as alternatives to the Legacy @feature, @features, and @featureOptions decorators. Add arm-feature-file-usage-discourage linting rule. Fix arm-custom-resource-usage-discourage rule to propagate suppressions from model templates to their instantiations.

@pkg-pr-new

pkg-pr-new Bot commented Jun 19, 2026

Copy link
Copy Markdown

Open in StackBlitz

@azure-tools/typespec-autorest

npm i https://pkg.pr.new/@azure-tools/typespec-autorest@4664

@azure-tools/typespec-azure-resource-manager

npm i https://pkg.pr.new/@azure-tools/typespec-azure-resource-manager@4664

@azure-tools/typespec-azure-rulesets

npm i https://pkg.pr.new/@azure-tools/typespec-azure-rulesets@4664

@azure-tools/typespec-client-generator-core

npm i https://pkg.pr.new/@azure-tools/typespec-client-generator-core@4664

@azure-tools/typespec-ts

npm i https://pkg.pr.new/@azure-tools/typespec-ts@4664

commit: 05b35bd

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

⚡ Benchmark Results

⚠️ 6 metric(s) regressed above the +5% threshold:

Metric Baseline Current Change
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🟡 19.0ms 🔴 23.2ms +22.1% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🟡 19.9ms 🔴 21.9ms +9.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 14.0ms 🟡 15.4ms +9.8% 🔴
emit 🔴 4.53s 🔴 5.96s +31.6% 🔴
 ↳ emit/@azure-tools/typespec-python 🔴 3.35s 🔴 4.43s +32.5% 🔴
 ↳ emit/@typespec/http-client-js 🔴 875.8ms 🔴 1.08s +22.9% 🔴
Full details – comparing 46f6442 vs baseline 1a09577
Metric Baseline Current Change
total 🔴 757.7ms 🔴 675.4ms -10.9% 🟢
loader 🟡 224.0ms 🟡 214.0ms -4.5%
resolver 🟢 32.7ms 🟢 17.7ms -45.7% 🟢
checker 🟡 274.9ms 🟡 200.4ms -27.1% 🟢
validation 🟢 67.1ms 🟢 41.0ms -38.9% 🟢
 ↳ validation/@azure-tools/typespec-azure-core 🟢 9.2ms 🟢 6.8ms -26.4% 🟢
 ↳ validation/@typespec/http 🟡 11.7ms 🟢 6.0ms -48.9% 🟢
 ↳ validation/@typespec/rest 🟢 1.3ms 🟢 0.5ms -63.9%
 ↳ validation/@typespec/versioning 🔴 41.7ms 🔴 25.9ms -37.9% 🟢
 ↳ validation/compiler 🟢 3.1ms 🟢 1.3ms -57.2% 🟢
linter 🟢 158.8ms 🟢 145.4ms -8.5% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/auth-required 🟢 0.1ms 🟢 0.0ms -77.5%
 ↳ linter/@azure-tools/typespec-azure-core/bad-record-type 🟢 0.5ms 🟢 0.2ms -54.4%
 ↳ linter/@azure-tools/typespec-azure-core/byos 🟢 6.3ms 🟢 6.4ms +1.3%
 ↳ linter/@azure-tools/typespec-azure-core/casing-style 🟢 1.1ms 🟢 0.8ms -30.6%
 ↳ linter/@azure-tools/typespec-azure-core/composition-over-inheritance 🟢 0.1ms 🟢 0.1ms -54.3%
 ↳ linter/@azure-tools/typespec-azure-core/documentation-required 🟢 1.7ms 🟢 0.8ms -53.1%
 ↳ linter/@azure-tools/typespec-azure-core/friendly-name 🟢 1.7ms 🟢 0.6ms -64.8% 🟢
 ↳ linter/@azure-tools/typespec-azure-core/key-visibility-required 🟢 0.3ms 🟢 0.2ms -39.1%
 ↳ linter/@azure-tools/typespec-azure-core/known-encoding 🟢 0.4ms 🟢 0.3ms -17.4%
 ↳ linter/@azure-tools/typespec-azure-core/long-running-polling-operation-required 🟢 0.6ms 🟢 0.3ms -50.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-case-mismatch 🟢 0.5ms 🟢 0.2ms -55.6%
 ↳ linter/@azure-tools/typespec-azure-core/no-closed-literal-union 🟢 0.8ms 🟢 0.2ms -68.5%
 ↳ linter/@azure-tools/typespec-azure-core/no-enum 🟢 0.2ms 🟢 0.0ms -77.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-error-status-codes 🟢 0.2ms 🟢 0.1ms -51.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-explicit-routes-resource-ops 🟢 0.1ms 🟢 0.1ms -28.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-format 🟢 0.6ms 🟢 0.6ms -7.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-generic-numeric 🟢 0.7ms 🟢 0.5ms -27.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-header-explode 🟡 19.0ms 🔴 23.2ms +22.1% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-legacy-usage 🟢 1.6ms 🟢 1.1ms -28.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-multiple-discriminator 🟢 0.2ms 🟢 0.1ms -52.4%
 ↳ linter/@azure-tools/typespec-azure-core/no-nullable 🟢 0.3ms 🟢 0.2ms -23.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-offsetdatetime 🟢 1.5ms 🟢 1.2ms -16.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-openapi 🟢 1.8ms 🟢 2.0ms +7.1%
 ↳ linter/@azure-tools/typespec-azure-core/no-private-usage 🟢 2.5ms 🟢 1.8ms -26.7%
 ↳ linter/@azure-tools/typespec-azure-core/no-query-explode 🟡 19.9ms 🔴 21.9ms +9.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-core/no-response-body 🔴 24.4ms 🔴 24.7ms +1.3%
 ↳ linter/@azure-tools/typespec-azure-core/no-rest-library-interfaces 🟢 0.1ms 🟢 0.0ms -80.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-route-parameter-name-mismatch 🟢 5.5ms 🟢 5.7ms +4.0%
 ↳ linter/@azure-tools/typespec-azure-core/no-rpc-path-params 🟢 0.3ms 🟢 0.2ms -28.8%
 ↳ linter/@azure-tools/typespec-azure-core/no-string-discriminator 🟢 0.1ms 🟢 0.0ms -57.2%
 ↳ linter/@azure-tools/typespec-azure-core/no-unknown 🟢 0.3ms 🟢 0.2ms -21.9%
 ↳ linter/@azure-tools/typespec-azure-core/no-unnamed-union 🟢 0.6ms 🟢 0.3ms -43.0%
 ↳ linter/@azure-tools/typespec-azure-core/operation-missing-api-version 🟢 0.3ms 🟢 0.2ms -48.0%
 ↳ linter/@azure-tools/typespec-azure-core/request-body-problem 🟢 0.4ms 🟢 0.3ms -23.5%
 ↳ linter/@azure-tools/typespec-azure-core/require-versioned 🟢 0.0ms 🟢 0.0ms -85.6%
 ↳ linter/@azure-tools/typespec-azure-core/response-schema-problem 🔴 24.1ms 🔴 24.6ms +1.9%
 ↳ linter/@azure-tools/typespec-azure-core/rpc-operation-request-body 🟢 0.5ms 🟢 0.3ms -31.9%
 ↳ linter/@azure-tools/typespec-azure-core/spread-discriminated-model 🟢 0.4ms 🟢 0.3ms -20.7%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-names 🟢 5.4ms 🟢 5.9ms +7.8%
 ↳ linter/@azure-tools/typespec-azure-core/use-standard-operations 🟢 0.2ms 🟢 0.1ms -31.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-child-resources 🟢 9.1ms 🟢 4.1ms -54.6% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-agent-base-type-lifecycle-operations 🟢 0.2ms 🟢 0.0ms -96.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-common-types-version 🟢 8.2ms 🟢 4.2ms -49.1% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-key 🟢 0.2ms 🟢 0.1ms -39.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-custom-resource-usage-discourage 🟢 0.1ms 🟢 0.1ms -39.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-delete-operation-response-codes 🟢 4.2ms 🟢 1.1ms -73.5% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-feature-file-usage-discourage 🟢 0.0ms 🟢 0.0ms +100.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-path-casing-conflicts 🟡 11.6ms 🟢 4.5ms -60.8% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-no-record 🟢 0.5ms 🟢 0.4ms -30.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-post-operation-response-codes 🟢 1.4ms 🟢 0.5ms -66.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-put-operation-response-codes 🟢 0.2ms 🟢 0.0ms -91.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-action-no-segment 🟢 0.4ms 🟢 0.2ms -33.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-duplicate-property 🟢 0.3ms 🟢 0.1ms -56.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-interface-requires-decorator 🟢 0.1ms 🟢 0.0ms -85.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-action-verb 🟢 0.1ms 🟢 0.1ms -33.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-envelope-property 🟢 0.2ms 🟢 0.1ms -52.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-invalid-version-format 🟢 0.2ms 🟢 0.0ms -76.5%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-key-invalid-chars 🟢 0.3ms 🟢 0.3ms -25.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-name-pattern 🟢 0.1ms 🟢 0.0ms -91.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation 🟢 0.4ms 🟢 0.2ms -62.3%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-operation-response 🟢 6.9ms 🟢 4.8ms -31.0% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-patch 🟢 0.7ms 🟢 0.3ms -53.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-path-segment-invalid-chars 🟢 0.3ms 🟢 0.2ms -31.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/arm-resource-provisioning-state 🟢 0.3ms 🟢 0.1ms -69.0%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/beyond-nesting-levels 🟢 0.2ms 🟢 0.1ms -45.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/empty-updateable-properties 🟢 0.3ms 🟢 0.2ms -49.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/improper-subscription-list-operation 🟢 0.1ms 🟢 0.0ms -94.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/lro-location-header 🟡 14.0ms 🟡 15.4ms +9.8% 🔴
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-operations-endpoint 🟢 0.1ms 🟢 0.0ms -80.7%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/missing-x-ms-identifiers 🟢 0.8ms 🟢 0.3ms -67.4%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-empty-model 🟢 0.2ms 🟢 0.1ms -38.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-override-props 🟢 0.2ms 🟢 0.1ms -73.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-resource-delete-operation 🟢 0.3ms 🟢 0.2ms -36.8%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/no-response-body 🔴 21.7ms 🔴 22.2ms +2.6%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/patch-envelope 🟢 0.3ms 🟢 0.1ms -50.1%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/resource-name 🟢 0.3ms 🟢 0.2ms -53.9%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/secret-prop 🟢 4.1ms 🟢 1.9ms -54.1% 🟢
 ↳ linter/@azure-tools/typespec-azure-resource-manager/unsupported-type 🟢 0.5ms 🟢 0.4ms -29.2%
 ↳ linter/@azure-tools/typespec-azure-resource-manager/version-progression 🟢 0.2ms 🟢 0.0ms -88.0%
 ↳ linter/@azure-tools/typespec-client-generator-core/property-name-conflict 🟢 1.8ms 🟢 1.1ms -36.4%
 ↳ linter/@azure-tools/typespec-client-generator-core/require-client-suffix 🟢 1.3ms 🟢 0.2ms -87.3% 🟢
emit 🔴 4.53s 🔴 5.96s +31.6% 🔴
 ↳ emit/@azure-tools/typespec-autorest 🟢 194.6ms 🟢 165.7ms -14.9% 🟢
 ↳ emit/@azure-tools/typespec-python 🔴 3.35s 🔴 4.43s +32.5% 🔴
 ↳ emit/@typespec/http-client-js 🔴 875.8ms 🔴 1.08s +22.9% 🔴
 ↳ emit/@typespec/openapi3 🟢 164.1ms 🟢 152.4ms -7.1% 🟢
 ↳ emit/@typespec/openapi3/compute 🟢 142.6ms 🟢 135.3ms -5.1% 🟢
 ↳ emit/@typespec/openapi3/write 🟢 21.0ms 🟢 16.9ms -19.6% 🟢

Averaged across 3 specs (azure-arm-resource-manager, azure-core-dataplane, azure-full).
Threshold: changes > ±5% are highlighted.
🟢 Fast · 🟡 Moderate (stages >200ms, rules >10ms) · 🔴 Slow (stages >400ms, rules >20ms)

@azure-sdk

Copy link
Copy Markdown
Collaborator

You can try these changes here

🛝 Playground 🌐 Website

Comment thread .chronus/changes/markcowl-move-feature-fix-suppression-2026-5-18-16-41-6.md Outdated
Comment thread .chronus/changes/markcowl-move-feature-fix-suppression-2026-5-18-16-41-6.md Outdated
@markcowl markcowl force-pushed the markcowl/move-feature-fix-suppression branch from 01d1643 to f493b8e Compare June 30, 2026 01:29
markcowl added a commit to markcowl/azure-rest-api-specs that referenced this pull request Jun 30, 2026
…nager namespace

Replace all usages of Legacy decorators with new Azure.ResourceManager equivalents:
- @Azure.ResourceManager.Legacy.features -> @Azure.ResourceManager.featureFiles
- @Azure.ResourceManager.Legacy.feature -> @Azure.ResourceManager.featureFile
- @Azure.ResourceManager.Legacy.featureOptions -> @Azure.ResourceManager.featureFileOptions

Updated package.json to use PR build packages from Azure/typespec-azure#4664:
- @azure-tools/typespec-azure-resource-manager
- @azure-tools/typespec-autorest
- @azure-tools/typespec-azure-rulesets

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@markcowl markcowl changed the title Move @feature decorator to Azure.ResourceManager namespace and fix template suppression propagation Add @featureFile decorators in Azure.ResourceManager and fix template suppression propagation Jun 30, 2026
@markcowl markcowl force-pushed the markcowl/move-feature-fix-suppression branch 2 times, most recently from c2ff354 to 1cd0dd6 Compare June 30, 2026 03:38
… suppression propagation

- Add @featureFile, @featureFiles, @featureFileOptions decorators in Azure.ResourceManager
  namespace as alternatives to the Legacy @feature, @features, @featureOptions decorators
- Fix arm-custom-resource-usage-discourage rule to propagate suppressions from model
  templates to their instantiations
- Regenerate reference docs
- Update tests to use new decorator names

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@markcowl markcowl force-pushed the markcowl/move-feature-fix-suppression branch from 1cd0dd6 to 0dc60f5 Compare June 30, 2026 21:36
@markcowl

Copy link
Copy Markdown
Member Author

Note: will follow up with deprecation of the old decorators next sprint, and removal afterward.

…ons check

The hasSuppressedCustomResourceTemplate function no longer requires
getCustomResourceOptions on the template instance itself. Since the
outer guard already checks isCustomAzureResource (which walks the
baseModel chain), we only need to find a template instance in the
chain with the suppression directive.

This enables suppression propagation through templates that inherit
@customAzureResource via extends rather than having it directly.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

emitter:autorest Issues for @azure-tools/typespec-autorest emitter int:azure-specs Run integration tests against azure-rest-api-specs lib:azure-resource-manager Issues for @azure-tools/typespec-azure-core library linter Issues related to linter rules meta:website TypeSpec.io updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[design]: Remove need to use legacy and private decorators in Network spec

3 participants