Commit 92ac94c2 authored by Krasimir Angelov's avatar Krasimir Angelov

Replace finished_at with deployed_at for Deployment entity

Instead of `finished_at` attribute use `deployed_at` methods which also
takes into account the deployment status.

Related to https://gitlab.com/gitlab-org/gitlab-ce/issues/56130.
parent 51c19691
...@@ -18,7 +18,7 @@ class DeploymentEntity < Grape::Entity ...@@ -18,7 +18,7 @@ class DeploymentEntity < Grape::Entity
end end
expose :created_at expose :created_at
expose :finished_at expose :deployed_at
expose :tag expose :tag
expose :last? expose :last?
expose :user, using: UserEntity expose :user, using: UserEntity
......
...@@ -4,7 +4,7 @@ class DeploymentSerializer < BaseSerializer ...@@ -4,7 +4,7 @@ class DeploymentSerializer < BaseSerializer
entity DeploymentEntity entity DeploymentEntity
def represent_concise(resource, opts = {}) def represent_concise(resource, opts = {})
opts[:only] = [:iid, :id, :sha, :created_at, :finished_at, :tag, :last?, :id, ref: [:name]] opts[:only] = [:iid, :id, :sha, :created_at, :deployed_at, :tag, :last?, :id, ref: [:name]]
represent(resource, opts) represent(resource, opts)
end end
end end
---
title: Replace finished_at with deployed_at for the internal API Deployment entity
merge_request: 32000
author:
type: other
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"required": [ "required": [
"sha", "sha",
"created_at", "created_at",
"finished_at", "deployed_at",
"iid", "iid",
"tag", "tag",
"last?", "last?",
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
], ],
"properties": { "properties": {
"created_at": { "type": "string" }, "created_at": { "type": "string" },
"finished_at": { "type": ["string", "null"] }, "deployed_at": { "type": ["string", "null"] },
"id": { "type": "integer" }, "id": { "type": "integer" },
"iid": { "type": "integer" }, "iid": { "type": "integer" },
"last?": { "type": "boolean" }, "last?": { "type": "boolean" },
......
...@@ -32,8 +32,8 @@ describe DeploymentEntity do ...@@ -32,8 +32,8 @@ describe DeploymentEntity do
expect(subject).to include(:created_at) expect(subject).to include(:created_at)
end end
it 'exposes finished_at' do it 'exposes deployed_at' do
expect(subject).to include(:finished_at) expect(subject).to include(:deployed_at)
end end
context 'when the pipeline has another manual action' do context 'when the pipeline has another manual action' do
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment