Repository navigation
Add list_code_quality_findings tool to code_quality toolset - #3564
Draft
carogalvin wants to merge 6 commits into
Draft
carogalvin wants to merge 6 commits into
carogalvin wants to merge 6 commits into
Conversation
Add a read-only tool that lists code quality findings for a repository
via GET /repos/{owner}/{repo}/code-quality/findings. It supports the
endpoint's filters: state (open or dismissed, defaulting to open),
direction (asc or desc), and cursor pagination (perPage, after).
The tool follows the list_dependabot_alerts pattern: cursor pagination
schema, defaults stripped from the validation schema, a typed output
with findings and pageInfo, and the same scopes as
get_code_quality_finding. Like get_code_quality_finding, it attaches
no IFC label.
Includes unit tests, the tool snapshot, and regenerated README docs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The endpoint sorts findings by creation date only, so describe the direction values in those terms. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Every tool must be covered by a bundled skill or explicitly exempted. Add list_code_quality_findings as an optional tool of the repository-health-review skill, next to the code scanning and Dependabot alert tools, and mention it in the outstanding-risk step. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
| return utils.NewToolResultErrorFromErr("failed to marshal findings", err), CodeQualityFindingsOutput{}, nil | ||
| } | ||
|
|
||
| return utils.NewToolResultText(string(r)), output, nil |
| } | ||
|
|
||
| response := struct { | ||
| Findings json.RawMessage `json:"findings"` |
Label successful results with ifc.LabelSecurityAlert() (private, untrusted) when the ifc_labels feature flag is enabled, the same label the code scanning, Dependabot and secret scanning tools use. Findings embed file paths and messages derived from repository code, and without a label, clients that enforce IFC have no classification for this data. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
shivamgoswami0212-boop
approved these changes
Nov 18, 2026
| return utils.NewToolResultErrorFromErr("failed to marshal findings", err), CodeQualityFindingsOutput{}, nil | ||
| } | ||
|
|
||
| result := utils.NewToolResultText(string(r)) |
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
Adds a read-only
list_code_quality_findingstool to thecode_qualitytoolset. It lists a repository's code quality findings throughGET /repos/{owner}/{repo}/code-quality/findingsand supports thestateanddirectionfilters plus cursor pagination.Why
Closes #3560
What changed
ListCodeQualityFindingsinpkg/github/code_quality.go, modelled onlist_dependabot_alerts:WithCursorPagination(perPage,after) andNewToolWithSchemaOptions, withValidationInputSchema: inventory.CloneSchemaWithoutDefaults(schema).ReadOnlyHint: true.TOOL_LIST_CODE_QUALITY_FINDINGS_*.ownerandrepoare required.stateacceptsopenordismissedand defaults toopen.directionacceptsascordescand defaults todesc. These are the only filters the endpoint supports.CodeQuality.ListFindings, but the tool sends a rawclient.NewRequestto matchGetCodeQualityFindingand to return the REST JSON unchanged to legacy clients.ListCodeQualityFindingsInputandCodeQualityFindingsOutput(findingspluspageInfo) topkg/github/security_outputs.go:pageInfo.CodeQualityFindingOutputDTO.pkg/github/tools.go, right afterGetCodeQualityFinding.ifc_labelsfeature flag is on, successful results carry theifc.LabelSecurityAlert()IFC label (private, untrusted), the same label the code scanning, Dependabot and secret scanning tools use.Test_ListCodeQualityFindingscovers the toolsnap, schema assertions, defaults, the state and direction filters, cursor passthrough, the returned next cursor, the IFC label, 403 and 404 responses, and missingownerorrepo.Linkheader includes arel="last"link with an emptybefore=value. pageInfo reads cursors only fromrel="next"andrel="prev", so it never returns that empty cursor. A test using the real header shape covers this.list_code_quality_findings.snap, and the README is regenerated.repository-health-reviewbundled skill: added it to the skill's optional tools inpkg/skills/catalog/tools.goand to the skill's outstanding-risk step, next to the code scanning and Dependabot alert tools.MCP impact
list_code_quality_findings. It is in the existingcode_qualitytoolset. There is no feature flag, and the default toolsets are unchanged.Prompts tested (tool changes only)
I tested these against a local build over stdio, using a repository that has Code Quality enabled.
hasNextPage: true, and anextCursor.after): returns the next 5 findings in the same order as the REST API, with both cursors.direction: asc): returns findings in ascending order.failed to list findings for repository 'octocat/Hello-World': ... 404 Not Found.state: closed: schema validation rejects it.Security / limits
get_code_quality_finding:scopes.PublicRead(scopes.Repo), which needs therepoOAuth scope for private repositories.ifc_labelsfeature flag on, results carry theifc.LabelSecurityAlert()IFC label, like the code scanning, Dependabot and secret scanning tools. Findings include file paths and messages derived from repository code, so they are marked untrusted. Private is the cautious choice for who can see them. I confirmed on a live call that the label appears with the flag on and is absent with it off.get_code_quality_findingstill has no IFC label (it merged just after labels were added to the read tools). That can be fixed in a follow-up.Tool renaming
deprecated_tool_aliases.goNote: if you're renaming tools, you must add the tool aliases. For more information on how to do so, please refer to the official docs.
Lint & tests
./script/lint: passed, 0 issues../script/test: passed after mergingmain, includinggo test ./pkg/skills/catalog -run TestCatalogToolRequirementsAreRegistered -count=1.UPDATE_TOOLSNAPS=true go test ./...also passed; it added one new snapshot and changed no others.Docs
script/generate-docs. The only change is the new tool entry.Skills
list_code_quality_findingsto therepository-health-reviewskill as an optional tool, next tolist_code_scanning_alertsandlist_dependabot_alerts. The skill's outstanding-risk step now counts open code quality findings byrule.severity.