Skip to content

Commit 4abff6b

Browse files
saschabuehrlesaschabuehrle
andauthored
fix: wire allow_any_source_repo into MCP argocd config tool (#47)
* fix: expose allow_any_source_repo in MCP argocd tool * test: remove stale xfail for allow_any_source_repo MCP coverage --------- Co-authored-by: saschabuehrle <sascha@buehrle.io>
1 parent 5930f2a commit 4abff6b

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

mcp_server/server.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -478,6 +478,7 @@ def generate_argocd_config(
478478
project: str = "default",
479479
auto_sync: bool = False,
480480
rollouts: bool = False,
481+
allow_any_source_repo: bool = False,
481482
image: str = "ghcr.io/myorg/my-app",
482483
) -> str:
483484
"""
@@ -493,6 +494,7 @@ def generate_argocd_config(
493494
project: ArgoCD project name.
494495
auto_sync: Enable ArgoCD automated sync (prune + self-heal).
495496
rollouts: Add an Argo Rollouts canary Rollout resource.
497+
allow_any_source_repo: Allow AppProject sourceRepos wildcard ('*').
496498
image: Container image for Flux image automation.
497499
498500
Returns:
@@ -504,7 +506,8 @@ def generate_argocd_config(
504506
args = argparse.Namespace(
505507
name=name, method=method, repo=repo, revision=revision, path=path,
506508
namespace=namespace, project=project, auto_sync=auto_sync,
507-
rollouts=rollouts, image=image, output_dir=".", custom_values=None,
509+
rollouts=rollouts, allow_any_source_repo=allow_any_source_repo,
510+
image=image, output_dir=".", custom_values=None,
508511
server="https://kubernetes.default.svc",
509512
)
510513

mcp_server/test_server.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,12 @@ def test_generate_argocd_config_flux():
159159
assert "Kustomization" in data["flux/kustomization.yaml"]
160160

161161

162+
def test_generate_argocd_config_allow_any_source_repo():
163+
result = generate_argocd_config(allow_any_source_repo=True)
164+
data = json.loads(result)
165+
assert "*" in data["argocd/appproject.yaml"]
166+
167+
162168
# ---------------------------------------------------------------------------
163169
# SRE configs
164170
# ---------------------------------------------------------------------------

skills/claude_tools.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,11 @@
268268
"description": "Add an Argo Rollouts canary Rollout resource.",
269269
"default": false
270270
},
271+
"allow_any_source_repo": {
272+
"type": "boolean",
273+
"description": "Allow wildcard '*' in ArgoCD AppProject sourceRepos.",
274+
"default": false
275+
},
271276
"image": {
272277
"type": "string",
273278
"description": "Container image for Flux image automation.",

skills/openai_functions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,11 @@
285285
"description": "Add an Argo Rollouts canary Rollout resource.",
286286
"default": false
287287
},
288+
"allow_any_source_repo": {
289+
"type": "boolean",
290+
"description": "Allow wildcard '*' in ArgoCD AppProject sourceRepos.",
291+
"default": false
292+
},
288293
"image": {
289294
"type": "string",
290295
"description": "Container image for Flux image automation.",

tests/test_comprehensive.py

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1306,21 +1306,8 @@ def test_appproject_repo_is_scoped_by_default(self):
13061306
# Wildcard should NOT be in default appproject
13071307
assert "- '*'" not in proj_yaml
13081308

1309-
# BUG-3: allow_any_source_repo is not exposed in MCP server generate_argocd_config
1310-
@pytest.mark.xfail(
1311-
strict=True,
1312-
reason=(
1313-
"BUG-3: generate_argocd_config() in the MCP server does not expose "
1314-
"the allow_any_source_repo parameter. Users cannot opt-in to wildcard "
1315-
"source repos via the MCP interface. The parameter exists in "
1316-
"scaffold_argocd but is not wired through the MCP tool."
1317-
),
1318-
)
1319-
def test_allow_any_source_repo_not_available_in_mcp(self):
1320-
"""
1321-
BUG-3: generate_argocd_config should expose allow_any_source_repo
1322-
so users can opt-in to wildcard source repos via the MCP interface.
1323-
"""
1309+
def test_allow_any_source_repo_is_available_in_mcp(self):
1310+
"""MCP generate_argocd_config should expose allow_any_source_repo."""
13241311
import inspect
13251312
sig = inspect.signature(generate_argocd_config)
13261313
# Correct expected behavior: the parameter should be present

0 commit comments

Comments
 (0)