Skip to content

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

Overview

Add the new setting to the API to allow toggling the feature for a project.

Consideration

We may also need to have this behind a feature flag, depending on the progress of Dogfood Pre-receive SD on internal GitLab projects (#451596 - closed) • rossfuhrman • 17.0

Implementation Plan

  • Add ability to toggle the setting through the API
  • Ability to toggle the feature will be gated by the pre_receive_secret_detection_push_check feature flag (managed at the project level)
  • Ensure proper documentation and specs

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
  }
}

Refinement Progress

If a checkbox is not relevant for the issue, please remove it.

  • This issue describes a problem to solve, or a task to complete, and it's confirmed.
  • This issue describes a proposal or an implementation plan that outlines a way to solve the problem or complete the task.
  • This issue is the smallest iteration possible and doesn't require further break down.
  • This issue has weight set - based on how many tasks or merge requests are required - and needs weight label is removed.
  • This issue is labeled correctly.
  • This issue is reviewed by another team member to confirm strategy and estimate.
  • Finally, add workflowready for development label to this issue.
Edited by rossfuhrman