Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/1254 Closes https://gitlab.com/gitlab-org/gitlab-ee/issues/1251