Skip to content

Conversation

@freeznet
Copy link
Member

No description provided.

@freeznet freeznet requested a review from a team as a code owner June 10, 2025 09:50
@freeznet freeznet requested a review from Copilot June 11, 2025 07:53
Copy link
Contributor

Copilot AI 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 bumps the mcp-go dependency to v0.31.0 and migrates all MCP tool parameter parsing from the old common.RequiredParam/common.OptionalParam helpers to the new request.Require* and request.Get* APIs. It also adds a new OptionalParamObject utility and updates Kafka header parsing to use string-based entries.

  • Bump mcp-go from v0.28.0 to v0.31.0 in go.mod and go.work.sum
  • Replace common.RequiredParam/common.OptionalParam with request.RequireString, RequireStringSlice, GetString, etc.
  • Add OptionalParamObject in pkg/common/utils.go and adjust autoFailoverPolicyParams handling
  • Update Kafka produce tools to accept headers as ["key=value"] strings and parse them via ParseMessageConfigs

Reviewed Changes

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

File Description
pkg/mcp/pulsar_admin_nsisolationpolicy_tools.go Swapped old param helpers for request.Require* and added error on missing autoFailoverPolicyParams
pkg/common/utils.go Added OptionalParamObject helper to extract object parameters
go.mod / go.work.sum Bumped github.com/mark3labs/mcp-go to v0.31.0
pkg/mcp/pulsar_admin_namespace_tools.go Replaced common.RequiredParam/OptionalParamArray with request.* calls
Comments suppressed due to low confidence (2)

pkg/mcp/pulsar_admin_nsisolationpolicy_tools.go:229

  • This now treats autoFailoverPolicyParams as required and errors when it’s absent. Previously it was optional—consider allowing a missing key to default to an empty map for backward compatibility.
autoFailoverPolicyParamsRaw, ok := common.OptionalParamObject(request.GetArguments(), "autoFailoverPolicyParams")

pkg/common/utils.go:183

  • [nitpick] The new OptionalParamObject helper lacks a godoc comment—adding a description of its behavior and return values would improve overall code clarity.
func OptionalParamObject(arguments map[string]interface{}, name string) (map[string]interface{}, bool) {

@freeznet freeznet merged commit dea2811 into main Jun 16, 2025
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants