diff options
author | Fatih Acet <acetfatih@gmail.com> | 2017-05-19 22:52:45 +0300 |
---|---|---|
committer | Fatih Acet <acetfatih@gmail.com> | 2017-05-19 22:52:45 +0300 |
commit | 5460153c9f1a0b1679e4f31f1d588cb77857b714 (patch) | |
tree | bbee0c9665f835a7834995374b15ab32d86eded9 /app/controllers | |
parent | db4bbbabcafa78cfa0176fefac1b4c1dd33d098f (diff) | |
parent | b3cf3d046b8a319c0dbca7cb9aeaea027c080e6f (diff) |
Merge branch '32536-mr-widget-performance-improvements' into 'master'
Load improvements related to MR widget
See merge request !11518
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index b99ccd453b8..0352065998b 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -9,14 +9,15 @@ 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, + :edit, :update, :show, :diffs, :commits, :conflicts, :conflict_for_path, :pipelines, :merge, :pipeline_status, :ci_environments_status, :toggle_subscription, :cancel_merge_when_pipeline_succeeds, :remove_wip, :resolve_conflicts, :assign_related_issues, :commit_change_content ] 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: [:diffs, :commits, :conflicts, :conflict_for_path, :builds, :pipelines] before_action :define_commit_vars, only: [:diffs] before_action :ensure_ref_fetched, only: [:show, :diffs, :commits, :builds, :conflicts, :conflict_for_path, :pipelines] before_action :close_merge_request_without_source_project, only: [:show, :diffs, :commits, :builds, :pipelines] + before_action :check_if_can_be_merged, only: :show before_action :apply_diff_view_cookie!, only: [:new_diffs] before_action :build_merge_request, only: [:new, :new_diffs] @@ -75,9 +76,12 @@ class Projects::MergeRequestsController < Projects::ApplicationController respond_to do |format| format.html do define_discussion_vars + define_show_vars end format.json do + Gitlab::PollingInterval.set_header(response, interval: 10_000) + render json: serializer.represent(@merge_request, basic: params[:basic]) end @@ -309,12 +313,6 @@ class Projects::MergeRequestsController < Projects::ApplicationController render json: serializer.represent(@merge_request) end - def merge_check - @merge_request.check_if_can_be_merged - - render json: serializer.represent(@merge_request) - end - def commit_change_content render partial: 'projects/merge_requests/widget/commit_change_content', layout: false end @@ -640,6 +638,10 @@ class Projects::MergeRequestsController < Projects::ApplicationController private + def check_if_can_be_merged + @merge_request.check_if_can_be_merged + end + def merge! # Disable the CI check if merge_when_pipeline_succeeds is enabled since we have # to wait until CI completes to know |