Skip to content

feat(api): add sort support for all finding group counter fields#10655

Open
AdriiiPRodri wants to merge 2 commits intomasterfrom
add-finding-groups-sorts
Open

feat(api): add sort support for all finding group counter fields#10655
AdriiiPRodri wants to merge 2 commits intomasterfrom
add-finding-groups-sorts

Conversation

@AdriiiPRodri
Copy link
Copy Markdown
Contributor

Context

The finding groups endpoint exposes granular counter fields (per-status muted counts, new/changed breakdowns) but they were not sortable. This adds sort support for all counter fields so the UI can order finding groups by any metric.

Description

  • Added 15 new sort fields to _FINDING_GROUP_SORT_MAP: pass_muted_count, fail_muted_count, manual_muted_count, and all new_*/changed_* breakdown counters
  • Kept delta sort for backwards compatibility (expands to new_count, changed_count)
  • Added parametrized tests covering ascending and descending sort for all new fields on both list and latest endpoints

Steps to review

  1. Check the new entries in _FINDING_GROUP_SORT_MAP in api/src/backend/api/v1/views.py
  2. Verify the parametrized test in test_views.py covers all 15 new sort fields
  3. Run poetry run pytest api/src/backend/api/tests/test_views.py -k "test_finding_groups_sort_by_counter_fields" -x

Checklist

Community Checklist
  • This feature/issue is listed in here or roadmap.prowler.com
  • Is it assigned to me, if not, request it via the issue/feature in here or Prowler Community Slack

API (if applicable)

  • All issue/task requirements work as expected on the API
  • Endpoint response output (if applicable)
  • EXPLAIN ANALYZE output for new/modified queries or indexes (if applicable)
  • Performance test results (if applicable)
  • Any other relevant evidence of the implementation (if applicable)
  • Verify if API specs need to be regenerated.
  • Check if version updates are required.
  • Ensure new entries are added to api/CHANGELOG.md

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 10, 2026 13:31
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 2026

✅ All necessary CHANGELOG.md files have been updated.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 10, 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 10, 2026

🔒 Container Security Scan

Image: prowler-api:26ad60e
Last scan: 2026-04-10 13:42:00 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:

@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.61%. Comparing base (e4b2950) to head (e63eb4f).
⚠️ Report is 5 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master   #10655   +/-   ##
=======================================
  Coverage   93.60%   93.61%           
=======================================
  Files         227      227           
  Lines       31906    31923   +17     
=======================================
+ Hits        29867    29884   +17     
  Misses       2039     2039           
Flag Coverage Δ
api 93.61% <100.00%> (+<0.01%) ⬆️

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

Components Coverage Δ
prowler ∅ <ø> (∅)
api 93.61% <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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant