GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — mcp: add config_git_set and config_git_remove tools by Ankitsinghsisodya · Pull Request #3818 · knative/func Conversation
|
|
Hi @Ankitsinghsisodya. Thanks for your PR. I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Note
Copilot was unable to run its full agentic suite in this review.
Adds MCP support for configuring and removing Git pipeline settings on a Function by wrapping func config git set/remove, with safeguards to avoid interactive CLI prompts in non-TTY execution.
Changes:
config_git_set and config_git_remove MCP tools with argument-building that avoids interactive hangs.Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| pkg/mcp/tools_config_git.go | Implements new Git config tools, argument building, and handlers |
| pkg/mcp/tools_config_git_test.go | Adds tests for correct argument forwarding, defaults, and error propagation |
| pkg/mcp/mcp.go | Registers the new tools and related help resources |
| pkg/mcp/instructions.md | Documents how/when to call the new tools and required/optional params |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| ConfigLocal *bool `json:"config_local,omitempty" jsonschema:"Create local pipeline template files in the Function directory (default: true when no config flags are set)"` | ||
| ConfigCluster *bool `json:"config_cluster,omitempty" jsonschema:"Create pipeline credentials and config on the cluster"` | ||
| ConfigRemote *bool `json:"config_remote,omitempty" jsonschema:"Configure a webhook on the remote Git provider (requires gh_access_token for GitHub)"` | ||
| GhAccessToken *string `json:"gh_access_token,omitempty" jsonschema:"GitHub Personal Access Token for webhook creation (scope: public_repo or repo, admin:repo_hook for automatic webhook setup)"` |
| args = appendBoolFlag(args, "--config-remote", i.ConfigRemote) | ||
| } | ||
|
|
||
| args = appendStringFlag(args, "--gh-access-token", i.GhAccessToken) |
|
|
||
| out, err := s.executor.Execute(ctx, "config", input.Args()...) | ||
| if err != nil { | ||
| err = fmt.Errorf("%w\n%s", err, string(out)) |
| // After "git set": --path, path, --git-url, url, --git-branch, branch, --git-dir, dir = 8 args | ||
| // + --config-local (1) + --verbose (1) = 10 args after "git set" | ||
| remaining := args[2:] | ||
| validateStringFlags(t, remaining, stringFlags) | ||
| validateBoolFlags(t, remaining, boolFlags) |
ac3b6e0 to
6cc67db
Compare
…ntation - Introduced `config_git_set` tool to configure Git repository settings for pipeline builds, including required parameters like `git_url` and `git_branch`, and optional flags for local and cluster configurations. - Added `config_git_remove` tool to remove Git settings and associated resources, with options to delete local files and cluster credentials. - Updated documentation in `instructions.md` to include usage details for both tools. - Implemented unit tests for `config_git_set` and `config_git_remove` to ensure correct argument handling and error propagation.
- Adjusted field alignment in the ConfigGitSetInput struct for improved readability and consistency. - No functional changes were made; this commit focuses on code clarity and maintainability.
- Corrected the documentation in instructions.md to clarify the optional parameters for pipeline resource creation. - Enhanced the argument validation in tools_config_git.go to ensure that the `git-dir` parameter is not set to empty or whitespace, preventing unintended CLI prompts. - Added a test case in tools_config_git_test.go to verify that at least two arguments are provided for the `configGitRemove` command, improving robustness in argument handling.
- Updated the error handling in TestTool_ConfigGitSet_MissingGitURL and TestTool_ConfigGitSet_MissingGitBranch to return instead of calling t.Fatal when a protocol-level error occurs, allowing for more graceful test failures. - Added comments to clarify the expected behavior of the MCP SDK regarding required schema fields validation.
6cc67db to
640838e
Compare
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
We shuold remember to put in agent instructions that a token should never be passed verbatim as a flag, but be read from a CLI secret manager or via env variable, lest the token end up in cli history and/or logfiles.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Ankitsinghsisodya, lkingland The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.