Group Name not properly rendered in Exported group membership list

Summary

A customer reported that the email sent when generating a CSV export of group members is not rendered properly and is showing the following values.

Hi,
Attached to this email is the list of members of <%= @group.name %> in CSV format.

Steps to reproduce

  1. Go to any group you have permission to in Gitlab.com
  2. Click on Subgroup information.
  3. Click on Export as CSV.
  4. Check the email sent to your account and see that the group name is not rendered properly.

Example Project

  • N/A

What is the current bug behavior?

  • The group name is not parsed and rendered properly.

What is the expected correct behavior?

  • The group name should be parsed and rendered properly.

Relevant logs and/or screenshots

export_group_member_list

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Expand for output related to GitLab environment info

(For installations with omnibus-gitlab package run and paste the output of:
`sudo gitlab-rake gitlab:env:info`)

(For installations from source run and paste the output of:
`sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production`)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true)

(we will only investigate if the tests are passing)

Possible fixes

Implementation plan

The issue seems to stem from the email HAML template:

  1. Update the ee/app/views/notify/memberships_export_email.html.haml template as follows:
%p
  Hi,
  %br

%p
  Attached to this email is the list of members of #{@group.name} in CSV format.

We could also consider linking to the group with #{link_to(@group.name, group_url(@group)}.

Edited by Jiaan Louw