Add support for Repository Discussions#459
Closed
xcorail wants to merge 14 commits intogithub:mainfrom
Closed
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for GitHub Repository Discussions using the GraphQL API by introducing four new tools, updating the tool registry, and providing example scripts and documentation.
- Introduces
list_discussions,get_discussion,get_discussion_comments, andlist_discussion_categoriestools - Registers the new discussions toolset in
pkg/github/tools.go - Implements GraphQL-based handlers in
pkg/github/discussions.gowith full test coverage and updates toREADME.md
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| script/get-discussions | Added example Bash script for calling list_discussions |
| pkg/github/tools.go | Registered new “discussions” toolset |
| pkg/github/discussions.go | Implemented handlers for discussions and categories |
| pkg/github/discussions_test.go | Added tests covering listing, retrieval, and comments |
| README.md | Documented the new discussions tools |
Comments suppressed due to low confidence (2)
script/get-discussions:1
- [nitpick] The script is named 'get-discussions' but invokes the 'list_discussions' tool; consider renaming it to 'list-discussions' for clarity.
#!/bin/bash
pkg/github/discussions_test.go:36
- Current tests for ListDiscussions don’t cover pagination parameters ('first' and 'after') or sorting behavior; consider adding test cases for these conditions.
func Test_ListDiscussions(t *testing.T) {
xcorail
commented
May 31, 2025
Author
xcorail
left a comment
There was a problem hiding this comment.
Fix documentation to previous renaming
Merged
|
My understanding is things have progressed with discussions and this is now too outdated |
Author
|
Yes @dsyme this PR has been actually partially merged as part of another, and I forgot to close it at that time. Thanks for closing it. |
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.
Closes: #213
This PR adds support for repository discussions, with the following tools:
list_discussionsget_discussionget_commentslist_discussion_categoriesAs there is no support for discussions in the GitHub go library, these tools use the GitHub GraphQL API
Alternatives
I considered using the REST API, but it's not officially supported yet and lacks some features such as category filtering and pagination, requiring post-treatments.