Skip to content

Add an alert in the pipeline editor

What does this MR do?

This creates an alert that shows up in the pipeline editor when a configuration code snippet has been copied from a configuration form. This currently only affects API Fuzzing: when using the configuration form, the API generates a YAML code snippet that the user can copy to the clipboard before being redirected to the pipeline editor. From there, the alert recommends the user to paste the snippet in the correct location and provides a link to the corresponding feature's documentation, as well as a link back to the configuration form they've just used.

Eventually, the same behavior will be used for other security features, starting with DAST that will soon be configurable via a form similar to the API Fuzzing one. The alert has therefor been implemented in a way that should be flexible enough to add support for more features.

How to test this?

  1. Navigate to a project's API Fuzzing configuration form at /:namespace/:project/-/security/configuration/api_fuzzing.
  2. Fill out the form and submit it.
  3. In the code snippet modal that shows up, click on Copy code snippet and open .gitlab-ci.yml.
    • The code snippet should be copied to your clipboard.
    • You should see the alert above the pipeline editor.

Screenshots (strongly suggested)

Before After
Screen_Shot_2021-04-06_at_10.33.31_AM Screen_Shot_2021-04-06_at_10.32.56_AM

snippet_alert

Does this MR meet the acceptance criteria?

Conformity

Availability and Testing

Related to #321201 (closed)

Edited by Paul Gascou-Vaillancourt

Merge request reports