Commit 1fbc9956 authored by Doug Stull's avatar Doug Stull

Change feature category of the project members API

- should no longer belong to the growth sub department
parent 91a42f8a
...@@ -611,7 +611,8 @@ module API ...@@ -611,7 +611,8 @@ module API
params do params do
requires :project_id, type: Integer, desc: 'The ID of the source project to import the members from.' requires :project_id, type: Integer, desc: 'The ID of the source project to import the members from.'
end end
post ":id/import_project_members/:project_id", feature_category: :experimentation_expansion do post ":id/import_project_members/:project_id", feature_category: :projects do
::Gitlab::QueryLimiting.disable!('https://gitlab.com/gitlab-org/gitlab/-/issues/355916')
authorize! :admin_project, user_project authorize! :admin_project, user_project
source_project = Project.find_by_id(params[:project_id]) source_project = Project.find_by_id(params[:project_id])
......
...@@ -3143,6 +3143,29 @@ RSpec.describe API::Projects do ...@@ -3143,6 +3143,29 @@ RSpec.describe API::Projects do
project2.add_developer(project2_user) project2.add_developer(project2_user)
end end
it 'records the query', :request_store, :use_sql_query_cache do
post api("/projects/#{project.id}/import_project_members/#{project2.id}", user)
control_project = create(:project)
control_project.add_maintainer(user)
control_project.add_developer(create(:user))
control = ActiveRecord::QueryRecorder.new(skip_cached: false) do
post api("/projects/#{project.id}/import_project_members/#{control_project.id}", user)
end
measure_project = create(:project)
measure_project.add_maintainer(user)
measure_project.add_developer(create(:user))
measure_project.add_developer(create(:user)) # make this 2nd one to find any n+1
unresolved_n_plus_ones = 21 # 21 queries added per member
expect do
post api("/projects/#{project.id}/import_project_members/#{measure_project.id}", user)
end.not_to exceed_all_query_limit(control.count).with_threshold(unresolved_n_plus_ones)
end
it 'returns 200 when it successfully imports members from another project' do it 'returns 200 when it successfully imports members from another project' do
expect do expect do
post api("/projects/#{project.id}/import_project_members/#{project2.id}", user) post api("/projects/#{project.id}/import_project_members/#{project2.id}", 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