Skip to content

Add application limits to CI Variables settings

Mireya Andres requested to merge ci-variable-application-limits into master

What does this MR do and why?

For #362227 (closed)

Users are no longer allowed to add CI variables if they have exceeded or are about to exceed the maximum application limit for their respective group or project. This applies to group and project CI variables; admin CI variables are not affected.

Note that the popover from the design was not implemented here, since disabled buttons don't fire hover/focus events that would trigger the popover to show up.

Screenshots or screen recordings

Note: Limit has been set to 5 or 10 for testing purposes (default is 200):

CI/CD Settings Without Limits With Limits (alert on top of table) With Limits (disabled button + alert at the bottom)
Group group_before group_variables group_variables_buttons
Project project_before project_variables project_variables_buttons
Admin (No Changes) admin

When deleting/adding a variable

Screen_Recording_2022-11-25_at_10.13.09

How to set up and validate locally

  1. Download the patch below and apply it to your branch. This will set the application limit to 5 instead of the default 200.

set-limit.patch

git am < set-limit.patch
  1. Go to the CI Variables settings (Settings > CI/CD > Variables) for either a project or a group.
  2. If your project/group has exceeded 5 variables, the Add Variable button should be disabled and the max limit alert should show up.

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 Mireya Andres

Merge request reports