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 toolsnaps for every tool#543

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

Merged
williammartin merged 3 commits intomainfromwm/toolsnap-every-tool
Jun 18, 2025
Merged

Conversation

williammartin
Copy link
Collaborator

@williammartinwilliammartin commentedJun 18, 2025
edited
Loading

Description

Some time ago I introduced the idea oftoolsnaps to highlight unintended changes to our tool schemas. I also imagined that it might have the benefit of quickly validating conformance if/when the project swaps to the official Go supported SDK. This PR backfills the toolsnaps to all tools.

Here's a reminder of what the error messages look like:

ok      github.com/github/github-mcp-server/internal/toolsnaps  (cached)--- FAIL: Test_GetIssue (0.00s)    issues_test.go:25:                Error Trace:    /Users/williammartin/workspace/github-mcp-server/pkg/github/issues_test.go:25                Error:          Received unexpected error:                                tool schema for get_issue has changed unexpectedly:                                @ ["annotations","title"]                                - "Get issue details"                                + "Get isse details"                                run with `UPDATE_TOOLSNAPS=true` if this is expected                Test:           Test_GetIssueFAIL

Future Thoughts

Like with the desire to produce README's automatically from tool schemas, it would be better if there were a single data structure representing our tools, and then we could iterate that rather than relying on remembering to add the toolsnap call in each test.

@CopilotCopilotAI review requested due to automatic review settingsJune 18, 2025 08:26
@williammartinwilliammartin requested a review froma team as acode ownerJune 18, 2025 08:26
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

Backfill toolsnaps invocations into all GitHub tool tests and generate corresponding snapshot files to catch unintended schema changes.

  • Insertrequire.NoError(t, toolsnaps.Test(...)) in every tool test.
  • Add a snapshot file underpkg/github/__toolsnaps__/ for each tool.
  • Update the toolsnaps library’s error message to include instructions for updating snapshots.

Reviewed Changes

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

FileDescription
internal/toolsnaps/toolsnaps.goAugment error message to suggestUPDATE_TOOLSNAPS=true.
pkg/github/*_test.goInvoketoolsnaps.Test in each tool’s test.
pkg/github/toolsnaps/*.snapNew snapshot files for every tool schema.
Comments suppressed due to low confidence (2)

pkg/github/search_test.go:21

  • The call torequire.NoError is unqualified because therequire package isn't imported. Addimport "github.com/stretchr/testify/require" to avoid compile errors.
require.NoError(t, toolsnaps.Test(tool.Name, tool))

pkg/github/pullrequests_test.go:932

  • Variabletool is undefined in this scope (onlyhandler was assigned). Capture the tool return value before using it, e.g.tool, handler := UpdatePullRequestBranch(...).
require.NoError(t, toolsnaps.Test(tool.Name, tool))

@williammartinwilliammartin merged commit846fac6 intomainJun 18, 2025
16 checks passed
@williammartinwilliammartin deleted the wm/toolsnap-every-tool branchJune 18, 2025 08:38
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

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

2 participants
@williammartin@SamMorrowDrums

[8]ページ先頭

©2009-2025 Movatter.jp