Blob embeds respect show_diff_preview_in_email
What does this MR do and why?
Part of #300855 (closed). Closes #618244 (closed).
Evaluate the setting both for the embed context and target, i.e. turning it off for a given project disables that project's mailings having any embeds sent out, as well as that project's code being embedded elsewhere.
This is erring on the side of caution; you could argue it'd be enough to check the target only, but we can change it later if a customer voices desire.
We disable expanding blob embeds in Service Desk emails entirely. Again, can be changed later, but these go to external users and currently never have diffs/instance source code attached, so keep it that way.
How to set up and validate locally
- Check this branch out and enable the
blob_permalink_embedFF. - Include a blob permalink in a project comment to another user on your GDK. Here's my example:

- Check letter_opener (mine's at http://gdk.test:3000/rails/letter_opener/). You should see something like this:
Not the world's prettiest email; to be iterated on in a follow-up. :) - In the project you're working out of, go to Settings → General → Visibility, project features, permissions → Email notifications and uncheck the checkbox Include diff previews, then scroll down and click Save changes.
- Repeat your comment.
- Re-check letter_opener. You should see something like this:

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


