Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilipa Lacerda <filipa@gitlab.com>2019-08-31 00:51:30 +0300
committerMayra Cabrera <mcabrera@gitlab.com>2019-08-31 00:51:30 +0300
commit288e709cb729124b81344912db0a0f8ce9735a7d (patch)
tree76c057b613096528e8dab08fa4c4c20aac5f38ce /app/controllers/projects/jobs_controller.rb
parente5398754a66383b86365722c8ab442435b4f9e62 (diff)
Creates Feature Flag for job log
Updates frontend code and specs to allow for the new feature flag
Diffstat (limited to 'app/controllers/projects/jobs_controller.rb')
-rw-r--r--app/controllers/projects/jobs_controller.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/app/controllers/projects/jobs_controller.rb b/app/controllers/projects/jobs_controller.rb
index adbc0159358..06d7579aff4 100644
--- a/app/controllers/projects/jobs_controller.rb
+++ b/app/controllers/projects/jobs_controller.rb
@@ -11,6 +11,9 @@ class Projects::JobsController < Projects::ApplicationController
before_action :authorize_erase_build!, only: [:erase]
before_action :authorize_use_build_terminal!, only: [:terminal, :terminal_websocket_authorize]
before_action :verify_api_request!, only: :terminal_websocket_authorize
+ before_action only: [:trace] do
+ push_frontend_feature_flag(:job_log_json)
+ end
layout 'project'
@@ -64,6 +67,14 @@ class Projects::JobsController < Projects::ApplicationController
# rubocop: enable CodeReuse/ActiveRecord
def trace
+ if Feature.enabled?(:job_log_json, @project)
+ json_trace
+ else
+ html_trace
+ end
+ end
+
+ def html_trace
build.trace.read do |stream|
respond_to do |format|
format.json do
@@ -84,6 +95,10 @@ class Projects::JobsController < Projects::ApplicationController
end
end
+ def json_trace
+ # will be implemented with https://gitlab.com/gitlab-org/gitlab-ce/issues/66454
+ end
+
def retry
return respond_422 unless @build.retryable?