Repository navigation
fix(mcp): block config_ci in read-only mode - #4134
divyani-22 wants to merge 1 commit into
Conversation
The config_ci tool generates GitHub Actions CI workflow files on disk, but lacked a readonly check. When the MCP server is operating in read-only mode, executing config_ci bypassed policy and allowed writing workflow files. Reject config_ci before execution when readonly mode is active, matching the readonly enforcement on other mutating MCP config tools. Signed-off-by: Divyani <divyanipapalkar22@gmail.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: divyani-22 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
|
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.
|
Welcome @divyani-22! It looks like this is your first PR to knative/func 🎉 |
|
Hi @divyani-22. 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 Regular contributors should join the org to skip this step. 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. |
Description
The
config_citool generates GitHub Actions CI workflow files on disk, but lacked a read-only check. When the Functions MCP server operates in default read-only mode (FUNC_ENABLE_MCP_WRITEnot set), executingconfig_cibypassed policy and allowed writing workflow files to the local repository.This change adds the
s.readonly.Load()guard toconfigCIHandler, updatesinstructions_warning.md, and adds a corresponding unit test following the pattern established in #4116 and #3708.Changes
s.readonly.Load()at the start ofconfigCIHandlerinpkg/mcp/tools_config_ci.go.config_ciunder disabled operations inpkg/mcp/instructions_warning.md.TestTool_ConfigCI_Readonlyinpkg/mcp/tools_config_ci_test.go.Testing
TestTool_ConfigCI_Readonlyverifies thatconfig_cireturns an error in read-only mode and the executor is not invoked.