Expose dotenv variable and size limits configuration in API and UI
What does this MR do and why?
This MR allows for enabling the modification of the dotenv_variables and dotenv_size limits via UI and API in addition to Rails console. This functionality would allow Dedicated customers the ability to self serve when they need to adjust these limits for their instance.
Closes #432529
Screenshots or screen recordings
UI
Before | After |
---|---|
![]() |
![]() |
API
Example API response from GET issued to http://gdk.local:3000/api/v4/application/plan_limits
where "dotenv_size":
and "dotenv_variables":
are now returned:
After:
{
"ci_instance_level_variables": 5,
"ci_pipeline_size": 0,
"ci_active_jobs": 0,
"ci_project_subscriptions": 2,
"ci_pipeline_schedules": 10,
"ci_needs_size_limit": 50,
"ci_registered_group_runners": 1000,
"ci_registered_project_runners": 1000,
"dotenv_variables": 20,
"dotenv_size": 5120,
"conan_max_file_size": 3221225472,
"enforcement_limit": 0,
"generic_packages_max_file_size": 5368709120,
"helm_max_file_size": 5242880,
"limits_history": {},
"maven_max_file_size": 3221225472,
"notification_limit": 0,
"npm_max_file_size": 524288000,
"nuget_max_file_size": 524288000,
"pipeline_hierarchy_size": 1000,
"pypi_max_file_size": 3221225472,
"terraform_module_max_file_size": 1073741824,
"storage_size_limit": 0
}
Before:
{
"ci_pipeline_size": 0,
"ci_active_jobs": 0,
"ci_project_subscriptions": 2,
"ci_pipeline_schedules": 10,
"ci_needs_size_limit": 50,
"ci_registered_group_runners": 1000,
"ci_registered_project_runners": 1000,
"conan_max_file_size": 3221225472,
"enforcement_limit": 0,
"generic_packages_max_file_size": 5368709120,
"helm_max_file_size": 5242880,
"limits_history": {},
"maven_max_file_size": 3221225472,
"notification_limit": 0,
"npm_max_file_size": 524288000,
"nuget_max_file_size": 524288000,
"pipeline_hierarchy_size": 1000,
"pypi_max_file_size": 3221225472,
"terraform_module_max_file_size": 1073741824,
"storage_size_limit": 0
}
How to set up and validate locally
Prerequisite: A GDK instance set up with changes branch active
UI:
- In GDK instance, navigate to the settings page: /admin/application_settings/ci_cd and scroll down to CI/CD limits section
- Fill a value into the box for
Maximum size of a dotenv artifact in bytes
and/orMaximum number of variables inside a dotenv artifact
and save to apply - Use Plan limits API or Rails console to check updated limit value:
Plan.default.actual_limits.dotenv_size
Plan.default.actual_limits.dotenv_variables
API:
Note: Administrator access is required to use Plan limits API - need an API token for auth with admin access for the following steps)
- Use GET request to obtain the current limits
GET http://gdk.local:3000/api/v4/application/plan_limits
- Issue a PUT request to update the dotenv_size and/or dotenv_artifacts limit values
PUT http://gdk.local:3000/api/v4/application/plan_limits?plan_name=default&dotenv_variables=100&dotenv_size=10000
- The response should contain the updated values. You can also use another GET request to confirm the limit is updated.