Limit vulnerability management policy to 5 rules
What does this MR do and why?
Related #503841 (closed)
Limit vulnerability management policy to 5 rules
Limit the amount of rules that can be added for a vulnerability management policy to 5 and make sure the Add rule button gets hidden conditionally.
References
Please include cross links to any resources that are relevant to this MR This will give reviewers and future readers helpful context to give an efficient review of the changes introduced.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Add rule button hidden when 5 rules are added
JSON schema validation when more than 5 rules are added
Backend validation error against JSON schema when you try to save with more than 5 rules
How to set up and validate locally
- Enable
vulnerability_management_policyfeature flag at http://gdk.test:3000/rails/features - Go to any project
- Go to Secure > Policies
- Click New policy
- Click Select policy on the Vulnerability management policy card
- Add 5 conditions and validate that you can't add another condition in "rule" mode
- Add another rule in the yaml mode, validate the JSON schema underlies the yaml and shows error on hovering


