diff options
author | Hordur Freyr Yngvason <hfyngvason@gitlab.com> | 2019-08-15 20:20:08 +0000 |
---|---|---|
committer | Michael Kozono <mkozono@gmail.com> | 2019-08-15 20:20:08 +0000 |
commit | d3c5ff7b723b9447e2b672fb844bb42dde687ac9 (patch) | |
tree | d2ab2578b099bed0363bed3f2dbec7b7155c01cd /spec/tasks | |
parent | 44717d26847384fb6cb82e3ce54e831b37bdf1bc (diff) | |
download | gitlab-ce-d3c5ff7b723b9447e2b672fb844bb42dde687ac9.tar.gz |
Squash project templates on update
As per https://gitlab.com/gitlab-org/gitlab-ce/issues/46043, project
templates should be squashed before updating, so that repositories
created from these templates don't include the full history of the
backing repository.
Diffstat (limited to 'spec/tasks')
-rw-r--r-- | spec/tasks/gitlab/update_templates_rake_spec.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/tasks/gitlab/update_templates_rake_spec.rb b/spec/tasks/gitlab/update_templates_rake_spec.rb index 7b17549b8c7..14b4ad5e3d8 100644 --- a/spec/tasks/gitlab/update_templates_rake_spec.rb +++ b/spec/tasks/gitlab/update_templates_rake_spec.rb @@ -8,9 +8,18 @@ describe 'gitlab:update_project_templates rake task' do before do Rake.application.rake_require 'tasks/gitlab/update_templates' create(:admin) + allow(Gitlab::ProjectTemplate) .to receive(:archive_directory) .and_return(Pathname.new(tmpdir)) + + # Gitlab::HTTP resolves the domain to an IP prior to WebMock taking effect, hence the wildcard + stub_request(:get, %r{^https://.*/api/v4/projects/gitlab-org%2Fproject-templates%2Frails/repository/commits\?page=1&per_page=1}) + .to_return( + status: 200, + body: [{ id: '67812735b83cb42710f22dc98d73d42c8bf4d907' }].to_json, + headers: { 'Content-Type' => 'application/json' } + ) end after do |