Skip to content

fix: skip NoRows on unmanaged Argo CD application updates (#7095) - #7096

Open
YamonBot wants to merge 1 commit into
devtron-labs:mainfrom
yamonco:codex/skip-unregistered-argo-app-events
Open

YamonBot wants to merge 1 commit into
devtron-labs:mainfrom
yamonco:codex/skip-unregistered-argo-app-events

Conversation

@YamonBot

Copy link
Copy Markdown

Description

Fixes #7095.

Argo CD status events can arrive for applications that have neither a pipeline nor an installed chart in Devtron. When the installed-chart lookup returns pg.ErrNoRows, the lookup and the event handler currently both log an error for the expected miss.

Use errors.Is at both boundaries. The read service continues returning the original error to its callers, and the status handler skips the update when that error matches pg.ErrNoRows. Other lookup failures retain their error logs, and installed charts continue through status processing.

How Has This Been Tested?

GOTOOLCHAIN=go1.26.10 go test -mod=vendor ./pkg/eventProcessor/in ./pkg/appStore/installedApp/read -count=1

The regression exercises the status handler with the real installed-app read service and stub repositories. It checks direct and wrapped pg.ErrNoRows, a database connection failure, and the registered-chart path. On a case-sensitive checkout, mirror the lowercase Microsoft vendor path as the repository Dockerfile does before running the command.

Checklist

  • The title describes the change and cites the issue.
  • I have reviewed my own code.
  • I have added regression tests.

Does this PR introduce a user-facing change?


Signed-off-by: YamonBot <141118378+YamonBot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings November 20, 2026 04:47
@bito-code-review

Copy link
Copy Markdown

Bito Review Skipped - Source Branch Not Found

Bito didn't review this change because the pull request is no longer valid. It may have been merged, or the source/target branch may no longer exist.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the change to skip Argo CD status updates for unmanaged applications.

No open issues 🎉

What changed in this PR

Fixes #7095 by skipping Argo CD status updates for unmanaged applications without logging expected pg.ErrNoRows lookup misses as errors.

Changes:

  • Uses errors.Is in the read service and event handler to recognize direct and wrapped lookup misses.
  • Preserves original lookup errors, error logging for other failures, and managed-chart status processing.
  • Extracts the event handler and adds regression tests for unmatched applications, database failures, and registered charts.
File Description
pkg/​eventProcessor/​in/​DeployedApplicationEventProcessorService.go Extracts the handler and silently skips unmatched applications.
pkg/​eventProcessor/​in/​DeployedApplicationEventProcessorService_test.go Tests lookup misses, failure logging, and registered-chart processing.
pkg/​appStore/​installedApp/​read/​InstalledAppReadService.go Suppresses expected lookup-miss logs while preserving returned errors.

Review effort: Balanced

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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: Argo CD status updates for unmanaged applications emit NoRows errors

2 participants