Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

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

Open
xcorail wants to merge5 commits intogithub:main
base:main
Choose a base branch
Loading
fromxcorail:main

Conversation

xcorail
Copy link

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.

@CopilotCopilotAI review requested due to automatic review settingsMay 31, 2025 17:18
@xcorailxcorail requested a review froma team as acode ownerMay 31, 2025 17:18
Copy link
Contributor

@CopilotCopilotAI 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.

  • Introduceslist_discussions,get_discussion,get_discussion_comments, andlist_discussion_categories tools
  • Registers the new discussions toolset inpkg/github/tools.go
  • Implements GraphQL-based handlers inpkg/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
FileDescription
script/get-discussionsAdded example Bash script for callinglist_discussions
pkg/github/tools.goRegistered new “discussions” toolset
pkg/github/discussions.goImplemented handlers for discussions and categories
pkg/github/discussions_test.goAdded tests covering listing, retrieval, and comments
README.mdDocumented 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) {

@xcorailxcorail marked this pull request as draftMay 31, 2025 18:16
@xcorailxcorail marked this pull request as ready for reviewMay 31, 2025 18:44
Copy link
Author

@xcorailxcorail 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

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

Copilot code reviewCopilotCopilot left review comments

At least 1 approving review is required to merge this pull request.

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

Adding of GitHub Discussion support to the current GitHub MCP server.
1 participant
@xcorail

[8]ページ先頭

©2009-2025 Movatter.jp