summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorZ.J. van de Weg <git@zjvandeweg.nl>2017-05-23 17:10:07 +0200
committerZ.J. van de Weg <git@zjvandeweg.nl>2017-05-31 21:44:15 +0200
commit47a0276e53de4635df43124607ac1a101d6f1b70 (patch)
treee7c8d5644f9aceca23c00c280490c5bbad5b1607 /app/controllers
parentf06daa26efc127565e4e68ca9d4ac62e5a1e3b36 (diff)
downloadgitlab-ce-47a0276e53de4635df43124607ac1a101d6f1b70.tar.gz
Initial implementation for real time job view
Added the needed keys and paths to a new entity, BuildDetailsEntity. Not renaming BuildEntity to BuildBasicEntity on explicit request. Most code now has test coverage, but not all. This will be added on later commits on this branch. Resolves gitlab-org/gitlab-ce#31397
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/jobs_controller.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index d2cd1cfdab8..9b8a9eedfef 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -45,6 +45,17 @@ class Projects::JobsController < Projects::ApplicationController
@builds = @project.pipelines.find_by_sha(@build.sha).builds.order('id DESC')
@builds = @builds.where("id not in (?)", @build.id)
@pipeline = @build.pipeline
+
+ respond_to do |format|
+ format.html
+ format.json do
+ Gitlab::PollingInterval.set_header(response, interval: 10_000)
+
+ render json: BuildSerializer
+ .new(project: @project, current_user: @current_user)
+ .represent_status(@build, {}, BuildDetailsEntity)
+ end
+ end
end
def trace