Skip to content

fix(bundler): resolve ArgoCD RepoURL placeholder in child applications#520

Merged
mchmarny merged 2 commits into
mainfrom
fix/argocd-repourl-519
Apr 9, 2026
Merged

fix(bundler): resolve ArgoCD RepoURL placeholder in child applications#520
mchmarny merged 2 commits into
mainfrom
fix/argocd-repourl-519

Conversation

@mchmarny
Copy link
Copy Markdown
Member

@mchmarny mchmarny commented Apr 9, 2026

Summary

Closes #519

  • Fix {{ .RepoURL }} literal placeholder in ArgoCD child application.yaml files. ArgoCD's directory-based app-of-apps does not template-render discovered files, so the escaped Go template string was used as a Git URL, causing ComparisonError.
  • Pass actual RepoURL and TargetRevision through ApplicationData to each child application template.
  • Auto-derive RepoURL and TargetRevision from OCI reference when using --deployer argocd with OCI output (-o oci://...), making --repo flag optional in that case.

Test plan

  • Existing ArgoCD deployer tests pass with updated assertions
  • New test: OCI-style RepoURL with custom TargetRevision propagates to both app-of-apps and child applications
  • New test: default placeholder URL propagates to child applications (no literal {{ .RepoURL }})
  • New test: config WithTargetRevision getter/option
  • make lint passes
  • Manual test: aicr bundle --recipe recipe.yaml --deployer argocd --output oci://... generates correct child application.yaml with OCI repo URL and tag

mchmarny added 2 commits April 9, 2026 11:41
#519)

Replace escaped Go template placeholder {{ .RepoURL }} in child
application.yaml with actual repo URL passed through ApplicationData.
ArgoCD's directory-based app-of-apps does not template-render discovered
files, so the literal string was used as a Git URL causing
ComparisonError.

Also auto-derive RepoURL and TargetRevision from OCI reference when
using --deployer argocd with OCI output, making --repo optional.
@mchmarny mchmarny requested a review from a team as a code owner April 9, 2026 18:52
@mchmarny mchmarny self-assigned this Apr 9, 2026
@mchmarny mchmarny requested a review from lalitadithya April 9, 2026 18:54
@mchmarny mchmarny added this to the v0.12 milestone Apr 9, 2026
@mchmarny mchmarny enabled auto-merge (squash) April 9, 2026 18:55
@mchmarny mchmarny merged commit 966d775 into main Apr 9, 2026
25 checks passed
@mchmarny mchmarny deleted the fix/argocd-repourl-519 branch April 9, 2026 19:01
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 9, 2026

Coverage Report ✅

Metric Value
Coverage 74.5%
Threshold 70%
Status Pass
Coverage Badge
![Coverage](https://img.shields.io/badge/coverage-74.5%25-green)

Merging this branch changes the coverage (1 decrease, 2 increase)

Impacted Packages Coverage Δ 🤖
github.com/NVIDIA/aicr/pkg/bundler 62.20% (ø)
github.com/NVIDIA/aicr/pkg/bundler/config 97.22% (+0.06%) 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/argocd 86.67% (+0.95%) 👍
github.com/NVIDIA/aicr/pkg/cli 35.78% (-0.21%) 👎

Coverage by file

Changed files (no unit tests)

Changed File Coverage Δ Total Covered Missed 🤖
github.com/NVIDIA/aicr/pkg/bundler/bundler.go 58.36% (ø) 341 199 142
github.com/NVIDIA/aicr/pkg/bundler/config/config.go 97.22% (+0.06%) 144 (+3) 140 (+3) 4 👍
github.com/NVIDIA/aicr/pkg/bundler/deployer/argocd/argocd.go 86.67% (+0.95%) 75 (+5) 65 (+5) 10 👍
github.com/NVIDIA/aicr/pkg/cli/bundle.go 0.70% (-0.02%) 143 (+4) 1 142 (+4) 👎

Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code.

@mchmarny mchmarny restored the fix/argocd-repourl-519 branch May 1, 2026 16:30
@mchmarny mchmarny deleted the fix/argocd-repourl-519 branch May 1, 2026 16:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: ArgoCD application ComparisonError when using OCI bundle to deploy recipe

2 participants