diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 14:14:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2019-09-18 14:14:39 +0000 |
commit | 1eb82b65c554f21d83447f895a6208905fabe112 (patch) | |
tree | ab12f01b3dc46f11c02afea1e470a78f06ca70c2 /app/controllers | |
parent | 4ab54c2233e91f60a80e5b6fa2181e6899fdcc3e (diff) | |
download | gitlab-ce-stable-branch-foss-test.tar.gz |
Add latest changes from gitlab-org/gitlab@12-3-auto-deploy-20190916stable-branch-foss-test
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/admin/application_settings_controller.rb | 11 | ||||
-rw-r--r-- | app/controllers/projects/merge_requests_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/projects/pipelines_controller.rb | 10 |
3 files changed, 12 insertions, 11 deletions
diff --git a/app/controllers/admin/application_settings_controller.rb b/app/controllers/admin/application_settings_controller.rb index 03e935fceae..dc16ad80980 100644 --- a/app/controllers/admin/application_settings_controller.rb +++ b/app/controllers/admin/application_settings_controller.rb @@ -6,16 +6,15 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController before_action :set_application_setting before_action :whitelist_query_limiting, only: [:usage_data] - VALID_SETTING_PANELS = %w(general integrations repository templates + VALID_SETTING_PANELS = %w(show integrations repository templates ci_cd reporting metrics_and_profiling network geo preferences).freeze - VALID_SETTING_PANELS.each do |action| - define_method(action) { perform_update if submitted? } + def show end - def show - render :general + (VALID_SETTING_PANELS - %w(show)).each do |action| + define_method(action) { perform_update if submitted? } end def update @@ -145,7 +144,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController end def render_update_error - action = VALID_SETTING_PANELS.include?(action_name) ? action_name : :general + action = VALID_SETTING_PANELS.include?(action_name) ? action_name : :show render action end diff --git a/app/controllers/projects/merge_requests_controller.rb b/app/controllers/projects/merge_requests_controller.rb index af87e04f9c8..0d992bb35f8 100644 --- a/app/controllers/projects/merge_requests_controller.rb +++ b/app/controllers/projects/merge_requests_controller.rb @@ -211,7 +211,7 @@ class Projects::MergeRequestsController < Projects::MergeRequests::ApplicationCo end def discussions - merge_request.discussions_diffs.load_highlight + merge_request.preload_discussions_diff_highlight super end diff --git a/app/controllers/projects/pipelines_controller.rb b/app/controllers/projects/pipelines_controller.rb index 477ba36e9d1..28c25dbc1e6 100644 --- a/app/controllers/projects/pipelines_controller.rb +++ b/app/controllers/projects/pipelines_controller.rb @@ -8,9 +8,6 @@ class Projects::PipelinesController < Projects::ApplicationController before_action :authorize_read_build!, only: [:index] before_action :authorize_create_pipeline!, only: [:new, :create] before_action :authorize_update_pipeline!, only: [:retry, :cancel] - before_action do - push_frontend_feature_flag(:hide_dismissed_vulnerabilities) - end around_action :allow_gitaly_ref_name_caching, only: [:index, :show] @@ -199,7 +196,12 @@ class Projects::PipelinesController < Projects::ApplicationController end def latest_pipeline - @project.latest_pipeline_for_ref(params['ref']) + ref = params['ref'].presence || @project.default_branch + sha = @project.commit(ref)&.sha + + @project.ci_pipelines + .newest_first(ref: ref, sha: sha) + .first &.present(current_user: current_user) end |