-
Notifications
You must be signed in to change notification settings - Fork 566
Description
📜 Description
When an ArgoCD Application is configured with multiple sources where one source is a Helm chart (spec.sources[i].chart), the backend calls the ArgoCD revision metadata endpoint using the Helm chart version string as the revision ID. ArgoCD returns HTTP 500 because that endpoint only accepts git commit SHAs, not Helm chart version strings.
This produces a continuous stream of backend 500 errors on every entity page load for any entity linked to a multi-source Helm+git-values application.
👍 Expected behavior
The plugin should detect that a source is a Helm chart (via spec.sources[i].chart) and skip the getRevisionDetails call for that source, or handle the 500 gracefully without surfacing it as an error.
👎 Actual Behavior with Screenshots
The backend logs a continuous stream of errors on every page load:
```
backstage-community-argocd error Request failed with status 500
Failed to fetch Revision data from Instance 'nonprod'
with revisionID '6.33.0'
with appName 'loki-mntn-gke-dev-01'
with appNamespace 'N/A'
with sourceIndex '0'
```
The ArgoCD API at GET /api/v1/applications/{name}/revisions/6.33.0/metadata returns 500 because 6.33.0 is a Helm chart version, not a git SHA.
👟 Reproduction steps
- Create a multi-source ArgoCD ApplicationSet with two sources:
- Source 0: Helm chart (e.g.
grafana/lokiattargetRevision: 6.33.0) - Source 1: Git repository containing values files (
targetRevision: HEAD,ref: values)
- Source 0: Helm chart (e.g.
- Register the corresponding Backstage entity with
argocd/app-selectorannotation - Open the entity page and observe the ArgoCD tab — the tab renders but the backend logs continuous 500 errors
📃 Context
Root cause: isAppHelmChartType only checks spec.source.chart (single-source path) and does not check spec.sources[i].chart for multi-source apps. Additionally, revisions.pop() picks the last revision (typically the git SHA of the values file source) rather than the Helm chart version.
Proposed fix:
```ts
// In getRevisionDetails or the caller:
const helmSourceIndex = app.spec.sources?.findIndex(s => s.chart);
if (helmSourceIndex !== undefined && helmSourceIndex >= 0) {
// Skip getRevisionDetails for Helm chart sources — the API only accepts git SHAs
return undefined;
}
```
Plugin versions:
@backstage-community/plugin-argocdv2.5.0@backstage-community/plugin-argocd-backendv1.1.0
Related: #7785 — separate bug where non-default ArgoCD namespaces cause 403 on the same endpoint
👀 Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
No, but I'm happy to collaborate on a PR with someone else