Commit 8c63ebd9 authored by Nikola Milojevic's avatar Nikola Milojevic

Merge branch 'mw-remove-group_import_export-ff' into 'master'

Remove group_import_export feature flag

See merge request gitlab-org/gitlab!84444
parents d1aef052 c5ff1bef
...@@ -15,7 +15,6 @@ class GroupsController < Groups::ApplicationController ...@@ -15,7 +15,6 @@ class GroupsController < Groups::ApplicationController
prepend_before_action(only: [:show, :issues]) { authenticate_sessionless_user!(:rss) } prepend_before_action(only: [:show, :issues]) { authenticate_sessionless_user!(:rss) }
prepend_before_action(only: [:issues_calendar]) { authenticate_sessionless_user!(:ics) } prepend_before_action(only: [:issues_calendar]) { authenticate_sessionless_user!(:ics) }
prepend_before_action :ensure_export_enabled, only: [:export, :download_export]
prepend_before_action :check_captcha, only: :create, if: -> { captcha_enabled? } prepend_before_action :check_captcha, only: :create, if: -> { captcha_enabled? }
before_action :authenticate_user!, only: [:new, :create] before_action :authenticate_user!, only: [:new, :create]
...@@ -339,10 +338,6 @@ class GroupsController < Groups::ApplicationController ...@@ -339,10 +338,6 @@ class GroupsController < Groups::ApplicationController
check_rate_limit!(prefixed_action, scope: [current_user, scope].compact) check_rate_limit!(prefixed_action, scope: [current_user, scope].compact)
end end
def ensure_export_enabled
render_404 unless Feature.enabled?(:group_import_export, @group, default_enabled: true)
end
private private
def load_recaptcha def load_recaptcha
......
...@@ -3,7 +3,6 @@ ...@@ -3,7 +3,6 @@
class Import::GitlabGroupsController < ApplicationController class Import::GitlabGroupsController < ApplicationController
include WorkhorseAuthorization include WorkhorseAuthorization
before_action :ensure_group_import_enabled
before_action :check_import_rate_limit!, only: %i[create] before_action :check_import_rate_limit!, only: %i[create]
feature_category :importers feature_category :importers
...@@ -51,10 +50,6 @@ class Import::GitlabGroupsController < ApplicationController ...@@ -51,10 +50,6 @@ class Import::GitlabGroupsController < ApplicationController
end end
end end
def ensure_group_import_enabled
render_404 unless Feature.enabled?(:group_import_export, @group, default_enabled: true)
end
def check_import_rate_limit! def check_import_rate_limit!
check_rate_limit!(:group_import, scope: current_user) do check_rate_limit!(:group_import, scope: current_user) do
redirect_to new_group_path, alert: _('This endpoint has been requested too many times. Try again later.') redirect_to new_group_path, alert: _('This endpoint has been requested too many times. Try again later.')
......
- return unless Feature.enabled?(:group_import_export, @group, default_enabled: true)
- group = local_assigns.fetch(:group) - group = local_assigns.fetch(:group)
.sub-section .sub-section
......
---
name: group_import_export
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/22423
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/282245
milestone: '12.8'
type: development
group: group::import
default_enabled: true
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
module API module API
class GroupExport < ::API::Base class GroupExport < ::API::Base
before do before do
not_found! unless Feature.enabled?(:group_import_export, user_group, default_enabled: true)
authorize! :admin_group, user_group authorize! :admin_group, user_group
end end
......
...@@ -1084,19 +1084,6 @@ RSpec.describe GroupsController, factory_default: :keep do ...@@ -1084,19 +1084,6 @@ RSpec.describe GroupsController, factory_default: :keep do
enable_admin_mode!(admin) enable_admin_mode!(admin)
end end
context 'when the group export feature flag is not enabled' do
before do
sign_in(admin)
stub_feature_flags(group_import_export: false)
end
it 'returns a not found error' do
post :export, params: { id: group.to_param }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when the user does not have permission to export the group' do context 'when the user does not have permission to export the group' do
before do before do
sign_in(guest) sign_in(guest)
...@@ -1197,19 +1184,6 @@ RSpec.describe GroupsController, factory_default: :keep do ...@@ -1197,19 +1184,6 @@ RSpec.describe GroupsController, factory_default: :keep do
end end
end end
context 'when the group export feature flag is not enabled' do
before do
sign_in(admin)
stub_feature_flags(group_import_export: false)
end
it 'returns a not found error' do
post :export, params: { id: group.to_param }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when the user does not have the required permissions' do context 'when the user does not have the required permissions' do
before do before do
sign_in(guest) sign_in(guest)
......
...@@ -26,22 +26,6 @@ RSpec.describe 'Group Export', :js do ...@@ -26,22 +26,6 @@ RSpec.describe 'Group Export', :js do
end end
end end
context 'when the group import/export FF is disabled' do
before do
stub_feature_flags(group_import_export: false)
group.add_owner(user)
sign_in(user)
end
it 'does not show the group export options' do
visit edit_group_path(group)
expect(page).to have_content('Advanced')
expect(page).not_to have_content('Export group')
end
end
context 'when the signed in user does not have the required permission level' do context 'when the signed in user does not have the required permission level' do
before do before do
group.add_guest(user) group.add_guest(user)
......
...@@ -30,17 +30,12 @@ RSpec.describe API::GroupExport do ...@@ -30,17 +30,12 @@ RSpec.describe API::GroupExport do
group.add_owner(user) group.add_owner(user)
end end
context 'group_import_export feature flag enabled' do context 'when export file exists' do
before do before do
stub_feature_flags(group_import_export: true)
allow(Gitlab::ApplicationRateLimiter) allow(Gitlab::ApplicationRateLimiter)
.to receive(:increment) .to receive(:increment)
.and_return(0) .and_return(0)
end
context 'when export file exists' do
before do
upload.export_file = fixture_file_upload('spec/fixtures/group_export.tar.gz', "`/tar.gz") upload.export_file = fixture_file_upload('spec/fixtures/group_export.tar.gz', "`/tar.gz")
upload.save! upload.save!
end end
...@@ -87,18 +82,9 @@ RSpec.describe API::GroupExport do ...@@ -87,18 +82,9 @@ RSpec.describe API::GroupExport do
it 'returns 404' do it 'returns 404' do
get api(download_path, user) get api(download_path, user)
expect(response).to have_gitlab_http_status(:not_found) allow(Gitlab::ApplicationRateLimiter)
end .to receive(:increment)
end .and_return(0)
end
context 'group_import_export feature flag disabled' do
before do
stub_feature_flags(group_import_export: false)
end
it 'responds with 404 Not Found' do
get api(download_path, user)
expect(response).to have_gitlab_http_status(:not_found) expect(response).to have_gitlab_http_status(:not_found)
end end
...@@ -122,11 +108,6 @@ RSpec.describe API::GroupExport do ...@@ -122,11 +108,6 @@ RSpec.describe API::GroupExport do
end end
describe 'POST /groups/:group_id/export' do describe 'POST /groups/:group_id/export' do
context 'group_import_export feature flag enabled' do
before do
stub_feature_flags(group_import_export: true)
end
context 'when user is a group owner' do context 'when user is a group owner' do
before do before do
group.add_owner(user) group.add_owner(user)
...@@ -163,19 +144,6 @@ RSpec.describe API::GroupExport do ...@@ -163,19 +144,6 @@ RSpec.describe API::GroupExport do
expect(response).to have_gitlab_http_status(:forbidden) expect(response).to have_gitlab_http_status(:forbidden)
end end
end end
end
context 'group_import_export feature flag disabled' do
before do
stub_feature_flags(group_import_export: false)
end
it 'responds with 404 Not Found' do
post api(path, user)
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when the requests have exceeded the rate limit' do context 'when the requests have exceeded the rate limit' do
before do before do
...@@ -202,7 +170,6 @@ RSpec.describe API::GroupExport do ...@@ -202,7 +170,6 @@ RSpec.describe API::GroupExport do
let(:status_path) { "/groups/#{group.id}/export_relations/status" } let(:status_path) { "/groups/#{group.id}/export_relations/status" }
before do before do
stub_feature_flags(group_import_export: true)
group.add_owner(user) group.add_owner(user)
end end
......
...@@ -155,20 +155,6 @@ RSpec.describe Import::GitlabGroupsController do ...@@ -155,20 +155,6 @@ RSpec.describe Import::GitlabGroupsController do
end end
end end
context 'when group import FF is disabled' do
let(:request_params) { { path: 'test-group-import', name: 'test-group-import' } }
before do
stub_feature_flags(group_import_export: false)
end
it 'returns an error' do
expect { import_request }.not_to change { Group.count }
expect(response).to have_gitlab_http_status(:not_found)
end
end
context 'when the parent group is invalid' do context 'when the parent group is invalid' do
let(:request_params) { { path: 'test-group-import', name: 'test-group-import', parent_id: -1 } } let(:request_params) { { path: 'test-group-import', name: 'test-group-import', parent_id: -1 } }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment