Skip to content

Render error messages with line breaks in MR Suggestions

What does this MR do and why?

Related to #456547 (closed)

MR acceptance checklist

Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Screenshots or screen recordings

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

Before After
image image

How to set up and validate locally

  1. Enable Secret push protection feature
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) 

OR apply this patch to disable checks

diff --git a/ee/lib/gitlab/checks/secrets_check.rb b/ee/lib/gitlab/checks/secrets_check.rb
index 00b6743998d7..810354d7889e 100644
--- a/ee/lib/gitlab/checks/secrets_check.rb
+++ b/ee/lib/gitlab/checks/secrets_check.rb
@@ -93,8 +93,7 @@ def validate!
       # GitLab.com projects. For progress, follow
       # https://gitlab.com/groups/gitlab-org/-/epics/12729
       def run_pre_receive_secret_detection?
-        Gitlab::CurrentSettings.current_application_settings.pre_receive_secret_detection_enabled &&
-          (enabled_for_gitlabcom_project? || enabled_for_dedicated_project?)
+        true
       end
 
       def enabled_for_gitlabcom_project?
  1. In the GDK, add a suggestion to any active MR with the following secret: glpat-12345678901234567890
  2. The error message should be rendered as shown in the screenshot above.
Edited by Dheeraj Joshi

Merge request reports

Loading