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
0
Merge Requests
0
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
Léo-Paul Géneau
gitlab-ce
Commits
542e26fe
Commit
542e26fe
authored
Dec 27, 2018
by
Mathieu Parent
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add group full path to project's shared_with_groups
parent
6d6c2e95
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
15 additions
and
1 deletion
+15
-1
changelogs/unreleased/shared_with_group_path.yml
changelogs/unreleased/shared_with_group_path.yml
+5
-0
doc/api/groups.md
doc/api/groups.md
+2
-0
doc/api/projects.md
doc/api/projects.md
+2
-0
lib/api/entities.rb
lib/api/entities.rb
+4
-1
spec/requests/api/projects_spec.rb
spec/requests/api/projects_spec.rb
+2
-0
No files found.
changelogs/unreleased/shared_with_group_path.yml
0 → 100644
View file @
542e26fe
---
title
:
Add group full path to project's shared_with_groups
merge_request
:
24052
author
:
Mathieu Parent
type
:
added
doc/api/groups.md
View file @
542e26fe
...
...
@@ -357,12 +357,14 @@ Example response:
{
"group_id"
:
4
,
"group_name"
:
"Twitter"
,
"group_full_path"
:
"twitter"
,
"group_access_level"
:
30
,
"expires_at"
:
null
},
{
"group_id"
:
3
,
"group_name"
:
"Gitlab Org"
,
"group_full_path"
:
"gitlab-org"
,
"group_access_level"
:
10
,
"expires_at"
:
"2018-08-14"
}
...
...
doc/api/projects.md
View file @
542e26fe
...
...
@@ -525,11 +525,13 @@ GET /projects/:id
{
"group_id"
:
4
,
"group_name"
:
"Twitter"
,
"group_full_path"
:
"twitter"
,
"group_access_level"
:
30
},
{
"group_id"
:
3
,
"group_name"
:
"Gitlab Org"
,
"group_full_path"
:
"gitlab-org"
,
"group_access_level"
:
10
}
],
...
...
lib/api/entities.rb
View file @
542e26fe
...
...
@@ -115,6 +115,9 @@ module API
expose
:group_name
do
|
group_link
,
options
|
group_link
.
group
.
name
end
expose
:group_full_path
do
|
group_link
,
options
|
group_link
.
group
.
full_path
end
expose
:group_access
,
as: :group_access_level
expose
:expires_at
end
...
...
@@ -277,7 +280,7 @@ module API
# N+1 is solved then by using `subject.tags.map(&:name)`
# MR describing the solution: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/20555
super
(
projects_relation
).
preload
(
:group
)
.
preload
(
project_group_links:
:group
,
.
preload
(
project_group_links:
{
group: :route
}
,
fork_network: :root_project
,
fork_network_member: :forked_from_project
,
forked_from_project:
[
:route
,
:forks
,
:tags
,
namespace: :route
])
...
...
spec/requests/api/projects_spec.rb
View file @
542e26fe
...
...
@@ -948,6 +948,7 @@ describe API::Projects do
expect
(
json_response
[
'shared_with_groups'
].
length
).
to
eq
(
1
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_id'
]).
to
eq
(
group
.
id
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_name'
]).
to
eq
(
group
.
name
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_full_path'
]).
to
eq
(
group
.
full_path
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_access_level'
]).
to
eq
(
link
.
group_access
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'expires_at'
]).
to
be_nil
expect
(
json_response
[
'only_allow_merge_if_pipeline_succeeds'
]).
to
eq
(
project
.
only_allow_merge_if_pipeline_succeeds
)
...
...
@@ -967,6 +968,7 @@ describe API::Projects do
expect
(
json_response
[
'shared_with_groups'
].
length
).
to
eq
(
1
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_id'
]).
to
eq
(
group
.
id
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_name'
]).
to
eq
(
group
.
name
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_full_path'
]).
to
eq
(
group
.
full_path
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'group_access_level'
]).
to
eq
(
link
.
group_access
)
expect
(
json_response
[
'shared_with_groups'
][
0
][
'expires_at'
]).
to
eq
(
expires_at
.
to_s
)
end
...
...
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