summaryrefslogtreecommitdiff
path: root/app/controllers/projects/builds_controller.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-06-13 12:43:25 +0200
committerJames Lopez <james@jameslopez.es>2016-06-13 12:43:25 +0200
commitad68bc63b5e7e8080e82d9febec05397c802d33d (patch)
treed9508d5bd96c8087d13b88051637bb442e877659 /app/controllers/projects/builds_controller.rb
parent41c06c311b9c5642f6056d0b34030980ebf507b3 (diff)
parentcc322603945816ed957da7c0efa56e2ef1016569 (diff)
downloadgitlab-ce-ad68bc63b5e7e8080e82d9febec05397c802d33d.tar.gz
Merge branches 'feature/project-export' and 'feature/project-import' of gitlab.com:gitlab-org/gitlab-ce into feature/project-import
# Conflicts: # app/models/project.rb # db/schema.rb # lib/gitlab/import_export/import_export_reader.rb
Diffstat (limited to 'app/controllers/projects/builds_controller.rb')
-rw-r--r--app/controllers/projects/builds_controller.rb14
1 files changed, 11 insertions, 3 deletions
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb
index b8b9e78427d..14c82826342 100644
--- a/app/controllers/projects/builds_controller.rb
+++ b/app/controllers/projects/builds_controller.rb
@@ -26,9 +26,9 @@ class Projects::BuildsController < Projects::ApplicationController
end
def show
- @builds = @project.ci_commits.find_by_sha(@build.sha).builds.order('id DESC')
+ @builds = @project.pipelines.find_by_sha(@build.sha).builds.order('id DESC')
@builds = @builds.where("id not in (?)", @build.id)
- @commit = @build.commit
+ @pipeline = @build.pipeline
respond_to do |format|
format.html
@@ -38,6 +38,14 @@ class Projects::BuildsController < Projects::ApplicationController
end
end
+ def trace
+ respond_to do |format|
+ format.json do
+ render json: @build.trace_with_state(params[:state].presence).merge!(id: @build.id, status: @build.status)
+ end
+ end
+ end
+
def retry
unless @build.retryable?
return render_404
@@ -73,7 +81,7 @@ class Projects::BuildsController < Projects::ApplicationController
private
def build
- @build ||= project.builds.unscoped.find_by!(id: params[:id])
+ @build ||= project.builds.find_by!(id: params[:id])
end
def build_path(build)