diff --git a/mcp_server/server.py b/mcp_server/server.py index d297425..328def9 100644 --- a/mcp_server/server.py +++ b/mcp_server/server.py @@ -478,6 +478,7 @@ def generate_argocd_config( project: str = "default", auto_sync: bool = False, rollouts: bool = False, + allow_any_source_repo: bool = False, image: str = "ghcr.io/myorg/my-app", ) -> str: """ @@ -493,6 +494,7 @@ def generate_argocd_config( project: ArgoCD project name. auto_sync: Enable ArgoCD automated sync (prune + self-heal). rollouts: Add an Argo Rollouts canary Rollout resource. + allow_any_source_repo: Allow AppProject sourceRepos wildcard ('*'). image: Container image for Flux image automation. Returns: @@ -504,7 +506,8 @@ def generate_argocd_config( args = argparse.Namespace( name=name, method=method, repo=repo, revision=revision, path=path, namespace=namespace, project=project, auto_sync=auto_sync, - rollouts=rollouts, image=image, output_dir=".", custom_values=None, + rollouts=rollouts, allow_any_source_repo=allow_any_source_repo, + image=image, output_dir=".", custom_values=None, server="https://kubernetes.default.svc", ) diff --git a/mcp_server/test_server.py b/mcp_server/test_server.py index c0c4e3d..edcf166 100644 --- a/mcp_server/test_server.py +++ b/mcp_server/test_server.py @@ -159,6 +159,12 @@ def test_generate_argocd_config_flux(): assert "Kustomization" in data["flux/kustomization.yaml"] +def test_generate_argocd_config_allow_any_source_repo(): + result = generate_argocd_config(allow_any_source_repo=True) + data = json.loads(result) + assert "*" in data["argocd/appproject.yaml"] + + # --------------------------------------------------------------------------- # SRE configs # --------------------------------------------------------------------------- diff --git a/skills/claude_tools.json b/skills/claude_tools.json index af8ac7c..20055f4 100644 --- a/skills/claude_tools.json +++ b/skills/claude_tools.json @@ -268,6 +268,11 @@ "description": "Add an Argo Rollouts canary Rollout resource.", "default": false }, + "allow_any_source_repo": { + "type": "boolean", + "description": "Allow wildcard '*' in ArgoCD AppProject sourceRepos.", + "default": false + }, "image": { "type": "string", "description": "Container image for Flux image automation.", diff --git a/skills/openai_functions.json b/skills/openai_functions.json index 69c5ee2..c469b2f 100644 --- a/skills/openai_functions.json +++ b/skills/openai_functions.json @@ -285,6 +285,11 @@ "description": "Add an Argo Rollouts canary Rollout resource.", "default": false }, + "allow_any_source_repo": { + "type": "boolean", + "description": "Allow wildcard '*' in ArgoCD AppProject sourceRepos.", + "default": false + }, "image": { "type": "string", "description": "Container image for Flux image automation.", diff --git a/tests/test_comprehensive.py b/tests/test_comprehensive.py index 9f2ef05..d3098e0 100644 --- a/tests/test_comprehensive.py +++ b/tests/test_comprehensive.py @@ -1313,21 +1313,8 @@ def test_appproject_repo_is_scoped_by_default(self): # Wildcard should NOT be in default appproject assert "- '*'" not in proj_yaml - # BUG-3: allow_any_source_repo is not exposed in MCP server generate_argocd_config - @pytest.mark.xfail( - strict=True, - reason=( - "BUG-3: generate_argocd_config() in the MCP server does not expose " - "the allow_any_source_repo parameter. Users cannot opt-in to wildcard " - "source repos via the MCP interface. The parameter exists in " - "scaffold_argocd but is not wired through the MCP tool." - ), - ) - def test_allow_any_source_repo_not_available_in_mcp(self): - """ - BUG-3: generate_argocd_config should expose allow_any_source_repo - so users can opt-in to wildcard source repos via the MCP interface. - """ + def test_allow_any_source_repo_is_available_in_mcp(self): + """MCP generate_argocd_config should expose allow_any_source_repo.""" import inspect sig = inspect.signature(generate_argocd_config) # Correct expected behavior: the parameter should be present