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
44699461
Commit
44699461
authored
Apr 20, 2017
by
Pawel Chojnacki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce the amount of data deployment endpoint returns
parent
27cc95ab
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
30 additions
and
13 deletions
+30
-13
app/serializers/deployment_entity.rb
app/serializers/deployment_entity.rb
+0
-11
app/serializers/deployment_entity_detailed.rb
app/serializers/deployment_entity_detailed.rb
+28
-0
app/serializers/environment_entity.rb
app/serializers/environment_entity.rb
+1
-1
spec/serializers/deployment_entity_spec.rb
spec/serializers/deployment_entity_spec.rb
+1
-1
No files found.
app/serializers/deployment_entity.rb
View file @
44699461
...
...
@@ -9,20 +9,9 @@ class DeploymentEntity < Grape::Entity
expose
:name
do
|
deployment
|
deployment
.
ref
end
expose
:ref_path
do
|
deployment
|
namespace_project_tree_path
(
deployment
.
project
.
namespace
,
deployment
.
project
,
id:
deployment
.
ref
)
end
end
expose
:created_at
expose
:tag
expose
:last?
expose
:user
,
using:
UserEntity
expose
:commit
,
using:
CommitEntity
expose
:deployable
,
using:
BuildEntity
expose
:manual_actions
,
using:
BuildEntity
end
app/serializers/deployment_entity_detailed.rb
0 → 100644
View file @
44699461
class
DeploymentEntityDetailed
<
Grape
::
Entity
include
RequestAwareEntity
expose
:id
expose
:iid
expose
:sha
expose
:ref
do
expose
:name
do
|
deployment
|
deployment
.
ref
end
expose
:ref_path
do
|
deployment
|
namespace_project_tree_path
(
deployment
.
project
.
namespace
,
deployment
.
project
,
id:
deployment
.
ref
)
end
end
expose
:created_at
expose
:tag
expose
:last?
expose
:user
,
using:
UserEntity
expose
:commit
,
using:
CommitEntity
expose
:deployable
,
using:
BuildEntity
expose
:manual_actions
,
using:
BuildEntity
end
app/serializers/environment_entity.rb
View file @
44699461
...
...
@@ -6,7 +6,7 @@ class EnvironmentEntity < Grape::Entity
expose
:state
expose
:external_url
expose
:environment_type
expose
:last_deployment
,
using:
DeploymentEntity
expose
:last_deployment
,
using:
DeploymentEntity
Detailed
expose
:stop_action?
expose
:metrics_path
,
if:
->
(
environment
,
_
)
{
environment
.
has_metrics?
}
do
|
environment
|
...
...
spec/serializers/deployment_entity_spec.rb
View file @
44699461
require
'spec_helper'
describe
DeploymentEntity
do
describe
DeploymentEntity
Detailed
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:request
)
{
double
(
'request'
)
}
...
...
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