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?
- Navigate to a project's API Fuzzing configuration form at
/:namespace/:project/-/security/configuration/api_fuzzing
. - Fill out the form and submit it.
- 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 |
---|---|
![]() |
![]() |
Does this MR meet the acceptance criteria?
Conformity
-
📋 Does this MR need a changelog?-
I have included a changelog entry. - [-] I have not included a changelog entry because _____.
-
- [-] Documentation (if required)
-
Code review guidelines - [-] Merge request performance guidelines
-
Style guides - [-] Database guides
-
Separation of EE specific content
Availability and Testing
-
Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process. - [-] Tested in all supported browsers
- [-] Informed Infrastructure department of a default or new setting change, if applicable per definition of done
Related to #321201 (closed)