community-plugins icon indicating copy to clipboard operation
community-plugins copied to clipboard

🐛 redhat-argocd: app-namespace issues

Open phac008 opened this issue 8 months ago • 2 comments

Workspace

redhat-argocd

📜 Description

a) when using argocd/app-namespace (with argocd/app-selector annotations) href links to ArgoCD in ArgocdDeploymentSummary and DeploymentLifeCycle are missing namespace in url.

b) Why app-namespace only works with argocd/app-selector and not with argocd/app-name?

👍 Expected behavior

a) link should include namespace in url: https://<argocdurl>/applications/<namespace name>/appname

b) argocd/app-namespace and argocd/app-project should be possible with argocd/app-name

👎 Actual Behavior with Screenshots

Image Image

👟 Reproduction steps

use Applications in any Namespace in app-config.yaml

argocd:
  baseUrl: https://${ARGOCD_URL}
  namespacedApps: true
  appLocatorMethods:
    - type: 'config'
      instances:
        - name: main
          url: https://${ARGOCD_URL}
          token: ${ARGOCD_AUTH_TOKEN}

📃 Provide the context for the Bug.

No response

👀 Have you spent some time to check if this bug has been raised before?

  • [x] I checked and didn't find similar issue

🏢 Have you read the Code of Conduct?

Are you willing to submit PR?

No, I don't have time to work on this right now

phac008 avatar May 12 '25 21:05 phac008

The issue involving the URL seems to come from here: https://github.com/backstage/community-plugins/blob/main/workspaces/redhat-argocd/plugins/argocd/src/components/DeploymentLifeCycle/DeploymentLifecycleHeader.tsx#L28-L34

It looks like it tries to build a URL using the instance name from the metadata, but looking at the actual ArgoCD API that doesn't actually exist. Once we can build the URL then we can append the namespace.

This will need to get added to the backend, similar to how RoadieHQ does it for their plugin: https://github.com/RoadieHQ/roadie-backstage-plugins/blob/main/plugins/backend/backstage-plugin-argo-cd-backend/src/service/argocd.service.ts#L318-L327

The second one is an easy fix, the backend just doesn't pick up the appNamespace or project query params when fetching an app by name: https://github.com/backstage/community-plugins/blob/main/workspaces/redhat-argocd/plugins/argocd-backend/src/router.ts#L90-L99

CryptoRodeo avatar May 13 '25 20:05 CryptoRodeo

Re-opening (I think it auto-closed?), still need to merge #3990

CryptoRodeo avatar May 15 '25 18:05 CryptoRodeo

Both PRs have been merged and the changes are on NPM. Closing, reopen if needed.

CryptoRodeo avatar May 22 '25 19:05 CryptoRodeo