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 ...@@ -658,10 +658,7 @@ module API
users = DeclarativePolicy.subject_scope { user_project.team.users } users = DeclarativePolicy.subject_scope { user_project.team.users }
users = users.search(params[:search]) if params[:search].present? users = users.search(params[:search]) if params[:search].present?
users = users.where_not_in(params[:skip_users]) if params[:skip_users].present? users = users.where_not_in(params[:skip_users]) if params[:skip_users].present?
users = users.order('project_authorizations.user_id' => :asc) # rubocop: disable CodeReuse/ActiveRecord
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 present paginate(users), with: Entities::UserBasic
end end
......
...@@ -2684,26 +2684,9 @@ RSpec.describe API::Projects do ...@@ -2684,26 +2684,9 @@ RSpec.describe API::Projects do
context 'when authenticated' do context 'when authenticated' do
context 'valid request' do context 'valid request' do
context 'when sort_by_project_authorizations_user_id FF is off' do it_behaves_like 'project users response' do
before do let(:project) { project4 }
stub_feature_flags(sort_by_project_users_by_project_authorizations_user_id: false) let(:current_user) { user4 }
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
end end
......
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