Skip to content

Validate storage limits

Mohamed Hamda requested to merge mhamda/storage/limits-validation into master

What does this MR do and why?

This MR addresses: https://gitlab.com/gitlab-org/gitlab/-/issues/416114

This MR enhances the PlanLimits by adding validations to attributes notification_limit, enforcement_limit, and storage_size_limit attributes.

NOTE: Validating the model might be risky and complicated in this case.

We can even skip the validation if needed, but the controller validation is still beneficial. more details: https://gitlab.com/gitlab-org/gitlab/-/issues/416114#note_1487278682

Changes made in this MR:

  • Added custom validations to ensure that notification_limit is greater than or equal to storage_size_limit.
  • Added custom validations to ensure that enforcement_limit is greater than or equal to storage_size_limit.
  • Added custom validations to ensure that enforcement_limit is greater than or equal to notification_limit.
  • Updated the test cases to cover the new validations for all three attributes.

Validation steps:

Verification: Screenshot_2023-08-02_at_13.03.32

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Mohamed Hamda

Merge request reports