Commit 2810dfd7 authored by pburdette's avatar pburdette Committed by Stan Hu

Apply BE feedback

Use model directly to
determine if job has a
trace.
parent 917dc2bf
......@@ -40,7 +40,9 @@ class Projects::JobsController < Projects::ApplicationController
format.json do
Gitlab::PollingInterval.set_header(response, interval: 10_000)
render json: build_details
render json: BuildSerializer
.new(project: @project, current_user: @current_user)
.represent(@build, {}, BuildDetailsEntity)
end
end
end
......@@ -57,7 +59,7 @@ class Projects::JobsController < Projects::ApplicationController
stream: stream,
state: params[:state])
if build_details[:has_trace]
if @build.has_trace?
render json: BuildTraceSerializer
.new(project: @project, current_user: @current_user)
.represent(build_trace)
......@@ -257,10 +259,4 @@ class Projects::JobsController < Projects::ApplicationController
::Gitlab::Workhorse.channel_websocket(service)
end
def build_details
BuildSerializer
.new(project: @project, current_user: @current_user)
.represent(@build, {}, BuildDetailsEntity)
end
end
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