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
2692b2a2
Commit
2692b2a2
authored
Nov 28, 2019
by
Jarka Košanová
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Expose service desk information in project api
- service_desk_enabled, service_desk_address
parent
b4eeb72a
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
81 additions
and
2 deletions
+81
-2
changelogs/unreleased/34261-service-desk-to-api.yml
changelogs/unreleased/34261-service-desk-to-api.yml
+5
-0
doc/api/projects.md
doc/api/projects.md
+52
-0
ee/lib/ee/api/entities.rb
ee/lib/ee/api/entities.rb
+2
-0
ee/spec/requests/api/projects_spec.rb
ee/spec/requests/api/projects_spec.rb
+22
-2
No files found.
changelogs/unreleased/34261-service-desk-to-api.yml
0 → 100644
View file @
2692b2a2
---
title
:
Add service desk information to projects API endpoint
merge_request
:
20913
author
:
type
:
changed
doc/api/projects.md
View file @
2692b2a2
...
...
@@ -241,6 +241,19 @@ When the user is authenticated and `simple` is not set this returns something li
"remove_source_branch_after_merge"
:
false
,
"request_access_enabled"
:
false
,
"merge_method"
:
"merge"
,
"auto_devops_enabled"
:
true
,
"auto_devops_deploy_strategy"
:
"continuous"
,
"repository_storage"
:
"default"
,
"approvals_before_merge"
:
0
,
"mirror"
:
false
,
"mirror_user_id"
:
45
,
"mirror_trigger_builds"
:
false
,
"only_mirror_protected_branches"
:
false
,
"mirror_overwrites_diverged_branches"
:
false
,
"external_authorization_classification_label"
:
null
,
"packages_enabled"
:
true
,
"service_desk_enabled"
:
false
,
"service_desk_address"
:
null
,
"statistics"
:
{
"commit_count"
:
12
,
"storage_size"
:
2066080
,
...
...
@@ -457,6 +470,19 @@ This endpoint supports [keyset pagination](README.md#keyset-based-pagination) fo
"remove_source_branch_after_merge"
:
false
,
"request_access_enabled"
:
false
,
"merge_method"
:
"merge"
,
"auto_devops_enabled"
:
true
,
"auto_devops_deploy_strategy"
:
"continuous"
,
"repository_storage"
:
"default"
,
"approvals_before_merge"
:
0
,
"mirror"
:
false
,
"mirror_user_id"
:
45
,
"mirror_trigger_builds"
:
false
,
"only_mirror_protected_branches"
:
false
,
"mirror_overwrites_diverged_branches"
:
false
,
"external_authorization_classification_label"
:
null
,
"packages_enabled"
:
true
,
"service_desk_enabled"
:
false
,
"service_desk_address"
:
null
,
"statistics"
:
{
"commit_count"
:
12
,
"storage_size"
:
2066080
,
...
...
@@ -649,6 +675,19 @@ Example response:
"remove_source_branch_after_merge"
:
false
,
"request_access_enabled"
:
false
,
"merge_method"
:
"merge"
,
"auto_devops_enabled"
:
true
,
"auto_devops_deploy_strategy"
:
"continuous"
,
"repository_storage"
:
"default"
,
"approvals_before_merge"
:
0
,
"mirror"
:
false
,
"mirror_user_id"
:
45
,
"mirror_trigger_builds"
:
false
,
"only_mirror_protected_branches"
:
false
,
"mirror_overwrites_diverged_branches"
:
false
,
"external_authorization_classification_label"
:
null
,
"packages_enabled"
:
true
,
"service_desk_enabled"
:
false
,
"service_desk_address"
:
null
,
"statistics"
:
{
"commit_count"
:
12
,
"storage_size"
:
2066080
,
...
...
@@ -777,6 +816,19 @@ GET /projects/:id
"printing_merge_requests_link_enabled"
:
true
,
"request_access_enabled"
:
false
,
"merge_method"
:
"merge"
,
"auto_devops_enabled"
:
true
,
"auto_devops_deploy_strategy"
:
"continuous"
,
"repository_storage"
:
"default"
,
"approvals_before_merge"
:
0
,
"mirror"
:
false
,
"mirror_user_id"
:
45
,
"mirror_trigger_builds"
:
false
,
"only_mirror_protected_branches"
:
false
,
"mirror_overwrites_diverged_branches"
:
false
,
"external_authorization_classification_label"
:
null
,
"packages_enabled"
:
true
,
"service_desk_enabled"
:
false
,
"service_desk_address"
:
null
,
"statistics"
:
{
"commit_count"
:
37
,
"storage_size"
:
1038090
,
...
...
ee/lib/ee/api/entities.rb
View file @
2692b2a2
...
...
@@ -44,6 +44,8 @@ module EE
expose
:external_authorization_classification_label
,
if:
->
(
_
,
_
)
{
License
.
feature_available?
(
:external_authorization_service_api_management
)
}
expose
:packages_enabled
,
if:
->
(
project
,
_
)
{
project
.
feature_available?
(
:packages
)
}
expose
:service_desk_enabled
,
if:
->
(
project
,
_
)
{
project
.
feature_available?
(
:service_desk
)
}
expose
:service_desk_address
,
if:
->
(
project
,
_
)
{
project
.
feature_available?
(
:service_desk
)
}
end
end
...
...
ee/spec/requests/api/projects_spec.rb
View file @
2692b2a2
...
...
@@ -143,7 +143,7 @@ describe API::Projects do
end
describe
'packages_enabled attribute'
do
it
'exposed when the feature is available'
do
it
'
is
exposed when the feature is available'
do
stub_licensed_features
(
packages:
true
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
...
...
@@ -151,7 +151,7 @@ describe API::Projects do
expect
(
json_response
).
to
have_key
'packages_enabled'
end
it
'
not exposed when the feature is
available'
do
it
'
is not exposed when the feature is not
available'
do
stub_licensed_features
(
packages:
false
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
...
...
@@ -160,6 +160,26 @@ describe API::Projects do
end
end
describe
'service desk attributes'
do
it
'are exposed when the feature is available'
do
stub_licensed_features
(
service_desk:
true
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
expect
(
json_response
).
to
have_key
'service_desk_enabled'
expect
(
json_response
).
to
have_key
'service_desk_address'
end
it
'are not exposed when the feature is not available'
do
stub_licensed_features
(
service_desk:
false
)
get
api
(
"/projects/
#{
project
.
id
}
"
,
user
)
expect
(
json_response
).
not_to
have_key
'service_desk_enabled'
expect
(
json_response
).
not_to
have_key
'service_desk_address'
end
end
describe
'repository_storage attribute'
do
context
'when authenticated as an admin'
do
let
(
:admin
)
{
create
(
:admin
)
}
...
...
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