Add 'Show only files owned by you' CODEOWNERS filter#8542
Draft
smith wants to merge 1 commit intomicrosoft:mainfrom
Draft
Add 'Show only files owned by you' CODEOWNERS filter#8542smith wants to merge 1 commit intomicrosoft:mainfrom
smith wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Implements the CODEOWNERS-based file filter requested in microsoft#6624. Adds a toggle button to the Changes in Pull Request tree view that filters files to show only those owned by the authenticated user according to the repository's CODEOWNERS file. - New CODEOWNERS parser (src/common/codeowners.ts) that handles GitHub's pattern syntax: anchored/unanchored paths, wildcards, directory patterns, and character classes. - GitHubRepository gains getCodeownersEntries() to fetch and cache CODEOWNERS from .github/CODEOWNERS, CODEOWNERS, or docs/CODEOWNERS, and getAuthenticatedUserTeamSlugs() for @org/team matching. - FilesCategoryNode applies the filter in getChildren(), composable with the existing "hide viewed files" filter. - New setting githubPullRequests.showOnlyOwnedFiles (default false) and command pr.toggleShowOnlyOwnedFiles with $(person) icon. Closes microsoft#6624 Co-authored-by: Cursor <cursoragent@cursor.com>
bfe52a3 to
0a03700
Compare
Author
|
@microsoft-github-policy-service agree company="Elastic" |
Author
|
@alexr00 this should remain a draft. It's a very basic approach that probably needs more thought. If it's noisy having an open draft pr it's ok to close it. |
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.
Summary
Implements the CODEOWNERS-based file filter requested in #6624.
githubPullRequests.showOnlyOwnedFilessetting (defaultfalse) andpr.toggleShowOnlyOwnedFilescommand.Implementation details
src/common/codeowners.ts): Parses GitHub's CODEOWNERS format — handles anchored/unanchored paths,*/**wildcards, directory patterns,?single-char, and[...]character classes. No new dependencies; uses a custom glob-to-regex converter.GitHubRepository.getCodeownersEntries(ref)fetches and caches the CODEOWNERS file (checks.github/CODEOWNERS,CODEOWNERS,docs/CODEOWNERS).getAuthenticatedUserTeamSlugs()fetches the user's org team memberships for@org/teampattern matching.FilesCategoryNode.filterByCodeowners()applies the filter duringgetChildren(), matching each file's path against the parsed CODEOWNERS entries and checking ownership against the current user's login and team slugs.Screenshot reference
The feature mirrors GitHub.com's "Only files owned by you" filter in the Files Changed tab:
Test plan
@org/team) resolves correctly whenread:orgscope is availableCloses #6624
Made with Cursor