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
Boxiang Sun
gitlab-ce
Commits
18159235
Commit
18159235
authored
Aug 14, 2019
by
Krasimir Angelov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add finished_at to the internal API Deployment entity
Related to
https://gitlab.com/gitlab-org/gitlab-ce/issues/56130
.
parent
94cf543f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
13 additions
and
1 deletion
+13
-1
app/serializers/deployment_entity.rb
app/serializers/deployment_entity.rb
+1
-0
app/serializers/deployment_serializer.rb
app/serializers/deployment_serializer.rb
+1
-1
changelogs/unreleased/56130-deployment-date.yml
changelogs/unreleased/56130-deployment-date.yml
+5
-0
spec/fixtures/api/schemas/deployment.json
spec/fixtures/api/schemas/deployment.json
+2
-0
spec/serializers/deployment_entity_spec.rb
spec/serializers/deployment_entity_spec.rb
+4
-0
No files found.
app/serializers/deployment_entity.rb
View file @
18159235
...
...
@@ -18,6 +18,7 @@ class DeploymentEntity < Grape::Entity
end
expose
:created_at
expose
:finished_at
expose
:tag
expose
:last?
expose
:user
,
using:
UserEntity
...
...
app/serializers/deployment_serializer.rb
View file @
18159235
...
...
@@ -4,7 +4,7 @@ class DeploymentSerializer < BaseSerializer
entity
DeploymentEntity
def
represent_concise
(
resource
,
opts
=
{})
opts
[
:only
]
=
[
:iid
,
:id
,
:sha
,
:created_at
,
:tag
,
:last?
,
:id
,
ref:
[
:name
]]
opts
[
:only
]
=
[
:iid
,
:id
,
:sha
,
:created_at
,
:
finished_at
,
:
tag
,
:last?
,
:id
,
ref:
[
:name
]]
represent
(
resource
,
opts
)
end
end
changelogs/unreleased/56130-deployment-date.yml
0 → 100644
View file @
18159235
---
title
:
Add finished_at to the internal API Deployment entity
merge_request
:
31808
author
:
type
:
other
spec/fixtures/api/schemas/deployment.json
View file @
18159235
...
...
@@ -3,6 +3,7 @@
"required"
:
[
"sha"
,
"created_at"
,
"finished_at"
,
"iid"
,
"tag"
,
"last?"
,
...
...
@@ -11,6 +12,7 @@
],
"properties"
:
{
"created_at"
:
{
"type"
:
"string"
},
"finished_at"
:
{
"type"
:
[
"string"
,
"null"
]
},
"id"
:
{
"type"
:
"integer"
},
"iid"
:
{
"type"
:
"integer"
},
"last?"
:
{
"type"
:
"boolean"
},
...
...
spec/serializers/deployment_entity_spec.rb
View file @
18159235
...
...
@@ -32,6 +32,10 @@ describe DeploymentEntity do
expect
(
subject
).
to
include
(
:created_at
)
end
it
'exposes finished_at'
do
expect
(
subject
).
to
include
(
:finished_at
)
end
context
'when the pipeline has another manual action'
do
let
(
:other_build
)
{
create
(
:ci_build
,
:manual
,
name:
'another deploy'
,
pipeline:
pipeline
)
}
let!
(
:other_deployment
)
{
create
(
:deployment
,
deployable:
other_build
)
}
...
...
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