Skip to content
Snippets Groups Projects
Unverified Commit 7b31d58b authored by Stan Hu's avatar Stan Hu
Browse files

Merge branch '414530-feature-flag-enable-post_import_repository_size_check-feature' into 'master'

Remove  post_import_repository_size_check feature flag

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/129341



Merged-by: default avatarStan Hu <stanhu@gmail.com>
Approved-by: default avatarRodrigo Tomonari <rtomonari@gitlab.com>
Approved-by: default avatarStan Hu <stanhu@gmail.com>
Co-authored-by: default avatarMartin Wortschack <mwortschack@gitlab.com>
parents ea49ab97 4baed051
No related branches found
No related tags found
No related merge requests found
---
name: post_import_repository_size_check
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/122814
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/414530
milestone: '16.1'
type: development
group: group::import and integrate
default_enabled: false
Loading
Loading
@@ -7,8 +7,6 @@ def initialize(project)
end
 
def execute
return unless ::Feature.enabled?(:post_import_repository_size_check)
project.repository.expire_content_cache
 
::Projects::UpdateStatisticsService.new(project, nil, statistics: [:repository_size]).execute
Loading
Loading
Loading
Loading
@@ -16,30 +16,20 @@
end
end
 
context 'when `post_import_repository_size_check` feature flag is enabled' do
context 'when repository size is over the limit' do
let(:above_size_limit) { true }
context 'when repository size is over the limit' do
let(:above_size_limit) { true }
 
it 'schedules worker to destroy repository and raises error' do
expect(::Projects::RepositoryDestroyWorker).to receive(:perform_async).with(project.id)
it 'schedules worker to destroy repository and raises error' do
expect(::Projects::RepositoryDestroyWorker).to receive(:perform_async).with(project.id)
 
expect { service.execute }
.to raise_error(::Projects::ImportService::Error, 'Repository above permitted size limit.')
end
end
context 'when repository size is not over the limit' do
let(:above_size_limit) { false }
it 'does nothing' do
expect(::Projects::RepositoryDestroyWorker).not_to receive(:perform_async)
expect(service.execute).to eq(nil)
end
expect { service.execute }
.to raise_error(::Projects::ImportService::Error, 'Repository above permitted size limit.')
end
end
 
context 'when `post_import_repository_size_check` feature flag is disabled' do
context 'when repository size is not over the limit' do
let(:above_size_limit) { false }
it 'does nothing' do
expect(::Projects::RepositoryDestroyWorker).not_to receive(:perform_async)
 
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment