Add a checkbox for adding SAST to a new project
What does this MR do and why?
Part of https://gitlab.com/gitlab-org/gitlab/-/issues/333196.
This is an experiment for new projects, that adds a checkbox to add SAST configuration to the repo automatically. When checked, a new project will get the standard SAST configuration commit on the default branch.
Screenshots or screen recordings
When creating a new blank project, a user who is assigned to the experiment is presented with a checkbox to enable SAST.
When both checkboxes are checked you end up with the following two commits:
You can alternately only check one of the checkboxes.
How to set up and validate locally
Verifying the candidate. You can always check the control as well with:
- Enable the experiment for your test user
ApplicationExperiment.new(:new_project_sast_enabled, :candidate, user: User.find_by_username!('root'))
- Create a new blank project (@ http://gdk.test:3000/projects/new)
- Check the Enable SAST checkbox to see the commit that's added to the default branch
Verifying the free indicator variant. There's an additional variant that includes a "free" badge at the end of the label, but is otherwise identical to the candidate.
- Enable the experiment for your test user
ApplicationExperiment.new(:new_project_sast_enabled, :free_indicator, user: User.find_by_username!('root'))
- Create a new blank project (@ http://gdk.test:3000/projects/new)
- You should see the free label.
Verifying the control. You can always check the control as well with:
ApplicationExperiment.new(:new_project_sast_enabled, :control, user: User.find_by_username!('root'))
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.