Skip to content

Import client.tsp from main.tsp for deploymentStacks, policy, and search (@scope support)#44027

Merged
timotheeguerin merged 6 commits into
Azure:mainfrom
timotheeguerin:tiguerin/import-client-tsp-scope
Jun 17, 2026
Merged

Import client.tsp from main.tsp for deploymentStacks, policy, and search (@scope support)#44027
timotheeguerin merged 6 commits into
Azure:mainfrom
timotheeguerin:tiguerin/import-client-tsp-scope

Conversation

@timotheeguerin

@timotheeguerin timotheeguerin commented Jun 17, 2026

Copy link
Copy Markdown
Member

Progress for Azure/typespec-azure#4564

Summary

Makes main.tsp import ./client.tsp for deploymentStacks, policy, and search, now that the autorest emitter honors the @scope TCGC decorator (Azure/typespec-azure#4565, shipped in @azure-tools/typespec-autorest@0.69.1, upgraded in #44014).

These services' client.tsp declare language-restructured operations via @@scope(...). Previously the autorest emitter ignored @scope and emitted all of them, so main.tsp could not import client.tsp without injecting phantom operations into the swagger (~1300 lines for deploymentStacks, ~840 for policy). With @scope now honored, the scoped-out operations are correctly omitted.

search

search needed a few extra customizations to reach byte-identical output:

  • Added @@scope(..., "!autorest") to the 24 client-only customization operations so the autorest emitter no longer emits them (some had body: void, which previously caused emit failures).
  • Scoped the three SearchResourceEncryptionKey @@clientName renames (keyName/keyVersion/vaultUri) to "!autorest" so they don't leak x-ms-client-name into the swagger.
  • Moved the three client-only models (search-management-request-options, AccessRulePropertiesSubscriptionsItem, SearchServiceNetworkSecurityPerimeterInboundRuleSubscription) into a dedicated top-level SearchClientCustomizations namespace (new client-customizations.tsp). The autorest emitter enumerates all named models in the service namespace when omit-unreachable-types is off; relocating these client-only types keeps them out of the swagger while preserving their names for SDK generation.

Verification

For all three services, regenerating with the autorest emitter produces swagger byte-identical to what is checked in, across all API versions, and compiles cleanly under --warn-as-error. Only .tsp files change; no generated swagger changes.

Related

Part of the effort to make main.tsp the single TypeSpec compilation entry point. Companion PR #44009 covers services that work with omit-unreachable-types.

@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ This PR targets either the main branch of the public specs repo or the RPSaaSMaster branch of the private specs repo. These branches are not intended for iterative development. Therefore, you must acknowledge you understand that after this PR is merged, the APIs are considered shipped to Azure customers. Any further attempts at in-place modifications to the APIs will be subject to Azure's versioning and breaking change policies. Additionally, for control plane APIs, you must acknowledge that you are following all the best practices documented by ARM at aka.ms/armapibestpractices. If you do intend to release the APIs to your customers by merging this PR, add the PublishToCustomers label to your PR in acknowledgement of the above. Otherwise, retarget this PR onto a feature branch, i.e. with prefix release- (see aka.ms/azsdk/api-versions#release--branches).
  • ❌ This PR is in purview of the ARM review (label: ARMReview). This PR must get ARMSignedOff label from an ARM reviewer.
    This PR is awaiting ARM reviewer feedback (label: WaitForARMFeedback).
    To learn when this PR will get reviewed, see ARM review queue at aka.ms/azsdk/pr-arm-review
    For details of the ARM review, see aka.ms/azsdk/pr-arm-review


Comment generated by summarize-checks workflow run.

@github-actions github-actions Bot added resource-manager TypeSpec Authored with TypeSpec labels Jun 17, 2026
@timotheeguerin timotheeguerin changed the title Import client.tsp from main.tsp for deploymentStacks (@scope support) Import client.tsp from main.tsp for deploymentStacks and policy (@scope support) Jun 17, 2026
@github-actions

github-actions Bot commented Jun 17, 2026

Copy link
Copy Markdown

API Change Check

APIView identified API level changes in this PR and created the following API reviews

Language API Review for Package
TypeSpec Microsoft.Resources.DeploymentStacks
TypeSpec Microsoft.Authorization
Go sdk/resourcemanager/resources/armpolicy
JavaScript @azure/arm-policy
Java com.azure.resourcemanager:azure-resourcemanager-resources-policy
C# Azure.ResourceManager.Resources.Policy
Python azure-mgmt-resource-policy
Python azure-mgmt-resource-deploymentstacks
TypeSpec Microsoft.Search
JavaScript @azure/arm-search
Python azure-mgmt-search

Comment generated by After APIView workflow run.

@timotheeguerin timotheeguerin changed the title Import client.tsp from main.tsp for deploymentStacks and policy (@scope support) Import client.tsp from main.tsp for deploymentStacks, policy, and search (@scope support) Jun 17, 2026
@timotheeguerin timotheeguerin merged commit 09f3658 into Azure:main Jun 17, 2026
59 of 61 checks passed
@timotheeguerin timotheeguerin deleted the tiguerin/import-client-tsp-scope branch June 17, 2026 14:37
@github-actions github-actions Bot added ARMReview WaitForARMFeedback <valid label in PR review process> add this label when ARM review is required labels Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants