Commit 70134559 authored by Steve Azzopardi's avatar Steve Azzopardi Committed by Filipa Lacerda

Add stuck field in BuildDetailEntity

Frontend currently defines when a job is stuck, which we already have in
the backend, expose `stuck` field in the
`Project::JobsController#show.json` so the duplication of the logic is
removed.
parent 6c0b8af7
......@@ -7,6 +7,7 @@ class BuildDetailsEntity < JobEntity
expose :tag_list, as: :tags
expose :has_trace?, as: :has_trace
expose :stage
expose :stuck?, as: :stuck
expose :user, using: UserEntity
expose :runner, using: RunnerEntity
expose :pipeline, using: PipelineEntity
......
......@@ -297,6 +297,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
expect(response).to match_response_schema('job/job_details')
expect(json_response['runners']['online']).to be false
expect(json_response['runners']['available']).to be false
expect(json_response['stuck']).to be true
end
end
......@@ -309,6 +310,7 @@ describe Projects::JobsController, :clean_gitlab_redis_shared_state do
expect(response).to match_response_schema('job/job_details')
expect(json_response['runners']['online']).to be false
expect(json_response['runners']['available']).to be true
expect(json_response['stuck']).to be true
end
end
......
......@@ -18,6 +18,7 @@
"runner": { "$ref": "runner.json" },
"runners": { "$ref": "runners.json" },
"has_trace": { "type": "boolean" },
"stage": { "type": "string" }
"stage": { "type": "string" },
"stuck": { "type": "boolean" }
}
}
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