Skip to content

Add documentation link in secrets push check

What does this MR do and why?

This merge request adds a link to the documentation page for pre-receive secret detection in the secrets push check.

Resolves #435093 (closed).

MR acceptance checklist

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

Screenshots or screen recordings

Below is a before and after for the push check with the documentation link added.

Before After
Screenshot_2023-12-20_at_10.49.06_PM screenshot-for-435093

How to set up and validate locally

  • Create a new project or use an existing one.
  • In your rails console, execute the following commands:
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) 
  • Ensure your GDK is licensed as ultimate.
  • In your terminal, navigate to the project folder.
  • Create a new file, e.g. .env, and add a gitlab personal access token:
TOKEN=glpat-JUST20LETTERSANDNUMB
  • Run git add . and git commit -m 'test' to commit the file.
  • Run the command to push the commited file git push.
  • Verify the push fails due to the secret detected and it shows the documentation text/link.
Edited by Ahmed Hemdan

Merge request reports