BBMRI-ERIC / negotiator

An Open-source access negotation system for Research Infrastructures
https://negotiator.bbmri-eric.eu
GNU Affero General Public License v3.0
3 stars 8 forks source link

fix attachments memory consumption #281

Closed svituz closed 2 months ago

svituz commented 2 months ago

Negotiator pull request:

Description:

This PR improves performance when getting attachments of big negotiations. It adds Blaze Persistence dependency since it gives the possibility, compared to JPA projection, to specify a subset of columns also for nested projections. The authorization on objects (negotiation, attachments, and posts) is checked directly by querying the database instead of fetching unnecessary objects from the DB. This should improve memory usage.

Checklist:

Make sure you tick all the boxes below if they are true or do not apply:

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 86.81319% with 12 lines in your changes are missing coverage. Please review.

Project coverage is 77.53%. Comparing base (0d7f0cc) to head (38a4b87).

Files Patch % Lines
...i_eric/negotiator/service/DBAttachmentService.java 83.63% 6 Missing and 3 partials :warning:
...atabase/model/views/MetadataAttachmentViewDTO.java 81.81% 2 Missing :warning:
...tiator/database/model/views/AttachmentViewDTO.java 80.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #281 +/- ## ============================================ + Coverage 76.39% 77.53% +1.13% - Complexity 871 905 +34 ============================================ Files 123 125 +2 Lines 2745 2773 +28 Branches 159 161 +2 ============================================ + Hits 2097 2150 +53 + Misses 542 523 -19 + Partials 106 100 -6 ``` | [Flag](https://app.codecov.io/gh/BBMRI-ERIC/negotiator/pull/281/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BBMRI-ERIC) | Coverage Δ | | |---|---|---| | [unit](https://app.codecov.io/gh/BBMRI-ERIC/negotiator/pull/281/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BBMRI-ERIC) | `77.53% <86.81%> (+1.13%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=BBMRI-ERIC#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.