Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: missing notification on error #3076

Merged
merged 8 commits into from
Oct 5, 2023

Conversation

zachaller
Copy link
Collaborator

@zachaller zachaller commented Oct 4, 2023

Notifications would stop processing if any error happened on a single notification 'API' configuration, we should continue processing other notifications so that we do not miss sending a notification that is properly configured.

This also fixes an incorrect prometheus stat, we where only incrementing errors and success counts on api creations not at the sending and erroring of the actually execution of the notification.

@codecov
Copy link

codecov bot commented Oct 4, 2023

Codecov Report

Attention: 7 lines in your changes are missing coverage. Please review.

Comparison is base (20214b4) 81.73% compared to head (20b083a) 81.71%.
Report is 1 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3076      +/-   ##
==========================================
- Coverage   81.73%   81.71%   -0.02%     
==========================================
  Files         134      134              
  Lines       20406    20416      +10     
==========================================
+ Hits        16678    16683       +5     
- Misses       2869     2873       +4     
- Partials      859      860       +1     
Files Coverage Δ
utils/record/record.go 79.68% <73.07%> (+0.01%) ⬆️

... and 1 file with indirect coverage changes

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

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

Go Published Test Results

2 045 tests   2 045 ✔️  2m 40s ⏱️
   118 suites         0 💤
       1 files           0

Results for commit ed89184.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 4, 2023

E2E Tests Published Test Results

    4 files      4 suites   3h 43m 32s ⏱️
102 tests   86 ✔️   6 💤 10
426 runs  385 ✔️ 24 💤 17

For more details on these failures, see this check.

Results for commit ed89184.

Signed-off-by: zachaller <[email protected]>
Signed-off-by: zachaller <[email protected]>
Copy link
Contributor

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

Pls check my comments

}
log.Infof("Trigger %s result: %v", trigger, res)
log.Infof("trigger %s result: %v", trigger, res)
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Argo CD logs we usually start with uppercase.

}

emptyCondition := hash("")

// We should not return in these loops because we want other configured notifications to still send if they can.
errors := []error{}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if I am understanding this correctly but I can't find where this list of errors is returned..

Signed-off-by: zachaller <[email protected]>
Signed-off-by: zachaller <[email protected]>
Signed-off-by: zachaller <[email protected]>
@sonarcloud
Copy link

sonarcloud bot commented Oct 5, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 1 Code Smell

No Coverage information No Coverage information
12.1% 12.1% Duplication

Copy link
Contributor

@leoluz leoluz left a comment

Choose a reason for hiding this comment

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

LGTM

@zachaller zachaller enabled auto-merge (squash) October 5, 2023 15:01
@zachaller zachaller merged commit ba7c9a5 into master Oct 5, 2023
21 of 22 checks passed
@zachaller zachaller deleted the fix-notification-error-stop-other-notifications branch October 5, 2023 16:30
zachaller added a commit that referenced this pull request Oct 5, 2023
* fix: missing notification on error

Signed-off-by: zachaller <[email protected]>

* fix tests

Signed-off-by: zachaller <[email protected]>

* aggregate errors

Signed-off-by: zachaller <[email protected]>

* fix bad stat counts

Signed-off-by: zachaller <[email protected]>

* return errors

Signed-off-by: zachaller <[email protected]>

* fix tests on return of errors

Signed-off-by: zachaller <[email protected]>

* change case on logs

Signed-off-by: zachaller <[email protected]>

* missed a case

Signed-off-by: zachaller <[email protected]>

---------

Signed-off-by: zachaller <[email protected]>
@zachaller zachaller added the cherry-pick-completed Used once we have cherry picked the PR to all requested releases label Oct 5, 2023
phclark pushed a commit to phclark/argo-rollouts that referenced this pull request Oct 13, 2023
* fix: missing notification on error

Signed-off-by: zachaller <[email protected]>

* fix tests

Signed-off-by: zachaller <[email protected]>

* aggregate errors

Signed-off-by: zachaller <[email protected]>

* fix bad stat counts

Signed-off-by: zachaller <[email protected]>

* return errors

Signed-off-by: zachaller <[email protected]>

* fix tests on return of errors

Signed-off-by: zachaller <[email protected]>

* change case on logs

Signed-off-by: zachaller <[email protected]>

* missed a case

Signed-off-by: zachaller <[email protected]>

---------

Signed-off-by: zachaller <[email protected]>
Signed-off-by: Philip Clark <[email protected]>
phclark pushed a commit to phclark/argo-rollouts that referenced this pull request Oct 15, 2023
* fix: missing notification on error

Signed-off-by: zachaller <[email protected]>

* fix tests

Signed-off-by: zachaller <[email protected]>

* aggregate errors

Signed-off-by: zachaller <[email protected]>

* fix bad stat counts

Signed-off-by: zachaller <[email protected]>

* return errors

Signed-off-by: zachaller <[email protected]>

* fix tests on return of errors

Signed-off-by: zachaller <[email protected]>

* change case on logs

Signed-off-by: zachaller <[email protected]>

* missed a case

Signed-off-by: zachaller <[email protected]>

---------

Signed-off-by: zachaller <[email protected]>
Signed-off-by: Philip Clark <[email protected]>
phclark pushed a commit to phclark/argo-rollouts that referenced this pull request Oct 15, 2023
* fix: missing notification on error

Signed-off-by: zachaller <[email protected]>

* fix tests

Signed-off-by: zachaller <[email protected]>

* aggregate errors

Signed-off-by: zachaller <[email protected]>

* fix bad stat counts

Signed-off-by: zachaller <[email protected]>

* return errors

Signed-off-by: zachaller <[email protected]>

* fix tests on return of errors

Signed-off-by: zachaller <[email protected]>

* change case on logs

Signed-off-by: zachaller <[email protected]>

* missed a case

Signed-off-by: zachaller <[email protected]>

---------

Signed-off-by: zachaller <[email protected]>
Signed-off-by: Philip Clark <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cherry-pick/release-1.6 cherry-pick-completed Used once we have cherry picked the PR to all requested releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants