fix(api): exclude muted findings from pass_count, fail_count and manual_count#10753
Merged
Conversation
Contributor
|
✅ All necessary |
Contributor
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
bb510dc to
1699469
Compare
Contributor
🔒 Container Security ScanImage: 📊 Vulnerability Summary
4 package(s) affected
|
After excluding muted findings from pass_count/fail_count/manual_count, fully-muted groups lost their underlying status (fell to MANUAL default). Now status derivation uses the sum of non-muted + muted counts so the check outcome is preserved regardless of mute state.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10753 +/- ##
=======================================
Coverage 93.52% 93.52%
=======================================
Files 227 227
Lines 31978 31980 +2
=======================================
+ Hits 29907 29909 +2
Misses 2071 2071
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
Collaborator
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation and see the Github Action logs for details |
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.
Context
pass_count,fail_countandmanual_countin finding-group responses were including muted findings. This made the counters inconsistent - a group could reportfail_count: 1whilefail_muted_count: 1, implying there was an actionable failure when in reality the only failing finding was muted.Backport of #10708.
Description
Added
muted=Falsefilter to thepass_count,fail_countandmanual_countannotations in both aggregation paths:scan.py(aggregate_finding_group_summaries): the primary path that stores counters inFindingGroupDailySummaryduring scan processing.views.py(_aggregate_findings): the runtime fallback path used when finding-level filters are applied.The
*_muted_countfields (pass_muted_count,fail_muted_count,manual_muted_count) continue to track muted findings separately, so no information is lost.Updated the existing test
test_finding_groups_fully_muted_group_reflects_underlying_statusto expectfail_count == 0for a fully-muted group.Steps to review
scan.pyandviews.py- both now usemuted=Falsefor the base counters.*_muted_countfields are unaffected.Checklist
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.