Validate storage limits
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 tostorage_size_limit
. - Added custom validations to ensure that
enforcement_limit
is greater than or equal tostorage_size_limit
. - Added custom validations to ensure that
enforcement_limit
is greater than or equal tonotification_limit
. - Updated the test cases to cover the new validations for all three attributes.
Validation steps:
- Go to the admin page at http://gdk.test:3000/admin/namespace_limits to check the namespace limits.
- Perform tests for the various validations mentioned above.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Mohamed Hamda