Skip to content
Snippets Groups Projects
Commit 4baed051 authored by Martin Wortschack's avatar Martin Wortschack
Browse files

Remove post_import_repository_size_check ff

Changelog: added
EE: true
parent ab344db3
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