Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Merged
MattBabbage merged 1 commit intomainfromfix/add-comment-sorting-to-list-issues
Aug 11, 2025

Conversation

MattBabbage
Copy link
Contributor

@MattBabbageMattBabbage commentedAug 11, 2025
edited
Loading

Summary

This PR adds comment count support to thelist_issues tool in the GitHub MCP Server, enabling users to view and sort issues by their comment activity.

Changes Made

Core Functionality

  • Added comment count field: ModifiedIssueFragment struct to include aComments.TotalCount field that fetches the total number of comments for each issue via GraphQL
  • Enhanced issue data: UpdatedfragmentToIssue() function to include the comment count in the returned issue object
  • New sorting option: Added"COMMENTS" as a sorting option for theorderBy parameter in thelist_issues tool

Files Modified

  • pkg/github/issues.go: Core implementation changes
  • pkg/github/issues_test.go: Updated tests with comment count mock data and GraphQL query validation
  • pkg/github/__toolsnaps__/list_issues.snap: Updated tool snapshot to reflect new enum option

Benefits

  • Enhanced issue prioritization: Users can now sort issues by engagement level (comment count) to identify the most discussed or problematic issues
  • Better context: Comment counts provide immediate insight into issue activity without needing to fetch comments separately
  • Improved workflow: Enables data-driven approaches to issue triage and management

Usage Example

// Sort issues by comment count (most commented first)list_issues({  owner: "github",  repo: "github-mcp-server",   orderBy: "COMMENTS",  direction: "DESC"})

Result

image

@MattBabbageMattBabbage requested a review froma team as acode ownerAugust 11, 2025 14:14
@CopilotCopilotAI review requested due to automatic review settingsAugust 11, 2025 14:14
Copy link
Contributor

@CopilotCopilotAI left a 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 theorderBy 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.

FileDescription
pkg/github/issues.goAdds comment count field to GraphQL fragment, updates issue mapping, and adds COMMENTS enum option
pkg/github/issues_test.goUpdates test data with comment counts and GraphQL query strings to match new implementation
pkg/github/toolsnaps/list_issues.snapUpdates tool snapshot to include COMMENTS in the orderBy enum options

@MattBabbageMattBabbage merged commitf818830 intomainAug 11, 2025
16 checks passed
@MattBabbageMattBabbage deleted the fix/add-comment-sorting-to-list-issues branchAugust 11, 2025 14:48
nickytonline pushed a commit to nickytonline/github-mcp-http that referenced this pull requestOct 4, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@LuluBeatsonLuluBeatsonLuluBeatson approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@MattBabbage@LuluBeatson

[8]ページ先頭

©2009-2025 Movatter.jp