- Notifications
You must be signed in to change notification settings - Fork2.7k
Adding comments sorting for list_issues#854
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Pull Request Overview
This PR adds support for sorting issues by comment count in thelist_issues
functionality. The implementation extends the GraphQL query to include comment counts and adds "COMMENTS" as a new ordering option.
- Adds comment count data to the GraphQL issue fragment and response mapping
- Introduces "COMMENTS" as a new sorting option for the
orderBy
parameter - Updates test data to include comment counts for proper test coverage
Reviewed Changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
File | Description |
---|---|
pkg/github/issues.go | Adds comment count field to GraphQL fragment, updates issue mapping, and adds COMMENTS enum option |
pkg/github/issues_test.go | Updates test data with comment counts and GraphQL query strings to match new implementation |
pkg/github/toolsnaps/list_issues.snap | Updates tool snapshot to include COMMENTS in the orderBy enum options |
f818830
intomainUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Summary
This PR adds comment count support to the
list_issues
tool in the GitHub MCP Server, enabling users to view and sort issues by their comment activity.Changes Made
Core Functionality
IssueFragment
struct to include aComments.TotalCount
field that fetches the total number of comments for each issue via GraphQLfragmentToIssue()
function to include the comment count in the returned issue object"COMMENTS"
as a sorting option for theorderBy
parameter in thelist_issues
toolFiles Modified
pkg/github/issues.go
: Core implementation changespkg/github/issues_test.go
: Updated tests with comment count mock data and GraphQL query validationpkg/github/__toolsnaps__/list_issues.snap
: Updated tool snapshot to reflect new enum optionBenefits
Usage Example
Result