summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-03 15:59:25 +0900
committerShinya Maeda <gitlab.shinyamaeda@gmail.com>2017-03-23 17:11:48 +0900
commitba27f1b954e79713ec1905b46ee5ba1b940418f0 (patch)
tree740464cf3bc1c20fe45755e96e474261b9eac090 /app/controllers
parent0e06cfc059af0b70b366ab1eaf75f7601fdcb5e1 (diff)
downloadgitlab-ce-ba27f1b954e79713ec1905b46ee5ba1b940418f0.tar.gz
Expose only status. ci_cd_status to status. Support abstract class.
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/builds_controller.rb14
-rw-r--r--app/controllers/projects/merge_requests_controller.rb5
-rw-r--r--app/controllers/projects/pipelines_controller.rb3
3 files changed, 12 insertions, 10 deletions
diff --git a/app/controllers/projects/builds_controller.rb b/app/controllers/projects/builds_controller.rb
index 54650bc37a2..8d00f2bf1b2 100644
--- a/app/controllers/projects/builds_controller.rb
+++ b/app/controllers/projects/builds_controller.rb
@@ -73,8 +73,14 @@ class Projects::BuildsController < Projects::ApplicationController
redirect_to build_path(@build)
end
+ # def status
+ # render json: @build.to_json(only: [:status, :id, :sha, :coverage], methods: :sha)
+ # end
def status
- render json: @build.to_json(only: [:status, :id, :sha, :coverage], methods: :sha)
+ render json: BuildSerializer
+ .new(project: @project, user: @current_user)
+ .with_status
+ .represent(@build)
end
def erase
@@ -91,12 +97,6 @@ class Projects::BuildsController < Projects::ApplicationController
end
end
- def ci_cd_status
- render json: BuildSerializer
- .new(project: @project, user: @current_user)
- .represent(@build)
- end
-
private
def build
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb
index 18b1a5cb395..5087abedf40 100644
--- a/app/controllers/projects/merge_requests_controller.rb
+++ b/app/controllers/projects/merge_requests_controller.rb
@@ -10,7 +10,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_action :module_enabled
before_action :merge_request, only: [
:edit, :update, :show, :diffs, :commits, :conflicts, :conflict_for_path, :pipelines, :merge, :merge_check,
- :ci_status, :ci_cd_status, :ci_environments_status, :toggle_subscription, :cancel_merge_when_pipeline_succeeds, :remove_wip, :resolve_conflicts, :assign_related_issues
+ :ci_status, :status, :ci_environments_status, :toggle_subscription, :cancel_merge_when_pipeline_succeeds, :remove_wip, :resolve_conflicts, :assign_related_issues
]
before_action :validates_merge_request, only: [:show, :diffs, :commits, :pipelines]
before_action :define_show_vars, only: [:show, :diffs, :commits, :conflicts, :conflict_for_path, :builds, :pipelines]
@@ -473,9 +473,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController
render json: response
end
- def ci_cd_status
+ def status
render json: PipelineSerializer
.new(project: @project, user: @current_user)
+ .with_status
.represent(@merge_request.head_pipeline)
end
diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb
index 508d627889c..976827040ac 100644
--- a/app/controllers/projects/pipelines_controller.rb
+++ b/app/controllers/projects/pipelines_controller.rb
@@ -72,9 +72,10 @@ class Projects::PipelinesController < Projects::ApplicationController
end
end
- def ci_cd_status
+ def status
render json: PipelineSerializer
.new(project: @project, user: @current_user)
+ .with_status
.represent(@pipeline)
end