Skip to content

Feat | Fix repo-server-api render mode: multi-source, cross-repo, and credential issues#359

Merged
dag-andersen merged 5 commits intomainfrom
multi-source-support
Feb 27, 2026
Merged

Feat | Fix repo-server-api render mode: multi-source, cross-repo, and credential issues#359
dag-andersen merged 5 commits intomainfrom
multi-source-support

Conversation

@dag-andersen
Copy link
Copy Markdown
Owner

@dag-andersen dag-andersen commented Feb 27, 2026

Summary

This PR fixes several bugs in the repo-server-api render mode that prevented applications from rendering correctly.

Fixes

1. Multi-content-source support

Apps with multiple path: sources (e.g. a root app pointing at two paths in the same repo) previously errored. Fixed by splitting content sources from ref-only sources and calling the repo server once per content source, then merging the manifests.

2. Cross-repo sources fall back to remote RPC

Apps whose source.repoURL points at a different repo than the PR repo fail because those files aren't checked out locally. Fixed by detecting when source.repoURL doesn't match the PR repo and using the remote GenerateManifest RPC (streamDir="") instead of streaming local files.

3. .git suffix normalisation in repo URL lookup

ArgoCD repo secrets are sometimes stored without a trailing .git (e.g. https://github.com/org/repo) while app repoURLs include it (e.g. https://github.com/org/repo.git). The exact-string lookup in GetRepo missed these, returning a bare stub with no credentials → authentication required from the repo server. Fixed by normalising URLs (lowercase + strip .git) when indexing and looking up reposByURL.

4. Ref source credentials missing

When building RefSources for the remote RPC path, RefTarget.Repo was set to a bare stub with no credentials. For repos using GitHub App auth, the repo server failed with failed to get git client for repo. Fixed by using GetRepo(ref.RepoURL) to return the fully credential-enriched Repository.

5. Guard extract paths against unconverted ApplicationSets

Added a guard to prevent panics when ApplicationSets have not been fully converted to Applications before path extraction.

@github-actions
Copy link
Copy Markdown
Contributor

Argo CD Diff Preview

Summary:

Total: 1 files changed

Added (1):
+ multi-source-app (+41)
multi-source-app (examples/multi-source/app.yaml)
@@ Application added: multi-source-app (examples/multi-source/app.yaml) @@
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: backend
+  namespace: default
+spec:
+  replicas: 3
+  selector:
+    matchLabels:
+      app: backend
+  template:
+    metadata:
+      labels:
+        app: backend
+    spec:
+      containers:
+      - image: my-org/backend:1.0.0
+        name: backend
+        ports:
+        - containerPort: 8080
+---
+apiVersion: apps/v1
+kind: Deployment
+metadata:
+  name: frontend
+  namespace: default
+spec:
+  replicas: 2
+  selector:
+    matchLabels:
+      app: frontend
+  template:
+    metadata:
+      labels:
+        app: frontend
+    spec:
+      containers:
+      - image: nginx:1.25
+        name: frontend
+        ports:
+        - containerPort: 80

Stats:
[Applications: 45], [Full Run: 58s], [Rendering: 10s], [Cluster: 18s], [Argo CD: 30s]

@dag-andersen dag-andersen merged commit a5c3bfb into main Feb 27, 2026
3 checks passed
@dag-andersen dag-andersen deleted the multi-source-support branch February 27, 2026 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant