Skip to content

Add support for retrieving GitHub Issue Comments #106

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Apr 7, 2025

Conversation

almostwhitehat
Copy link
Contributor

Add new tool 'get_issue_comments' that allows fetching comments associated with GitHub issues. This complements the existing issue retrieval functionality and follows the same patterns as the pull request comments implementation.

The implementation includes:

  • New getIssueComments function in pkg/github/issues.go
  • Tool registration in server.go
  • Comprehensive test coverage in issues_test.go

Add new tool 'get_issue_comments' that allows fetching comments associated
with GitHub issues. This complements the existing issue retrieval functionality
and follows the same patterns as the pull request comments implementation.

The implementation includes:
- New getIssueComments function in pkg/github/issues.go
- Tool registration in server.go
- Comprehensive test coverage in issues_test.go
Copy link
Collaborator

@juruen juruen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First of all, thank you so much for your contribution!

This is looking good, I just added a comment about adding proper pagination support.

Comment on lines 631 to 635
opts := &github.IssueListCommentsOptions{
ListOptions: github.ListOptions{
PerPage: 100,
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, let's add proper support for pagination. That is, let's make the tool take page, and perPage. Take a look at listCommits if you want to see an example.

To be consistent, use 30 as the default page size.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤦 Great catch - I added pagination with a default perPage of 30, and added tests for it!

@almostwhitehat almostwhitehat requested a review from juruen April 5, 2025 21:14
Copy link
Collaborator

@juruen juruen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, thank so much for your work here! 🚀

@juruen juruen merged commit c77ea94 into github:main Apr 7, 2025
9 checks passed
manian0430 pushed a commit to ChrisLally/github-mcp-server that referenced this pull request Apr 12, 2025
* Add support for retrieving GitHub Issue Comments

Add new tool 'get_issue_comments' that allows fetching comments associated
with GitHub issues. This complements the existing issue retrieval functionality
and follows the same patterns as the pull request comments implementation.

The implementation includes:
- New getIssueComments function in pkg/github/issues.go
- Tool registration in server.go
- Comprehensive test coverage in issues_test.go

* Support pagination for get_issue_comments

---------

Co-authored-by: Javier Uruen Val <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants