attachSearchRepositoriesIFCLabel joins per-repository IFC labels across every matched repository and attaches the result to callResult when IFC labels are enabled. Visibility is read directly from the search response — no extra API call. The join math is shared with search_issues via ifc.LabelSearch
(ctx context.Context, deps ToolDependencies, repos []*github.Repository, callResult *mcp.CallToolResult)
| 179 | // feature-flag check is centralized here (mirroring the attach* helpers in |
| 180 | // ifc_labels.go) so the handler can call this unconditionally. |
| 181 | func attachSearchRepositoriesIFCLabel(ctx context.Context, deps ToolDependencies, repos []*github.Repository, callResult *mcp.CallToolResult) { |
| 182 | if callResult == nil || callResult.IsError || !deps.IsFeatureEnabled(ctx, FeatureFlagIFCLabels) { |
| 183 | return |
| 184 | } |
| 185 | |
| 186 | visibilities := make([]bool, 0, len(repos)) |
| 187 | for _, repo := range repos { |
| 188 | visibilities = append(visibilities, repo.GetPrivate()) |
| 189 | } |
| 190 | |
| 191 | setIFCLabel(callResult, ifc.LabelSearchIssues(visibilities)) |
| 192 | } |
| 193 | |
| 194 | // SearchCode creates a tool to search for code across GitHub repositories. |
| 195 | func SearchCode(t translations.TranslationHelperFunc) inventory.ServerTool { |
no test coverage detected