Skip to content

fix(api): exclude muted findings from pass_count, fail_count and manual_count#10753

Merged
AdriiiPRodri merged 3 commits into
masterfrom
fix-muted-counter
Apr 16, 2026
Merged

fix(api): exclude muted findings from pass_count, fail_count and manual_count#10753
AdriiiPRodri merged 3 commits into
masterfrom
fix-muted-counter

Conversation

@AdriiiPRodri
Copy link
Copy Markdown
Contributor

Context

pass_count, fail_count and manual_count in finding-group responses were including muted findings. This made the counters inconsistent - a group could report fail_count: 1 while fail_muted_count: 1, implying there was an actionable failure when in reality the only failing finding was muted.

Backport of #10708.

Description

Added muted=False filter to the pass_count, fail_count and manual_count annotations in both aggregation paths:

  • scan.py (aggregate_finding_group_summaries): the primary path that stores counters in FindingGroupDailySummary during scan processing.
  • views.py (_aggregate_findings): the runtime fallback path used when finding-level filters are applied.

The *_muted_count fields (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_status to expect fail_count == 0 for a fully-muted group.

Steps to review

  1. Check the annotation changes in scan.py and views.py - both now use muted=False for the base counters.
  2. Verify the test update reflects the new expected behavior.
  3. Confirm that *_muted_count fields are unaffected.

Checklist

  • Are there new checks included in this PR? No
  • Review if the code is being covered by tests.
  • Review if backport is needed.

API

  • All issue/task requirements work as expected on the API

License

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AdriiiPRodri AdriiiPRodri requested a review from a team as a code owner April 16, 2026 12:55
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

Conflict Markers Resolved

All conflict markers have been successfully resolved in this pull request.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 16, 2026

🔒 Container Security Scan

Image: prowler-api:2d2f40d
Last scan: 2026-04-16 13:51:57 UTC

📊 Vulnerability Summary

Severity Count
🔴 Critical 5
Total 5

4 package(s) affected

⚠️ Action Required

Critical severity vulnerabilities detected. These should be addressed before merging:

  • Review the detailed scan results
  • Update affected packages to patched versions
  • Consider using a different base image if updates are unavailable

📋 Resources:

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.
@AdriiiPRodri AdriiiPRodri added the backport-to-v5.24 Backport PR to the v5.24 branch label Apr 16, 2026
@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 16, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.52%. Comparing base (12bf3d5) to head (0049087).
⚠️ Report is 8 commits behind head on master.

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           
Flag Coverage Δ
api 93.52% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
prowler ∅ <ø> (∅)
api 93.52% <100.00%> (+<0.01%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@AdriiiPRodri AdriiiPRodri merged commit b08b072 into master Apr 16, 2026
42 checks passed
@AdriiiPRodri AdriiiPRodri deleted the fix-muted-counter branch April 16, 2026 13:56
@prowler-bot prowler-bot added the was-backported The PR was successfully backported to the target branch label Apr 16, 2026
@prowler-bot
Copy link
Copy Markdown
Collaborator

💚 All backports created successfully

Status Branch Result
v5.24

Questions ?

Please refer to the Backport tool documentation and see the Github Action logs for details

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-to-v5.24 Backport PR to the v5.24 branch component/api was-backported The PR was successfully backported to the target branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants