astarte-platform / astarte

Core Astarte Repository
https://docs.astarte-platform.org/
Apache License 2.0
238 stars 46 forks source link

RM: take maximum storage retention into account #913

Closed Annopaolo closed 5 months ago

Annopaolo commented 6 months ago

Since we will allow to set/edit datastream max retention period in Housekeeping, add a way to retrieve its value in RM, too.

Moreover, as of today there are no checks on whether an interface contains only mappings with database_retention_ttl lower than the maximum storage TTL allowed for the realm, making it possible to bypass the maximum allowed retention. Add this check on interface install and update. This change can be breaking, as some interfaces won't be installed anymore if the max allowed retention for the realm is set.

In the backend and RPC we use the Scylla convention that TTL=0 means no TTL. However, the value given to the user if no maximum storage retention TTL is set will be the more understandable null.

Annopaolo commented 6 months ago

~This PR is based, based on #912~

codecov[bot] commented 6 months ago

Codecov Report

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

Project coverage is 68.22%. Comparing base (c335319) to head (69b27df).

Files Patch % Lines
...gement/lib/astarte_realm_management/rpc/handler.ex 0.00% 3 Missing :warning:
...management/lib/astarte_realm_management/queries.ex 81.81% 2 Missing :warning:
...tarte_realm_management_api/rpc/realm_management.ex 75.00% 1 Missing :warning:
...i/test/support/astarte_realm_management_mock_db.ex 90.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #913 +/- ## ========================================== + Coverage 68.11% 68.22% +0.10% ========================================== Files 276 276 Lines 7192 7238 +46 ========================================== + Hits 4899 4938 +39 - Misses 2293 2300 +7 ```

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