- Notifications
You must be signed in to change notification settings - Fork972
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
base:main
Are you sure you want to change the base?
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_categories
tools - Registers the new discussions toolset in
pkg/github/tools.go
- Implements GraphQL-based handlers in
pkg/github/discussions.go
with 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 callinglist_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) {
Uh oh!
There was an error while loading.Please reload this page.
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
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Closes:#213
This PR adds support for repository discussions, with the following tools:
list_discussions
get_discussion
get_comments
list_discussion_categories
As 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.