Skip to content

Conversation

@xcorail
Copy link

@xcorail xcorail commented May 31, 2025

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.

Copilot AI review requested due to automatic review settings May 31, 2025 17:18
@xcorail xcorail requested a review from a team as a code owner May 31, 2025 17:18
Copy link
Contributor

Copilot AI 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 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, and list_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 to README.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 xcorail marked this pull request as draft May 31, 2025 18:16
@xcorail xcorail marked this pull request as ready for review May 31, 2025 18:44
Copy link
Author

@xcorail xcorail left a 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

@JoannaaKL JoannaaKL mentioned this pull request Jul 2, 2025
@dsyme
Copy link

dsyme commented Oct 26, 2025

My understanding is things have progressed with discussions and this is now too outdated

@dsyme dsyme closed this Oct 26, 2025
@xcorail
Copy link
Author

xcorail commented Oct 27, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Adding of GitHub Discussion support to the current GitHub MCP server.

4 participants