References not accessible to public users are redacted in emails
When rendering labels in email notifications, I noticed that when the project is internal / private, the labels are not rendered:
When the project is public, it is rendered fine:
I think we are missing some context when running the Markdown pipeline and the labels are being treated as unauthorized which results in them not being rendered as labels / links.
When we render Markdown in the email HAML: https://gitlab.com/gitlab-org/gitlab/blob/master/app/views/notify/_note_email.html.haml#L37 we pass in an author
but not current_user
. (This also happens in other HAML views like app/views/notify/issue_due_email.html.haml
)
I'm not sure if author
is even used here but we need current_user
to be set to the email's recipient so that the Markdown will be rendered in the context of that user.