Skip to content

Add pre-receive project-level setting to UI to allow toggling the feature for a project

Overview

Add UI configuration options at the instance and project level to enable pre-receive secret detection.

Designs

Design UI: #451559 (closed)

Implementation Plan

Instance level setting
Project setting
  • Add a new card for pre-recive
  • Add a new toggle with GlToggle
  • Query the existing state from app/presenters/projects/security/configuration_presenter.rb
  • Add GraphQL mutation as per the decision below
  • Add toast notification
  • Lock feature card if global setting is disabled
  • Put everything behind the feature flag
  • Add test coverage and update any existing specs as per the changes above
Mutation

GraphQL mutation implementation (via new file app/assets/javascripts/security_configuration/graphql/set_pre_receive_secret_detection.graphql):

mutation SetPreReceiveSecretDetection($input: SetPreReceiveSecretDetectionInput!) {
  setPreReceiveSecretDetection(input: $input) {
    preReceiveSecretDetectionEnabled
    errors
  }
}

Refer the latest decision from #451352 (closed)

Feature Flag

Put changes behind the feature flag pre_receive_secret_detection_push_check, depending on the progress of Dogfood Pre-receive SD on internal GitLab projects (#451596 - closed)

Edited by Dheeraj Joshi