feat: Add hierarchical .roo configuration resolution for mono-repos #8826
+364
−70
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.
Description
This PR implements hierarchical configuration resolution for .roo directories and .roomodes files in mono-repositories, addressing Issue #8825.
Problem
In mono-repository setups, the current .roo resolution only checks global (~/.roo) and workspace-local directories. This makes it challenging to manage configurations for projects with multiple tech stacks and nested workspace structures.
Solution
This implementation introduces hierarchical directory walking, similar to .editorconfig and nuget.config behavior. The configuration system now:
Changes
Core Implementation
getRooDirectoriesForCwd()insrc/services/roo-config/index.tsto support hierarchical resolutionCustomModesManagerto handle multiple .roomodes files in the hierarchygetHierarchicalRoomodes()method for discovering .roomodes files up the directory treeKey Features
enableHierarchicalparameter (defaults to true)Testing
src/services/roo-config/__tests__/hierarchical-resolution.spec.tsExample
For a project structure:
The resolution order is now:
Breaking Changes
None - the feature is enabled by default but maintains full backward compatibility.
Testing Instructions
enableHierarchical: falseto verify legacy behaviorFixes #8825
Important
Adds hierarchical resolution for
.roodirectories and.roomodesfiles, allowing configurations to be resolved from global to specific in mono-repos, with backward compatibility..roodirectories and.roomodesfiles inCustomModesManagerandgetRooDirectoriesForCwd().enableHierarchicalflag (default true).getHierarchicalRoomodes()inCustomModesManagercollects.roomodesfiles up the directory tree.getRooDirectoriesForCwd()inindex.tsresolves directories hierarchically.hierarchical-resolution.spec.tsfor comprehensive testing of hierarchical resolution.index.spec.tsto ensure backward compatibility.This description was created by
for 1b499c4. You can customize this summary. It will automatically update as commits are pushed.