Commit 295b0466 authored by Filipa Lacerda's avatar Filipa Lacerda Committed by Steve Azzopardi

Removes icon key from job endpoint

This was added because we thought we'd need
to render the environment status but we
already have this information in the
build status
parent 32bba60c
# frozen_string_literal: true # frozen_string_literal: true
class BuildDetailsEntity < JobEntity class BuildDetailsEntity < JobEntity
include EnvironmentHelper
include RequestAwareEntity
include CiStatusHelper
expose :coverage, :erased_at, :duration expose :coverage, :erased_at, :duration
expose :tag_list, as: :tags expose :tag_list, as: :tags
expose :has_trace?, as: :has_trace expose :has_trace?, as: :has_trace
...@@ -15,10 +11,6 @@ class BuildDetailsEntity < JobEntity ...@@ -15,10 +11,6 @@ class BuildDetailsEntity < JobEntity
expose :deployment_status, if: -> (*) { build.has_environment? } do expose :deployment_status, if: -> (*) { build.has_environment? } do
expose :deployment_status, as: :status expose :deployment_status, as: :status
expose :icon do |build|
ci_label_for_status(build.status)
end
expose :persisted_environment, as: :environment, with: EnvironmentEntity expose :persisted_environment, as: :environment, with: EnvironmentEntity
end end
......
---
title: Remove icon key from job endopoint
merge_request:
author:
type: other
...@@ -225,7 +225,6 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do ...@@ -225,7 +225,6 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
expect(response).to have_gitlab_http_status(:ok) expect(response).to have_gitlab_http_status(:ok)
expect(json_response).to match_schema('job/job_details') expect(json_response).to match_schema('job/job_details')
expect(json_response['deployment_status']["status"]).to eq 'creating' expect(json_response['deployment_status']["status"]).to eq 'creating'
expect(json_response['deployment_status']["icon"]).to eq 'passed'
expect(json_response['deployment_status']["environment"]).not_to be_nil expect(json_response['deployment_status']["environment"]).not_to be_nil
end end
end end
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
"type": "object", "type": "object",
"required": [ "required": [
"status", "status",
"icon",
"environment" "environment"
], ],
"properties": { "properties": {
...@@ -20,7 +19,6 @@ ...@@ -20,7 +19,6 @@
{ "type": "null" } { "type": "null" }
] ]
}, },
"icon": { "type": "string" },
"environment": { "$ref": "../environment.json" } "environment": { "$ref": "../environment.json" }
}, },
"additionalProperties": false "additionalProperties": false
......
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