Skip to content

Add prop validator to widget name

Savas Vedova requested to merge 381084-add-prop-validator into master

What does this MR do and why?

Adds a prop validator for the widget name.

Screenshots or screen recordings

When provided an invalid widget name, there'll be an error in the console and tests will fail:

image

How to set up and validate locally

  1. You'll need an EE License
  2. You'll need to have runners enabled (See $2408961 for setting up a runner)
  3. Enable :refactor_security_extension to turn this feature on.
echo "Feature.enable(:refactor_security_extension)" | rails c
  1. Import https://gitlab.com/gitlab-examples/security/security-reports
  2. Create a new MR by editing a file
  3. Go to the MR page and check the widget
  4. Change the name of the widget and see the error in the console: mr_security_reports_widget.vue

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Related to #381084 (closed)

Merge request reports