Skip to content

Tweaks plan limit validations to support unlimited

Vijay Hawoldar requested to merge vij-tweak-limit-validations into master

What does this MR do and why?

Tweaks plan limit validations in the update service, to support unlimited values.

In order to allow unlimited limit values (0), the validations for plan limits have been adjusted within the update service.

This MR also ensures we treat each validation error individually, i.e. adding two errors instead of one combined one, for each rule violation.

It's worth noting these limits are only updated via the admin panel, no customers will see these validations.

Traditionally, we'd expect to see validations like this in the model, but in this instance it was decided against, and so this MR follows suit

Refs https://gitlab.com/gitlab-org/gitlab/-/issues/429651

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

Before After

How to set up and validate locally

  • visit http://gdk.test:3000/admin/namespace_limits
  • update values to break these rules:
    • notification_limit is greater than or equal to storage_size_limit (dashboard limit)
    • enforcement_limit is greater than or equal to storage_size_limit (dashboard limit)
    • enforcement_limit is greater than or equal to notification_limit
  • updates values to 0

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 Vijay Hawoldar

Merge request reports