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

Feature/chewy standards tool#510

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

cgoodloe-chwy
Copy link

Closes:

@CopilotCopilotAI review requested due to automatic review settingsJune 12, 2025 20:34
@cgoodloe-chwycgoodloe-chwy requested a review froma team as acode ownerJune 12, 2025 20:34
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

Adds a new MCP tool for fetching development standards from Chewy’s GitHub repository, including registration, implementation, tests, and documentation updates.

  • IntroducesGetChewyStandards tool and registers it inInitToolsets
  • Implements handler logic to fetch either an explicit path or the full repository tree
  • Adds comprehensive tests and updates the README

Reviewed Changes

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

FileDescription
pkg/github/tools.goRegistersget_chewy_standards in the read-only toolset
pkg/github/repositories.goImplementsGetChewyStandards handler and tool definition
pkg/github/repositories_test.goAdds tests for default, custom-path, and error cases
README.mdDocuments the newget_chewy_standards tool
Comments suppressed due to low confidence (3)

pkg/github/repositories_test.go:1968

  • Add a test case that supplies a customref value and assert that the handler uses that ref when fetching contents.
func Test_GetChewyStandards(t *testing.T) {

README.md:512

  • Align the bullet levels and indentation for theget_chewy_standards section so it matches the existing format, and ensure each sub-item is nested correctly.
- **get_chewy_standards** - Get development standards and guidelines from Chewy's repository

README.md:604

  • Remove the stray trailing `- `` at the end of the file; it appears to be an accidental leftover.
- `


if searchWholeRepo {
// Get the entire repository tree
tree, resp, err := client.Git.GetTree(ctx, owner, repo, "HEAD", true)
Copy link
Preview

CopilotAIJun 12, 2025

Choose a reason for hiding this comment

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

Use the user-providedref parameter when fetching the repository tree instead of hardcoding "HEAD" so that branch/tag/commit references are respected.

Suggested change
tree,resp,err:=client.Git.GetTree(ctx,owner,repo,"HEAD",true)
tree,resp,err:=client.Git.GetTree(ctx,owner,repo,ref,true)

Copilot uses AI. Check for mistakes.

defer func() { _ = resp.Body.Close() }()
}

if resp.StatusCode == 200 && tree != nil {
Copy link
Preview

CopilotAIJun 12, 2025

Choose a reason for hiding this comment

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

Add a check for non-200 responses fromGetTree (e.g.resp.StatusCode != http.StatusOK) and return an error, rather than continuing silently when the tree isn’t fetched.

Suggested change
ifresp.StatusCode==200&&tree!=nil {
ifresp.StatusCode!=http.StatusOK {
returnmcp.NewToolResultError(fmt.Sprintf("Failed to get repository tree: received status code %d",resp.StatusCode)),nil
}
iftree!=nil {

Copilot uses AI. Check for mistakes.

continue
}
if resp != nil {
defer func() { _ = resp.Body.Close() }()
Copy link
Preview

CopilotAIJun 12, 2025

Choose a reason for hiding this comment

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

Avoid deferringresp.Body.Close() inside a loop; close the response body immediately after reading to prevent resource buildup.

Copilot uses AI. Check for mistakes.

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

Copilot code reviewCopilotCopilot left review comments

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

Successfully merging this pull request may close these issues.

2 participants
@cgoodloe-chwy@williammartin

[8]ページ先頭

©2009-2025 Movatter.jp