Skip to content

fix: Improve secret detection error notification

Dheeraj Joshi requested to merge djadmin-secret-detection-error-msg into main

Related issues: gitlab#456548 (closed), gitlab#455435 (closed)

What & Why

This MR enhances the error message display when secrets are detected upon pushing a commit by

  • showing a generic message when secrets are detected in a commit.
  • it adds an action button that leads the user to the output window.
  • the output window displays the complete error message with better formatting.

This is mainly done because

  1. The current error messages are very long and crash the browser.
  2. The VSCode notification API doesn't allow formatting the messages.

Screenshot

Before

image

After

Notification (generic message) Output channel (When see results is clicked)
image image

Note: Multiline log formatting is moved to the follow-up MR: !322 (merged)

Steps to reproduce

  1. With the example app, open the gitlab-org/gitlab repository
  2. Try to update the ee/spec/support/shared_examples/lib/gitlab/secrets_check_shared_examples.rb file
  3. The error message should be updated as per the screenshots above
Edited by Dheeraj Joshi

Merge request reports