Commit 361f8512 authored by Shinya Maeda's avatar Shinya Maeda

Rename endpoints 'status' to 'pipeline_status' in merge_requests

parent d8343a0c
...@@ -10,7 +10,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -10,7 +10,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
before_action :module_enabled before_action :module_enabled
before_action :merge_request, only: [ before_action :merge_request, only: [
:edit, :update, :show, :diffs, :commits, :conflicts, :conflict_for_path, :pipelines, :merge, :merge_check, :edit, :update, :show, :diffs, :commits, :conflicts, :conflict_for_path, :pipelines, :merge, :merge_check,
:ci_status, :status, :ci_environments_status, :toggle_subscription, :cancel_merge_when_pipeline_succeeds, :remove_wip, :resolve_conflicts, :assign_related_issues :ci_status, :pipeline_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 :validates_merge_request, only: [:show, :diffs, :commits, :pipelines]
before_action :define_show_vars, only: [:show, :diffs, :commits, :conflicts, :conflict_for_path, :builds, :pipelines] before_action :define_show_vars, only: [:show, :diffs, :commits, :conflicts, :conflict_for_path, :builds, :pipelines]
...@@ -473,7 +473,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController ...@@ -473,7 +473,7 @@ class Projects::MergeRequestsController < Projects::ApplicationController
render json: response render json: response
end end
def status def pipeline_status
render json: PipelineSerializer render json: PipelineSerializer
.new(project: @project, user: @current_user) .new(project: @project, user: @current_user)
.represent_status(@merge_request.head_pipeline) .represent_status(@merge_request.head_pipeline)
......
...@@ -102,7 +102,7 @@ constraints(ProjectUrlConstrainer.new) do ...@@ -102,7 +102,7 @@ constraints(ProjectUrlConstrainer.new) do
get :merge_widget_refresh get :merge_widget_refresh
post :cancel_merge_when_pipeline_succeeds post :cancel_merge_when_pipeline_succeeds
get :ci_status get :ci_status
get :status get :pipeline_status
get :ci_environments_status get :ci_environments_status
post :toggle_subscription post :toggle_subscription
post :remove_wip post :remove_wip
......
...@@ -1179,8 +1179,8 @@ describe Projects::MergeRequestsController do ...@@ -1179,8 +1179,8 @@ describe Projects::MergeRequestsController do
end end
end end
describe 'GET status.json' do describe 'GET pipeline_status.json' do
context 'when accessing status' do context 'when accessing pipeline_status' do
let(:status) do let(:status) do
Gitlab::Ci::Status::Success.new(double('object'), double('user')) Gitlab::Ci::Status::Success.new(double('object'), double('user'))
end end
...@@ -1190,10 +1190,10 @@ describe Projects::MergeRequestsController do ...@@ -1190,10 +1190,10 @@ describe Projects::MergeRequestsController do
ref: merge_request.source_branch, ref: merge_request.source_branch,
sha: merge_request.diff_head_sha, sha: merge_request.diff_head_sha,
status: :success) status: :success)
get :status, namespace_id: project.namespace, get :pipeline_status, namespace_id: project.namespace,
project_id: project, project_id: project,
id: merge_request.iid, id: merge_request.iid,
format: :json format: :json
end end
it 'return a correct pipeline status' do it 'return a correct pipeline status' do
......
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