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