fix: Improve secret detection error notification
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
- The current error messages are very long and crash the browser.
- The VSCode notification API doesn't allow formatting the messages.
Screenshot
Before
After
Notification (generic message) | Output channel (When see results is clicked) |
---|---|
![]() |
![]() |
Note: Multiline log formatting is moved to the follow-up MR: !322 (merged)
Steps to reproduce
- With the example app, open the gitlab-org/gitlab repository
- Try to update the
ee/spec/support/shared_examples/lib/gitlab/secrets_check_shared_examples.rb
file - The error message should be updated as per the screenshots above
Edited by Dheeraj Joshi