Skip to content

Add Experiment badge and popover

What does this MR do and why?

For the pre-receive secret detection Experiment, we want to surface that this is an experimental feature in the UI/instance level setting.

This MR adds a reusable experiment badge helper in haml, and adds the new badge to the new pre-receive secret detection setting (Admin > Settings > Security and Compliance > Secret Detection)

Resolves: #435065 (closed)

Pajamas: https://design.gitlab.com/usability/feature-management#highlighting-feature-versions

https://design.gitlab.com/components/tooltip/code

Screenshots or screen recordings

Screenshots are required for UI changes, and strongly recommended for all other merge requests.

image

How to set up and validate locally

Numbered steps to set up and validate the change are strongly suggested.

In the rails console,

pry(main)> Gitlab::CurrentSettings.update!(pre_receive_secret_detection_enabled: true) # to ensure feature is enabled instance-wide

pry(main)> project = Project.find(PROJECT_ID)
pry(main)> Feature.enable(:pre_receive_secret_detection_push_check, project) 

This feature is for Gitlab Dedicated only -- the easiest way I found to test this when not on Dedicated was to comment out the Dedicated check:

Change this line: ee/app/views/admin/application_settings/security_and_compliance.html.haml:17

- if ::Gitlab::CurrentSettings.gitlab_dedicated_instance? && License.feature_available?(:pre_receive_secret_detection)
+ if License.feature_available?(:pre_receive_secret_detection)

MR acceptance checklist

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

Edited by Serena Fang

Merge request reports

Loading