Add storage_size_limit to plan_limits table
What does this MR do?
To specify the cap for each plan for the storage I have added storage_size_limit
column which will specify in MB the value each plan can have by default.
Why this change ?
When called actual_plan method for a namespace, it checks if the gitlab_subscription is present or not and if not then it either creates one with free
plan and if the subscription is present then it checks it plan and if nothing seems to appear for GL.com it returns free
plan.
Every plan has plan_limits entry and hence when specified storage_size_limit
within the plan_limits provide the comfort and control to change the values in future whenever needed without having to change the codebase. As there are only 6 plans there are only 6 plan_limits in the database at the time of writing this description.
Database Migration
== 20200624075411 AddStorageSizeLimitToPlanLimit: migrating ===================
-- add_column(:plan_limits, :storage_size_limit, :integer, {:default=>0, :null=>false})
-> 0.0053s
== 20200624075411 AddStorageSizeLimitToPlanLimit: migrated (0.0054s) ==========
== 20200624075411 AddStorageSizeLimitToPlanLimit: reverting ===================
-- remove_column(:plan_limits, :storage_size_limit, :integer, {:default=>0, :null=>false})
-> 0.0034s
== 20200624075411 AddStorageSizeLimitToPlanLimit: reverted (0.0071s) ==========
Conformity
-
Changelog entry -
Documentation (if required) -
Code review guidelines -
Merge request performance guidelines -
Style guides -
Database guides -
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. -
Tested in all supported browsers -
Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Security
If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:
-
Label as security and @ mention @gitlab-com/gl-security/appsec
-
The MR includes necessary changes to maintain consistency between UI, API, email, or other methods -
Security reports checked/validated by a reviewer from the AppSec team
Part of #222980