Fix error when deleting all optional variables

What does this MR do and why?

Fix error when deleting all optional variables

An error was occurring when updating the DAST scan from having multiple optional variables to having no optional variables.

Changelog: fixed EE: true

References

This bug was discovered as part of this MR: Restricting DAST Variables Mutation Payload Schema (!177577 - merged) • Dheeraj Joshi • 17.8

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

Reproduction steps provided here: !177577 (comment 2291196131)

How to set up and validate locally

  1. Go to a projects DAST profile library: -/security/configuration/profile_library#site-profiles
  2. Create a new Site Profile
  3. Under the Additional variables section, add at least two optional variables
  4. Confirm that you can save the profile
  5. Edit the profile, and delete all of the Additional variables
  6. Save the profile and notice it error on the master branch, or at least not save your changes. The exact behavior will depend on the state of your master branch.
  7. Switch to this branch
  8. Edit the profile, and delete all of the Additional variables
  9. Save the profile and notice it save successfully
  10. ???
  11. Profit
Edited by rossfuhrman

Merge request reports

Loading