Skip to content

Added support for multiple services scenario#40236

Open
raych1 wants to merge 3 commits intomainfrom
users/raych1/support-multiple-services
Open

Added support for multiple services scenario#40236
raych1 wants to merge 3 commits intomainfrom
users/raych1/support-multiple-services

Conversation

@raych1
Copy link
Member

@raych1 raych1 commented Feb 6, 2026

Resolved #39974

Key Changes :

  • Added findAllParentsWithFile function that traverses upward and collects all matching files instead of stopping at the first match

  • Updated searchRelatedParentFolders function with an optional findAll parameter

  • The new traversal logic is used when using the V2 folder structure, and t old folder structures (without resource-manager/data-plane) remain unchanged

Test PRs :

@raych1 raych1 self-assigned this Feb 6, 2026
@github-actions
Copy link

github-actions bot commented Feb 6, 2026

Next Steps to Merge

Next steps that must be taken to merge this PR:
  • ❌ The required check named Protected Files has failed. Refer to the check in the PR's 'Checks' tab for details on how to fix it and consult the aka.ms/ci-fix guide


Comment generated by summarize-checks workflow run.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds multi-project support for TypeSpec “folder structure v2” in spec-gen-sdk-runner by allowing upward traversal to collect all matching tspconfig.yaml parents (instead of only the nearest), enabling SDK automation to react to changes at multiple service/subservice layers.

Changes:

  • Introduces findAllParentsWithFile and extends searchRelatedParentFolders with an optional findAll mode.
  • Enables findAll for TypeSpec project detection in detectChangedSpecConfigFiles.
  • Expands fixtures and tests to cover multi-project v2 layouts under resource-manager/ and data-plane/.

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
eng/tools/spec-gen-sdk-runner/src/utils.ts Adds findAllParentsWithFile and findAll support in searchRelatedParentFolders.
eng/tools/spec-gen-sdk-runner/src/spec-helpers.ts Enables findAll: true when detecting changed TypeSpec configs.
eng/tools/spec-gen-sdk-runner/test/utils/utils.test.ts Updates recursive tspconfig discovery expectations for expanded fixtures.
eng/tools/spec-gen-sdk-runner/test/utils/searchRelatedParentFolders.test.ts Adds coverage for findAll behavior in v2-like paths and preserves default behavior tests.
eng/tools/spec-gen-sdk-runner/test/utils/findAllParentsWithFile.test.ts New tests for the new upward traversal helper.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/Service1/tspconfig.yaml Adds v2 fixture: service-level tspconfig.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/Service1/main.tsp Adds v2 fixture: service-level TypeSpec file.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/Service1/SubService2/tspconfig.yaml Adds v2 fixture: subservice tspconfig.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/Service1/SubService2/bar.tsp Adds v2 fixture: subservice TypeSpec file.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/Service1/SubService1/tspconfig.yaml Adds v2 fixture: subservice tspconfig.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/resource-manager/Microsoft.Contoso/Service1/SubService1/foo.tsp Adds v2 fixture: subservice TypeSpec file.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/data-plane/DataPlaneService/tspconfig.yaml Adds v2 fixture: data-plane service-level tspconfig.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/data-plane/DataPlaneService/main.tsp Adds v2 fixture: data-plane service-level TypeSpec file.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/data-plane/DataPlaneService/DataPlaneSubService/widget.tsp Adds v2 fixture: data-plane subservice TypeSpec file.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/data-plane/DataPlaneService/DataPlaneSubService/tspconfig.yaml Adds v2 fixture: data-plane subservice tspconfig.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/Contoso.Management/NestedService/tspconfig.yaml Adds fixture to validate findAll isn’t applied to non-v2 paths.
eng/tools/spec-gen-sdk-runner/test/fixtures/specification/contosowidgetmanager/Contoso.Management/NestedService/foo.tsp Adds fixture TypeSpec file for nested service test setup.

Copy link
Contributor

Copilot AI commented Feb 7, 2026

@raych1 I've opened a new pull request, #40238, to work on those changes. Once the pull request is ready, I'll request review from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE REQ] SDK Automation to support Folder Structure v2 Multi-Project

2 participants