summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Thomas <nick@gitlab.com>2018-12-13 17:52:38 +0000
committerNick Thomas <nick@gitlab.com>2018-12-15 13:50:59 +0000
commite8a675d35f02c6bca9d0e3c8cc116ccd240fa4f6 (patch)
treecabfec3659295e1cf66b50dfab4e1637c8a1a00b
parent0b74b863679a8f55642973eddf25f9e58183d984 (diff)
downloadgitlab-ce-e8a675d35f02c6bca9d0e3c8cc116ccd240fa4f6.tar.gz
Remove the project_cleanup feature flag
-rw-r--r--app/controllers/projects/settings/repository_controller.rb5
-rw-r--r--app/views/projects/cleanup/_show.html.haml2
-rw-r--r--spec/controllers/projects/settings/repository_controller_spec.rb30
-rw-r--r--spec/features/projects/settings/repository_settings_spec.rb32
4 files changed, 14 insertions, 55 deletions
diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb
index 30724de7f6a..ac3004d069f 100644
--- a/app/controllers/projects/settings/repository_controller.rb
+++ b/app/controllers/projects/settings/repository_controller.rb
@@ -5,7 +5,6 @@ module Projects
class RepositoryController < Projects::ApplicationController
before_action :authorize_admin_project!
before_action :remote_mirror, only: [:show]
- before_action :check_cleanup_feature_flag!, only: :cleanup
def show
render_show
@@ -37,10 +36,6 @@ module Projects
private
- def check_cleanup_feature_flag!
- render_404 unless ::Feature.enabled?(:project_cleanup, project)
- end
-
def render_show
@deploy_keys = DeployKeysPresenter.new(@project, current_user: current_user)
@deploy_tokens = @project.deploy_tokens.active
diff --git a/app/views/projects/cleanup/_show.html.haml b/app/views/projects/cleanup/_show.html.haml
index 778d27fc61d..cecc139b183 100644
--- a/app/views/projects/cleanup/_show.html.haml
+++ b/app/views/projects/cleanup/_show.html.haml
@@ -1,5 +1,3 @@
-- return unless Feature.enabled?(:project_cleanup, @project)
-
- expanded = Rails.env.test?
%section.settings.no-animate#cleanup{ class: ('expanded' if expanded) }
diff --git a/spec/controllers/projects/settings/repository_controller_spec.rb b/spec/controllers/projects/settings/repository_controller_spec.rb
index 70f79a47e63..1c6ddfc1864 100644
--- a/spec/controllers/projects/settings/repository_controller_spec.rb
+++ b/spec/controllers/projects/settings/repository_controller_spec.rb
@@ -19,35 +19,15 @@ describe Projects::Settings::RepositoryController do
end
describe 'PUT cleanup' do
- before do
- allow(RepositoryCleanupWorker).to receive(:perform_async)
- end
+ let(:object_map) { fixture_file_upload('spec/fixtures/bfg_object_map.txt') }
- def do_put!
- object_map = fixture_file_upload('spec/fixtures/bfg_object_map.txt')
+ it 'enqueues a RepositoryCleanupWorker' do
+ allow(RepositoryCleanupWorker).to receive(:perform_async)
put :cleanup, namespace_id: project.namespace, project_id: project, project: { object_map: object_map }
- end
-
- context 'feature enabled' do
- it 'enqueues a RepositoryCleanupWorker' do
- stub_feature_flags(project_cleanup: true)
-
- do_put!
-
- expect(response).to redirect_to project_settings_repository_path(project)
- expect(RepositoryCleanupWorker).to have_received(:perform_async).once
- end
- end
-
- context 'feature disabled' do
- it 'shows a 404 error' do
- stub_feature_flags(project_cleanup: false)
-
- do_put!
- expect(response).to have_gitlab_http_status(404)
- end
+ expect(response).to redirect_to project_settings_repository_path(project)
+ expect(RepositoryCleanupWorker).to have_received(:perform_async).once
end
end
end
diff --git a/spec/features/projects/settings/repository_settings_spec.rb b/spec/features/projects/settings/repository_settings_spec.rb
index 418e22f8c35..1982136b89d 100644
--- a/spec/features/projects/settings/repository_settings_spec.rb
+++ b/spec/features/projects/settings/repository_settings_spec.rb
@@ -200,35 +200,21 @@ describe 'Projects > Settings > Repository settings' do
context 'repository cleanup settings' do
let(:object_map_file) { Rails.root.join('spec', 'fixtures', 'bfg_object_map.txt') }
- context 'feature enabled' do
- it 'uploads an object map file', :js do
- stub_feature_flags(project_cleanup: true)
-
- visit project_settings_repository_path(project)
+ it 'uploads an object map file', :js do
+ visit project_settings_repository_path(project)
- expect(page).to have_content('Repository cleanup')
+ expect(page).to have_content('Repository cleanup')
- page.within('#cleanup') do
- attach_file('project[bfg_object_map]', object_map_file, visible: false)
+ page.within('#cleanup') do
+ attach_file('project[bfg_object_map]', object_map_file, visible: false)
- Sidekiq::Testing.fake! do
- click_button 'Start cleanup'
- end
+ Sidekiq::Testing.fake! do
+ click_button 'Start cleanup'
end
-
- expect(page).to have_content('Repository cleanup has started')
- expect(RepositoryCleanupWorker.jobs.count).to eq(1)
end
- end
- context 'feature disabled' do
- it 'does not show the settings' do
- stub_feature_flags(project_cleanup: false)
-
- visit project_settings_repository_path(project)
-
- expect(page).not_to have_content('Repository cleanup')
- end
+ expect(page).to have_content('Repository cleanup has started')
+ expect(RepositoryCleanupWorker.jobs.count).to eq(1)
end
end
end