Skip to content

Do not send emails when issues are confidential (Fixes: #222908)

Micah requested to merge micah/gitlab:no_confidential_emails into master

What does this MR do and why?

This MR will check to see if the issue being handled is marked confidential, and if it is, it will not send an email on changes to the issue. This keeps the confidentiality of the issue in place, as otherwise the clear-text contents of the confidential issue are sent over email.

Screenshots or screen recordings

As a demonstration, from the rails console:

Make issue id 4 confidential (via the web interface) and then test it:

irb(main):043:0> foo = Issue.find(4)
=> #<Issue id:4 tasks#11466>
irb(main):038:1* unless foo.confidential?
irb(main):039:1*   puts "not confidential"
irb(main):040:1* else
irb(main):041:1*   puts "confidential"
irb(main):042:0> end
confidential
=> nil

Make issue id 4 not confidential (via the web interface) and then test it:

irb(main):043:0> foo = Issue.find(4)
=> #<Issue id:4 tasks#11466>
irb(main):044:1* unless foo.confidential?
irb(main):045:1*   puts "not confidential"
irb(main):046:1* else
irb(main):047:1*   puts "confidential"
irb(main):048:0> end
not confidential
=> nil
irb(main):049:0>

How to set up and validate locally

  1. Create or modify a confidential issue, there should be no email generated as a result.

MR acceptance checklist

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

Merge request reports