Skip to content

Fix | Handle dual-purpose sources with both ref and path in repo-server-api renderer#402

Merged
dag-andersen merged 1 commit intomainfrom
fix/repo-server-api-ref-and-path-401
Apr 12, 2026
Merged

Fix | Handle dual-purpose sources with both ref and path in repo-server-api renderer#402
dag-andersen merged 1 commit intomainfrom
fix/repo-server-api-ref-and-path-401

Conversation

@dag-andersen
Copy link
Copy Markdown
Owner

@dag-andersen dag-andersen commented Apr 12, 2026

Summary

Fixes #401

  • The repo-server-api renderer failed when a source had both ref and path set simultaneously (a valid Argo CD pattern for cross source references)
  • splitSources now treats ref and content (path/chart) as independent concerns - a source with both ends up in both lists

Root Cause

splitSources classified sources into mutually exclusive buckets: a source was either a ref source (ref != "" and path == "") or a content source (everything else). A source with both ref: values and path: manifests was only placed in contentSources, so sibling chart sources couldn't resolve $values/... value files - producing:

source referenced "$values", but no source has a 'ref' field defined

Fix

Replaced the three-way if/else with two independent checks:

if s.Ref != "" {
    refSources = append(refSources, s)
}
if s.Path != "" || s.Chart != "" || s.Ref == "" {
    contentSources = append(contentSources, s)
}

Testing

  • Added TestBuildManifestRequest_ExternalChart_WithRefAndPath_GH401 - reproduces the exact scenario from the issue
  • All existing unit tests pass (including race detection)

@dag-andersen dag-andersen merged commit f1baf84 into main Apr 12, 2026
3 checks passed
@dag-andersen dag-andersen deleted the fix/repo-server-api-ref-and-path-401 branch April 12, 2026 11:09
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.

Bug | repo-server-api render method not handling refs correctly

1 participant