Open
Conversation
Next Steps to MergeNext steps that must be taken to merge this PR:
Comment generated by summarize-checks workflow run. |
Contributor
There was a problem hiding this comment.
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
findAllParentsWithFileand extendssearchRelatedParentFolderswith an optionalfindAllmode. - Enables
findAllfor TypeSpec project detection indetectChangedSpecConfigFiles. - Expands fixtures and tests to cover multi-project v2 layouts under
resource-manager/anddata-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. |
eng/tools/spec-gen-sdk-runner/test/utils/findAllParentsWithFile.test.ts
Outdated
Show resolved
Hide resolved
Contributor
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolved #39974
Key Changes :
Added
findAllParentsWithFilefunction that traverses upward and collects all matching files instead of stopping at the first matchUpdated
searchRelatedParentFoldersfunction with an optionalfindAllparameterThe 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 :