- Notifications
You must be signed in to change notification settings - Fork2.7k
feat: add list repository contributors and update readme#893
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?
feat: add list repository contributors and update readme#893
Conversation
This reverts commitece480e.
This comment was marked as outdated.
This comment was marked as outdated.
Sorry, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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 a new GitHub API tool for listing repository contributors and fixes a README reference. The main focus is implementing thelist_repository_contributors
tool that interfaces with GitHub's REST API to retrieve contributor information for repositories.
- Implements a new
list_repository_contributors
tool with pagination support - Adds comprehensive test coverage for the new functionality
- Updates README documentation to include the new tool
- Corrects a README reference issue
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
script/list-repository-contributors | Test script for the new contributors tool |
pkg/github/tools.go | Registers the new tool in the default toolset |
pkg/github/repositories_test.go | Comprehensive test cases for the contributors functionality |
pkg/github/repositories.go | Core implementation of the contributors listing tool |
pkg/github/toolsnaps/list_repository_contributors.snap | Tool schema snapshot for testing |
README.md | Documentation update for the new tool |
Tip: Customize your code reviews with copilot-instructions.md.Create the file orlearn how to get started.
ifresp.StatusCode!=http.StatusOK { | ||
body,err:=io.ReadAll(resp.Body) | ||
iferr!=nil { | ||
returnnil,fmt.Errorf("failed to read response body: %w",err) | ||
} | ||
returnmcp.NewToolResultError(fmt.Sprintf("failed to list contributors: %s",string(body))),nil | ||
} | ||
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.
The status code check and error handling is redundant since the GitHub client API call already handles HTTP errors. This pattern differs from other similar functions in the codebase likeListCommits
andListBranches
where the status check is performed after confirming no API error occurred. Consider removing lines 256-262 to maintain consistency.
ifresp.StatusCode!= http.StatusOK { | |
body,err:=io.ReadAll(resp.Body) | |
iferr!=nil { | |
returnnil,fmt.Errorf("failed to read response body: %w",err) | |
} | |
returnmcp.NewToolResultError(fmt.Sprintf("failed to list contributors: %s",string(body))),nil | |
} |
Copilot uses AI. Check for mistakes.
Uh oh!
There was an error while loading.Please reload this page.
Closes#825
Closes#876
This PR adds a new
list_repository_contributors
tool to the GitHub MCP Server.What's New (for#825)
What's New (for#876)
Refer the correct installation index in README.md