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 org-level discussions in list_discussion_categories tool#819

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

Conversation

tommaso-moro
Copy link
Contributor

Overview

Closes:#818

This PR improves the existinglist_discussion_categories tool, by adding logic to handle organisation-level discussions. (It implements similar logic to what I implemented inPR #775 )

Changes introduced

Before, the "repo" argument was required, so when the user would ask to query org-level discussions the model would either (i) hallucinate random values forrepo or (ii) it would have to know the implementation detail about the Github API which is that org-level discussions are stored in a hidden.github repo.
With these changes:

  • therepo argument is made optional
  • the tool description is updated so that the model knows to omitrepo if discussions are to be queried at the org-level
  • therepo value is deterministically set to.github when needed
  • the tests are updated to reflect these changes

Before (the model hallucinates repo values)
Screenshot 2025-08-04 at 17 14 44

After (the model correctly omits the repo argument, and the tool uses the deterministic flow to query org-level discussions)
Screenshot 2025-08-04 at 17 18 12

@tommaso-morotommaso-moro requested a review froma team as acode ownerAugust 4, 2025 16:36
@CopilotCopilotAI review requested due to automatic review settingsAugust 4, 2025 16:36
Copilot

This comment was marked as outdated.

mattdholloway
mattdholloway previously approved these changesAug 5, 2025
Copy link
Contributor

@mattdhollowaymattdholloway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

lgtm

@CopilotCopilotAI review requested due to automatic review settingsAugust 5, 2025 10:02
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 enhances thelist_discussion_categories tool to support organization-level discussions by making therepo parameter optional and automatically defaulting to.github when querying at the organization level.

  • Makes therepo parameter optional instead of required
  • Adds logic to default to.github repo whenrepo is not provided for organization-level queries
  • Updates tool description and documentation to clarify the new behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

FileDescription
pkg/github/discussions.goMakes repo parameter optional and adds logic to default to.github for org-level queries
pkg/github/discussions_test.goAdds comprehensive test coverage for both repository and organization-level scenarios
README.mdUpdates documentation to reflect the optional repo parameter
Comments suppressed due to low confidence (2)

pkg/github/discussions_test.go:648

  • The test verifies that only 'owner' is required but doesn't verify that 'repo' is not in the required array. Consider adding an explicit assertion that 'repo' is not required to make the test more complete.
mockClient := githubv4.NewClient(nil)toolDef, _ := ListDiscussionCategories(stubGetGQLClientFn(mockClient), translations.NullTranslationHelper)assert.Equal(t, "list_discussion_categories", toolDef.Name)assert.NotEmpty(t, toolDef.Description)assert.Contains(t, toolDef.Description, "or organisation")assert.Contains(t, toolDef.InputSchema.Properties, "owner")assert.Contains(t, toolDef.InputSchema.Properties, "repo")assert.ElementsMatch(t, toolDef.InputSchema.Required, []string{"owner"})

pkg/github/discussions_test.go:733

  • Consider adding a test case whererepo is explicitly set to an empty string to verify the behavior when the parameter is present but empty, as this might behave differently from when the parameter is completely omitted.
name: "list org-level discussion categories (no repo provided)",reqParams: map[string]interface{}{"owner": "owner",// repo is not provided, it will default to ".github"},

Copy link
Contributor

@mattdhollowaymattdholloway left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Test improvements look great 🚀

@tommaso-morotommaso-moro merged commit33a63a0 intogithub:mainAug 5, 2025
10 checks passed
nickytonline pushed a commit to nickytonline/github-mcp-http that referenced this pull requestOct 4, 2025
…ool (github#819)* hide implementation detail for org-level queries* update tests* autogen* made tests consistent with other tests
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@mattdhollowaymattdhollowaymattdholloway approved these changes

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

Successfully merging this pull request may close these issues.

Add org-level discussions support to list_discussion_categories tool
2 participants
@tommaso-moro@mattdholloway

[8]ページ先頭

©2009-2025 Movatter.jp