Add ifc label for search_repositories tool#2459
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds IFC (_meta.ifc) annotation to the search_repositories MCP tool output when InsidersMode is enabled, aligning search_repositories with the existing IFC-labeling pattern used across other ingress tools.
Changes:
- Added
ifc.LabelSearchRepositories()returning a constantPublicUntrusted()label for repository search results. - Updated
SearchRepositoriesto attach_meta.ifcon successful responses whendeps.GetFlags(ctx).InsidersModeis true. - Added unit test coverage verifying IFC metadata is omitted when insiders mode is off and present (public/untrusted) when on.
Show a summary per file
| File | Description |
|---|---|
| pkg/ifc/ifc.go | Adds LabelSearchRepositories() helper documenting/encapsulating the label decision for search_repositories. |
| pkg/github/search.go | Attaches _meta.ifc to search_repositories successful results behind InsidersMode. |
| pkg/github/search_test.go | Adds Test_SearchRepositories_IFC_InsidersMode covering both insiders on/off behavior. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 0
6181edd to
5271c51
Compare
86d20eb to
ea5755f
Compare
pachecocordovamoiseseduardo-byte
approved these changes
May 12, 2026
5271c51 to
513d12b
Compare
9568f77 to
ff861d2
Compare
JoannaaKL
previously approved these changes
May 13, 2026
Emits an IFC SecurityLabel on the search_repositories tool result when the InsidersMode flag is enabled, mirroring the pattern landed for get_me (#2432), list_issues (#2453), get_file_contents (#2454), search_issues (#2456), and issue_read (#2457). Search results may span multiple repositories, so the join math (integrity always untrusted; private wins by intersecting collaborator sets across the matched private repos only) is shared with search_issues via ifc.LabelSearchIssues. Visibility is read directly off the search response's repo.Private field — no extra API call. Collaborators are fetched only for private hits, and any failure causes the label to be omitted entirely (consistent with search_issues / issue_read / get_file_contents). Refs github/copilot-mcp-core#1623, github/copilot-mcp-core#1389.
ff861d2 to
d99a34b
Compare
JoannaaKL
approved these changes
May 13, 2026
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.
Emits an IFC
SecurityLabelon thesearch_repositoriestool result when theInsidersModeflag is enabled, mirroring the pattern landed forget_me(#2432),list_issues(#2453),get_file_contents(#2454),search_issues(#2456), andissue_read(#2457).Refs github/copilot-mcp-core#1623, github/copilot-mcp-core#1389. The last ingress tool from #1623's table.
What this PR does
Search results may span multiple repositories, so
_meta.ifcforsearch_repositoriesis the IFC meet of the per-repository labels — same semantics assearch_issues(#2456) after Joanna's review:untrusted(repository names, descriptions, and topics are user-authored).["public"](no data leaked).["public"].If any per-repo collaborators lookup fails, the label is omitted entirely (consistent with
get_file_contents,search_issues, andissue_read) to avoid misclassifying the result.Helper consolidation
The math is identical to
search_issues, so the helper has been renamed and is now shared:ifc.LabelSearchIssues→ifc.LabelSearchMultiRepoinpkg/ifc/ifc.go. Bothsearch_issuesandsearch_repositoriescall the same join function.LabelSearchRepositories()(which returnedPublicUntrusted()).attachSearchRepositoriesIFCLabelinpkg/github/search.goiteratesresult.Repositories, readsrepo.GetPrivate()directly off the search response (no extra visibility API call), and fetches collaborators only for private hits.Cost per request: 0 calls for an all-public result; N calls for N private matches (collaborators only). Cheaper than
search_issuesbecause visibility comes for free on the repository search payload.Tests
Test_SearchRepositories_IFC_InsidersModein pkg/github/search_test.go with 6 subtests mirroring thesearch_issuescoverage:result.Meta == nil.integrity=untrusted,confidentiality=["public"].ifcmeta.["public"].Validation
go test -race ./...— green.gofmt -sclean;go vet ./...clean../script/lintitself fails locally with a pre-existing golangci-lint Go-version mismatch unrelated to this change.)