GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — mcp: add config_git_set and config_git_remove tools by Ankitsinghsisodya · Pull Request #3818 · knative/func

Conversation

@Ankitsinghsisodya

@Ankitsinghsisodya Ankitsinghsisodya commented May 21, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

Summary

Adds two MCP tools — config_git_set and config_git_remove — to configure Git source repository settings for pipeline-based Function builds. This completes the config tool group alongside the existing volumes, labels, and envs tools.

Note: This is a re-submission of #3795, which was accidentally closed when the head repository was deleted.

Changes

  • pkg/mcp/tools_config_git.go — two tools following the existing config_* pattern:
    • config_git_set: configures Git URL, branch, subdirectory, and optional Pipelines-as-Code (PAC) resources on the Function. Requires path, git_url, and git_branch. Defaults git_dir to "." to avoid the CLI's interactive prompt when no subdirectory is needed. Automatically injects --config-local when no config_* flags are provided to prevent the webhook confirmation prompt in a non-TTY subprocess.
    • config_git_remove: removes Git settings and associated pipeline resources from a Function. Automatically injects --delete-local when neither delete_local nor delete_cluster is set, preventing the interactive "delete all?" prompt.
  • pkg/mcp/tools_config_git_test.go — nine unit tests covering args, defaults, anti-hang behavior, and error propagation.
  • pkg/mcp/mcp.go — registers both tools and three help resources (func://help/config/git, func://help/config/git/set, func://help/config/git/remove).
  • pkg/mcp/instructions.md — adds config_git_set / config_git_remove agent guidance covering required fields, PAC resource flags, GitHub token requirements, and destructive-operation warning for delete_cluster.

Notes

  • No config_git_list tool is added because func config git (the root command) currently prints "Not implemented yet." and provides no useful output. Git settings can be inspected via the func://function resource which exposes the full func.yaml state.

Test plan

  • make test passes
  • make check passes
  • Manual: call config_git_set with path, git_url, git_branch and confirm func.yaml is updated with Git config
  • Manual: call config_git_remove with path only and confirm local pipeline resources are cleaned up without prompting

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Copilot AI review requested due to automatic review settings May 21, 2026 11:04
@knative-prow
knative-prow Bot requested review from dsimansk and jrangelramos May 21, 2026 11:04
@knative-prow knative-prow Bot added size/XL 🤖 PR changes 500-999 lines, ignoring generated files. needs-ok-to-test 🤖 Needs an org member to approve testing labels May 21, 2026
@knative-prow

knative-prow Bot commented May 21, 2026

Copy link
Copy Markdown

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions 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.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Copilot AI reviewed May 21, 2026
View reviewed changes

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Pull request overview

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:

  • Introduces config_git_set and config_git_remove MCP tools with argument-building that avoids interactive hangs.
  • Registers new tools and help resources in the MCP server.
  • Adds documentation and comprehensive tests for argument forwarding, defaults, and error paths.

Reviewed changes

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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread pkg/mcp/tools_config_git.go
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)"`
Comment thread pkg/mcp/tools_config_git.go
args = appendBoolFlag(args, "--config-remote", i.ConfigRemote)
}

args = appendStringFlag(args, "--gh-access-token", i.GhAccessToken)
Comment thread pkg/mcp/tools_config_git.go

out, err := s.executor.Execute(ctx, "config", input.Args()...)
if err != nil {
err = fmt.Errorf("%w\n%s", err, string(out))
Comment thread pkg/mcp/tools_config_git_test.go
Comment on lines +45 to +49
// 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)
@lkingland lkingland added ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test 🤖 Needs an org member to approve testing labels May 22, 2026
@lkingland lkingland assigned Ankitsinghsisodya Jun 2, 2026
@lkingland lkingland added the status/new label Jun 2, 2026
@lkingland lkingland added this to Functions Traige Jun 2, 2026
@lkingland lkingland moved this to New in Functions Traige Jun 2, 2026
@lkingland lkingland removed the status/new label Jul 29, 2026
@knative-prow-robot knative-prow-robot added the needs-rebase Cannot be merged due to conflicts with HEAD. label Aug 11, 2026
@Ankitsinghsisodya
Ankitsinghsisodya force-pushed the feat/mcp-config-git-tools branch from ac3b6e0 to 6cc67db Compare August 11, 2026 20:36
@knative-prow-robot knative-prow-robot added needs-rebase Cannot be merged due to conflicts with HEAD. and removed needs-rebase Cannot be merged due to conflicts with HEAD. labels Aug 11, 2026
Ankitsinghsisodya added 4 commits August 20, 2026 10:54
@Ankitsinghsisodya
feat(mcp): add config_git_set and config_git_remove tools with docume…
c9c9e44
…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.
@Ankitsinghsisodya
refactor(mcp): standardize formatting in ConfigGitSetInput struct
e50657e
- 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.
@Ankitsinghsisodya
fix(mcp): update documentation and improve argument validation
0a93c3e
- 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.
@Ankitsinghsisodya
fix(tests): handle protocol-level errors in Git configuration tests
640838e
- 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.
@Ankitsinghsisodya
Ankitsinghsisodya force-pushed the feat/mcp-config-git-tools branch from 6cc67db to 640838e Compare August 20, 2026 05:24
@knative-prow-robot knative-prow-robot removed the needs-rebase Cannot be merged due to conflicts with HEAD. label Aug 20, 2026
lkingland
lkingland approved these changes Aug 20, 2026
View reviewed changes

@lkingland lkingland left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for 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.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@knative-prow knative-prow Bot assigned lkingland Aug 20, 2026
@knative-prow knative-prow Bot added the lgtm 🤖 PR is ready to be merged. label Aug 20, 2026
@knative-prow

knative-prow Bot commented Aug 20, 2026

Copy link
Copy Markdown

[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

Details Needs approval from an approver in each of these files:
  • OWNERS [lkingland]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@knative-prow knative-prow Bot added the approved 🤖 PR has been approved by an approver from all required OWNERS files. label Aug 20, 2026
@knative-prow
knative-prow Bot merged commit 779cdcf into knative:main Aug 20, 2026
43 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@github-project-automation github-project-automation Bot moved this from New to Done in Functions Traige Aug 20, 2026
@Elvand-Lie Elvand-Lie mentioned this pull request Oct 28, 2026
fix(mcp): block config_git_set and config_git_remove in read-only mode #4116
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Copilot code review Copilot
Copilot review effort
Applies to this pull request for everyone.Learn more about Copilot code review.
Copilot left review comments
@lkingland lkingland lkingland approved these changes
@dsimansk dsimansk Awaiting requested review from dsimansk
@jrangelramos jrangelramos Awaiting requested review from jrangelramos

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@lkingland lkingland

@Ankitsinghsisodya Ankitsinghsisodya

Labels

approved 🤖 PR has been approved by an approver from all required OWNERS files. lgtm 🤖 PR is ready to be merged. ok-to-test 🤖 Non-member PR verified by an org member that is safe to test. size/XL 🤖 PR changes 500-999 lines, ignoring generated files.

Projects

Functions Traige
Status: Done

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Ankitsinghsisodya @lkingland @knative-prow-robot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.