CI/CD limits form should validate input values
Follow up issue for: !150765 (comment 1898591827)
The admin CI/CD limits form currently doesn't seem to have any input validation, e.g. I could enter -6 as the "maximum number of jobs in a single pipeline" and it gets persisted.
It does not disrupt the functioning of CI/CD though.
Steps to Reproduce
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 negative value into the box for
Maximum number of Instance-level CI/CD variables that can be defined
and save to apply - Use Plan limits API or Rails console to check updated limit value:
Plan.default.actual_limits.ci_instance_level_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
- Issue a PUT request to update the ci_instance_level_variables limit value
PUT http://gdk.local:3000/api/v4/application/plan_limits?plan_name=default&ci_instance_level_variables=100
- Use another GET request to confirm the limit is updated