Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
1fbc9956
Commit
1fbc9956
authored
Mar 15, 2022
by
Doug Stull
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Change feature category of the project members API
- should no longer belong to the growth sub department
parent
91a42f8a
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
lib/api/projects.rb
lib/api/projects.rb
+2
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+23
-0
No files found.
lib/api/projects.rb
View file @
1fbc9956
...
@@ -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
])
...
...
spec/requests/api/projects_spec.rb
View file @
1fbc9956
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment