fix(analysis): provide actionable error for empty metric results in AnalysisRun#4679
Open
Kunalbehbud wants to merge 2 commits intoargoproj:masterfrom
Open
fix(analysis): provide actionable error for empty metric results in AnalysisRun#4679Kunalbehbud wants to merge 2 commits intoargoproj:masterfrom
Kunalbehbud wants to merge 2 commits intoargoproj:masterfrom
Conversation
…nalysisRun Signed-off-by: kunal.behbudzade <[email protected]>
Contributor
Published E2E Test Results 4 files 4 suites 3h 39m 11s ⏱️ For more details on these failures, see this check. Results for commit df6b171. ♻️ This comment has been updated with latest results. |
Contributor
Published Unit Test Results2 459 tests 2 459 ✅ 3m 18s ⏱️ Results for commit df6b171. ♻️ This comment has been updated with latest results. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #4679 +/- ##
==========================================
- Coverage 84.94% 84.94% -0.01%
==========================================
Files 164 164
Lines 18954 18971 +17
==========================================
+ Hits 16100 16114 +14
- Misses 2000 2002 +2
- Partials 854 855 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Signed-off-by: kunal.behbudzade <[email protected]>
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
When an AnalysisRun metric condition indexes into
result(for exampleresult[0]) and the provider returns an empty result set, Argo Rollouts currently surfaces a low-level evaluation error.This change returns a more actionable message explaining that the metric result is empty or unavailable and that the condition should be guarded with
len(result) > 0.It adds unit coverage for this behavior in
utils/evaluate/evaluate_test.goandmetricproviders/prometheus/prometheus_test.go.Testing
make lintPATH="/home/kunal/Desktop/contribute/Argo/argo-rollouts/dist:$PATH" ./test/kustomize/test.shgo test ./...Fixes #2101