fix(api): treat muted findings as resolved in finding-groups status#10825
Merged
Conversation
Finding groups now report status=FAIL only when at least one non-muted FAIL remains. Groups whose failing findings are all muted collapse to PASS, matching the intent that muted findings are resolved/accepted and keeping status consistent with fail_count and the orthogonal muted flag. Aligns the Python post-processing, the SQL Case used by filter[status], and the status_order sort so the three paths agree. The muted boolean is unchanged: still true only when every finding in the group is muted.
Contributor
|
✅ All necessary |
Contributor
|
✅ Conflict Markers Resolved All conflict markers have been successfully resolved in this pull request. |
josema-xyz
previously approved these changes
Apr 21, 2026
1 task
josema-xyz
approved these changes
Apr 21, 2026
Contributor
🔒 Container Security ScanImage: 📊 Vulnerability Summary
4 package(s) affected
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #10825 +/- ##
===========================================
+ Coverage 78.23% 93.48% +15.24%
===========================================
Files 32 228 +196
Lines 1158 32081 +30923
===========================================
+ Hits 906 29990 +29084
- Misses 252 2091 +1839
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
When a finding group had muted FAIL findings, the aggregated
statusstayedFAILeven though no actionable (non-muted) failure remained. Concretely, a group like:{ "status": "FAIL", "muted": false, "pass_count": 1, "fail_count": 0, "fail_muted_count": 1, "muted_count": 1 }reported
status=FAILdespitefail_count=0, which contradicts the intent of muting (mark findings as resolved/accepted) and is inconsistent with the per-resource counters shown in the same payload.Fixes #10824
Description
This PR aligns the three code paths that compute the aggregated status on
/finding-groupsendpoints so muted findings no longer drive the status column:FAILonly while at least one non-muted FAIL remains (fail_count > 0).PASS(including fully-muted groups, whosemutedflag staystrue).MANUALis reserved for groups with only manual findings.Changes are scoped to
api/src/backend/api/v1/views.py:FindingGroupViewSet._post_process_aggregation(Python path on the finding-level aggregation)._apply_aggregated_computed_filters(SQLCaseused byfilter[status]/filter[status__in])._sorted_paginated_response(SQLCaseused bysort=status/sort=-status).The orthogonal
mutedboolean is unchanged: it is stilltrueonly when every finding in the group is muted.Steps to review
status=PASS,muted=false:status=PASS,muted=true:test_finding_groups_status_ignores_muted_failuresthat reproduces the reported payload.Checklist
API
License
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.