Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion mcp_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
"""
Expand All @@ -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:
Expand All @@ -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",
)

Expand Down
6 changes: 6 additions & 0 deletions mcp_server/test_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
# ---------------------------------------------------------------------------
Expand Down
5 changes: 5 additions & 0 deletions skills/claude_tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
5 changes: 5 additions & 0 deletions skills/openai_functions.json
Original file line number Diff line number Diff line change
Expand Up @@ -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.",
Expand Down
17 changes: 2 additions & 15 deletions tests/test_comprehensive.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading