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

chore: separate toolset creation from init and use typed error#487

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
SamMorrowDrums merged 1 commit intomainfromtoolset-improvements
Jun 6, 2025

Conversation

SamMorrowDrums
Copy link
Collaborator

This PR makes it easier to identify the error when a toolset does not exist, and also separates toolset creation from initialization, so it's possible to compose toolsets in more ways.

LuluBeatson reacted with heart emoji
@CopilotCopilotAI review requested due to automatic review settingsJune 6, 2025 11:28
@SamMorrowDrumsSamMorrowDrums requested a review froma team as acode ownerJune 6, 2025 11:28
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 introduces a typed error for missing toolsets and decouples toolset creation from enabling so callers can compose and enable toolsets separately.

  • AddToolsetDoesNotExistError, replacefmt.Errorf with the new error type, and implementGetToolset().
  • Update tests to assert against the typed error and add new coverage forGetToolset.
  • RenameInitToolsets toDefaultToolsetGroup in GitHub integration and move enabling logic into the server initialization.

Reviewed Changes

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

FileDescription
pkg/toolsets/toolsets.goAddedToolsetDoesNotExistError, newGetToolset, replaced error strings
pkg/toolsets/toolsets_test.goUpdated tests to useerrors.Is against the typed error, addedTestToolsetGroup_GetToolset
pkg/github/tools.goRenamedInitToolsetsDefaultToolsetGroup, removed inline enabling
internal/ghmcp/server.goChanged server init to callEnableToolsets after creating the group
Comments suppressed due to low confidence (2)

pkg/github/tools.go:18

  • [nitpick] Consider renamingDefaultToolsetGroup toNewDefaultToolsetGroup orInitDefaultToolsetGroup to follow Go constructor naming conventions and clarify intent.
func DefaultToolsetGroup(readOnly bool, getClient GetClientFn, getGQLClient GetGQLClientFn, t translations.TranslationHelperFunc) *toolsets.ToolsetGroup {

pkg/toolsets/toolsets.go:15

  • The code callsfmt.Sprintf butfmt is not imported; add"fmt" to the import block to avoid a compilation error.
return fmt.Sprintf("toolset %s does not exist", e.Name)

Copy link
Member

@omgitsadsomgitsads left a comment

Choose a reason for hiding this comment

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

👍🏻

@SamMorrowDrumsSamMorrowDrums merged commitc17ebfe intomainJun 6, 2025
16 checks passed
@SamMorrowDrumsSamMorrowDrums deleted the toolset-improvements branchJune 6, 2025 12:45
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@omgitsadsomgitsadsomgitsads approved these changes

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

3 participants
@SamMorrowDrums@omgitsads@LuluBeatson

[8]ページ先頭

©2009-2025 Movatter.jp