Repository navigation
Scope content exclusion path rules to their repository - #339415
Merged
Logan Ramos (lramos15) merged 2 commits intoOct 14, 2026
Merged
Logan Ramos (lramos15) merged 2 commits into
Logan Ramos (lramos15) merged 2 commits into
Conversation
Path globs from every cached repository were flattened into a single list, so a nested repo with `paths: ["*"]` caused Copilot to exclude every file in a multi-repo workspace. - Store compiled globs per repository fetch URL and only test a file against globs from its own repositories plus org-wide (non-git) rules. - `asMinimatchPatterns` now returns only org-wide patterns; repo-scoped rules are enforced per result. - `SearchServiceImpl.findFiles` searches with the requested limit first and only re-searches unbounded when a full page lost results to filtering.
Contributor
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Case-distinct repositories can bypass exclusions, and search retries retain provider caps while causing excessive filtering work.
Review effort: Balanced
Findings: 1
Open (3)
What changed in this PR
Scopes Copilot content exclusions to their repositories, addressing unrelated files being excluded in multi-repository workspaces.
Changes:
- Compiles repository-specific rules separately from organization-wide rules.
- Retries file searches when exclusions consume the requested result limit.
- Adds regression tests for repository isolation and search limits.
| File | Description |
|---|---|
| extensions/copilot/src/platform/search/vscode-node/test/searchServiceImpl.spec.ts | Tests filtered limits and repository isolation. |
| extensions/copilot/src/platform/search/vscode-node/searchServiceImpl.ts | Retries searches to replenish filtered results. |
| extensions/copilot/src/platform/ignore/node/test/remoteContentExclusion.spec.ts | Tests repository-scoped and organization-wide rules. |
| extensions/copilot/src/platform/ignore/node/remoteContentExclusion.ts | Selects exclusion patterns by repository. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
…citly - Only ignore case when comparing repository roots where the file system does, so case-distinct repos on Linux keep their own exclusion rules. - Widen findFiles retries with explicit limits, since search providers cap an unset limit at 20,000, and stop once the caller's quota is met.
Author
|
Logan Ramos (@lramos15) I reviewed the Copilot PR feedback, applied the fixes, and re-tested the fix locally. Let me know if you have any questions |
Logan Ramos (lramos15)
approved these changes
Oct 14, 2026
roblourens
approved these changes
Oct 14, 2026
Vritant Bhardwaj (vritant24)
approved these changes
Oct 14, 2026
Spencer Williams (sw23)
deleted the
sw23/content-exclusion-repo-scoping
branch
October 20, 2026 18:39
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.


Path globs from every cached repository were flattened into a single list, so a nested repo with
paths: ["*"]caused Copilot to exclude every file in a multi-repo workspace.asMinimatchPatternsnow returns only org-wide patterns; repo-scoped rules are enforced per result.SearchServiceImpl.findFilessearches with the requested limit first and only re-searches unbounded when a full page lost results to filtering.Fixes #338368
I performed a before/after test and confirm this fix works