Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(findings): Optimize findings endpoint #7019

Conversation

vicferpoy
Copy link
Member

@vicferpoy vicferpoy commented Feb 24, 2025

Description

This PR includes a full refactor of the GET /findings endpoint logic, changing the way queries are built using the ORM and DRF-JSON:API library. The include query parameter has also been changed to allow the following values:

  • scan
  • scan.provider
  • resources

Required changes on the UI side have been added and tested as part of this PR.

In addition, few composite and partial indexes have been added. Using our cloud DEV environment, here are the metrics comparison between the former implementation and this one:

image

Checklist

API

  • Verify if API specs need to be regenerated.
  • Check if version updates are required (e.g., specs, Poetry, etc.).
  • Ensure new entries are added to CHANGELOG.md, if applicable.

License

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

Copy link

codecov bot commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 87.35632% with 11 lines in your changes missing coverage. Please review.

Project coverage is 92.68%. Comparing base (a2c5c71) to head (2efa456).
Report is 16 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7019      +/-   ##
==========================================
+ Coverage   88.66%   92.68%   +4.02%     
==========================================
  Files        1200       76    -1124     
  Lines       34647     6698   -27949     
==========================================
- Hits        30719     6208   -24511     
+ Misses       3928      490    -3438     
Flag Coverage Δ
api 92.68% <87.35%> (?)
prowler ?

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

Components Coverage Δ
prowler ∅ <ø> (∅)
api 92.68% <87.35%> (∅)

@vicferpoy vicferpoy marked this pull request as ready for review February 24, 2025 15:10
@vicferpoy vicferpoy requested review from a team as code owners February 24, 2025 15:10
Copy link
Member

@paabloLC paabloLC left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

UI changes looking good!

Copy link
Member

@jfagoagas jfagoagas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's impressive 👏 This is the way to go, thank you for taking care of it ❤️

@vicferpoy vicferpoy merged commit dbffed8 into master Feb 25, 2025
15 of 16 checks passed
@vicferpoy vicferpoy deleted the PRWLR-6202-refactor-database-resource-visibility-through-provider-is-deleted branch February 25, 2025 11:41
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.

3 participants