Skip to content

fix(webhook): match Helm OCI apps using repoURL+chart against registry events#27954

Open
adityaraj178 wants to merge 2 commits into
argoproj:masterfrom
adityaraj178:helm-oci
Open

fix(webhook): match Helm OCI apps using repoURL+chart against registry events#27954
adityaraj178 wants to merge 2 commits into
argoproj:masterfrom
adityaraj178:helm-oci

Conversation

@adityaraj178
Copy link
Copy Markdown
Contributor

Reference: #27884 (comment)

When an OCI registry webhook fires, ArgoCD must determine which apps to refresh. For plain OCI apps the app's repoURL equals the full image path, so a direct normalizeOCI comparison works fine.

Helm OCI apps are configured differently: ArgoCD stores them with

  • repoURL = / (e.g. registry.example.com/myorg/charts)
  • chart = (e.g. mychart)

OCI registry webhooks (Harbor etc.) report the full artifact path: repository = / (e.g.myorg/charts/mychart)

HandleRegistryEvent reconstructs the full URL as oci:/// (e.g. oci://registry.example.com/myorg/charts/mychart)

The previous single-URL comparison only checked repoURL, so Helm OCI apps never matched and were never refreshed after a push.

  "event_data": {
    "resources": [
      {
        "digest": "sha256:03684c153bb318ac9245ec5dd99a9831f6ab12930d2e7bc8ee7b55db97330174",
        "tag": "0.1.1",
        "resource_url": "localhost:8443/helm-demo/demo-app:0.1.1"
      }
    ],
    "repository": {
      "date_created": 1778826263,
      "name": "demo-app",
      "namespace": "helm-demo",
      "repo_full_name": "helm-demo/demo-app",
      "repo_type": "private"
    }
  }

Changes in this PR:

when source.Chart is set, also try normalizeOCI(source.RepoURL +"/" + source.Chart) as the effective full URL before skipping the app. This lets both plain OCI apps (no chart field) and Helm OCI apps (chart field set) resolve correctly from the same webhook event.

Checklist:

  • Either (a) I've created an enhancement proposal and discussed it with the community, (b) this is a bug fix, or (c) this does not need to be in the release notes.
  • The title of the PR states what changed and the related issues number (used for the release note).
  • The title of the PR conforms to the Title of the PR
  • I've included "Closes [ISSUE #]" or "Fixes [ISSUE #]" in the description to automatically close the associated issue.
  • I've updated both the CLI and UI to expose my feature, or I plan to submit a second PR with them.
  • Does this PR require documentation updates?
  • I've updated documentation as required by this PR.
  • I have signed off all my commits as required by DCO
  • I have written unit and/or e2e tests for my change. PRs without these are unlikely to be merged.
  • My build is green (troubleshooting builds).
  • My new feature complies with the feature status guidelines.
  • I have added a brief description of why this PR is necessary and/or what this PR solves.
  • Optional. My organization is added to USERS.md.
  • Optional. For bug fixes, I've indicated what older releases this fix should be cherry-picked into (this may or may not happen depending on risk/complexity).

…y events

Signed-off-by: Aditya Raj <adityaraj10600@gmail.com>
@adityaraj178 adityaraj178 requested a review from a team as a code owner May 21, 2026 04:30
@bunnyshell
Copy link
Copy Markdown

bunnyshell Bot commented May 21, 2026

✅ Preview Environment deployed on Bunnyshell

Component Endpoints
argocd https://argocd-7uiz2i.bunnyenv.com/
argocd-ttyd https://argocd-web-cli-7uiz2i.bunnyenv.com/

See: Environment Details | Pipeline Logs

Available commands (reply to this comment):

  • 🔴 /bns:stop to stop the environment
  • 🚀 /bns:deploy to redeploy the environment
  • /bns:delete to remove the environment

Signed-off-by: Aditya Raj <adityaraj10600@gmail.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented May 21, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 64.39%. Comparing base (04d41af) to head (886793f).
⚠️ Report is 104 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master   #27954      +/-   ##
==========================================
+ Coverage   63.84%   64.39%   +0.54%     
==========================================
  Files         418      422       +4     
  Lines       57269    57835     +566     
==========================================
+ Hits        36565    37241     +676     
+ Misses      17290    17092     -198     
- Partials     3414     3502      +88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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