Commit 6a4e306a authored by Adam Hegyi's avatar Adam Hegyi

Remove project authorizations API FF

This change removes the already default-enabled feature flag
(sort_by_project_users_by_project_authorizations_user_id) for
improving the performance of the project authorizations API.

Changelog: other
parent b52f21df
---
name: sort_by_project_users_by_project_authorizations_user_id
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/64528
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/334167
milestone: '14.1'
type: development
group: group::optimize
default_enabled: true
......@@ -658,10 +658,7 @@ module API
users = DeclarativePolicy.subject_scope { user_project.team.users }
users = users.search(params[:search]) if params[:search].present?
users = users.where_not_in(params[:skip_users]) if params[:skip_users].present?
if Feature.enabled?(:sort_by_project_users_by_project_authorizations_user_id, user_project, default_enabled: :yaml)
users = users.order('project_authorizations.user_id' => :asc) # rubocop: disable CodeReuse/ActiveRecord
end
present paginate(users), with: Entities::UserBasic
end
......
......@@ -2684,29 +2684,12 @@ RSpec.describe API::Projects do
context 'when authenticated' do
context 'valid request' do
context 'when sort_by_project_authorizations_user_id FF is off' do
before do
stub_feature_flags(sort_by_project_users_by_project_authorizations_user_id: false)
end
it_behaves_like 'project users response' do
let(:project) { project4 }
let(:current_user) { user4 }
end
end
context 'when sort_by_project_authorizations_user_id FF is on' do
before do
stub_feature_flags(sort_by_project_users_by_project_authorizations_user_id: true)
end
it_behaves_like 'project users response' do
let(:project) { project4 }
let(:current_user) { user4 }
end
end
end
it 'returns a 404 error if not found' do
get api("/projects/#{non_existing_record_id}/users", user)
......
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