See https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/7764#note_20267983
/cc @felipe_artur @stanhu