-
Couldn't load subscription status.
- Fork 2.9k
Add support for Repository Discussions #459
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
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 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) {
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.
Fix documentation to previous renaming
|
My understanding is things have progressed with discussions and this is now too outdated |
|
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. |
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.