Add setting to not display code diffs in MR review emails
What does this MR do and why?
This merge requests adds a new setting to the "General" page of an individual project. When the setting is toggled on, the code diffs which would normally be sent in the email about a review will be hidden. This prevents a potential avenue of sensitive code reaching unintended recipients.
Fixes #24733 (closed)
Screenshots or screen recordings
Toggled On (default):
DB Interactions
Migration:
gitlab$ bin/rails db:migrate
== 20220131192643 AddShowDiffPreviewInEmailToProjectSettings: migrating =======
-- add_column(:project_settings, :show_diff_preview_in_email, :boolean, {:default=>true, :null=>false})
-> 0.0023s
== 20220131192643 AddShowDiffPreviewInEmailToProjectSettings: migrated (0.0024s)
Rollback:
bin/rails db:rollback
== 20220131192643 AddShowDiffPreviewInEmailToProjectSettings: reverting =======
-- remove_column(:project_settings, :show_diff_preview_in_email, :boolean, {:default=>true, :null=>false})
-> 0.0017s
== 20220131192643 AddShowDiffPreviewInEmailToProjectSettings: reverted (0.0032s)
How to set up and validate locally
- Check out the branch
- Generate merge request with diff.
- Comment on specific line, see that HTML/text diff is in the resulting email
- Toggle setting, save
- Comment on another line, see that the HTML/text diff is not in the resulting email
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.
Edited by Joe Snyder