summaryrefslogtreecommitdiff
path: root/app/controllers/projects/settings
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2020-10-21 07:08:36 +0000
commit48aff82709769b098321c738f3444b9bdaa694c6 (patch)
treee00c7c43e2d9b603a5a6af576b1685e400410dee /app/controllers/projects/settings
parent879f5329ee916a948223f8f43d77fba4da6cd028 (diff)
downloadgitlab-ce-48aff82709769b098321c738f3444b9bdaa694c6.tar.gz
Add latest changes from gitlab-org/gitlab@13-5-stable-eev13.5.0-rc42
Diffstat (limited to 'app/controllers/projects/settings')
-rw-r--r--app/controllers/projects/settings/access_tokens_controller.rb2
-rw-r--r--app/controllers/projects/settings/ci_cd_controller.rb25
-rw-r--r--app/controllers/projects/settings/integrations_controller.rb2
-rw-r--r--app/controllers/projects/settings/operations_controller.rb37
-rw-r--r--app/controllers/projects/settings/repository_controller.rb5
5 files changed, 58 insertions, 13 deletions
diff --git a/app/controllers/projects/settings/access_tokens_controller.rb b/app/controllers/projects/settings/access_tokens_controller.rb
index d6b4c4dd5dc..cbd6716fdf7 100644
--- a/app/controllers/projects/settings/access_tokens_controller.rb
+++ b/app/controllers/projects/settings/access_tokens_controller.rb
@@ -7,6 +7,8 @@ module Projects
before_action :check_feature_availability
+ feature_category :authentication_and_authorization
+
def index
@project_access_token = PersonalAccessToken.new
set_index_vars
diff --git a/app/controllers/projects/settings/ci_cd_controller.rb b/app/controllers/projects/settings/ci_cd_controller.rb
index d0d100fd88c..2963321f803 100644
--- a/app/controllers/projects/settings/ci_cd_controller.rb
+++ b/app/controllers/projects/settings/ci_cd_controller.rb
@@ -3,15 +3,25 @@
module Projects
module Settings
class CiCdController < Projects::ApplicationController
+ include RunnerSetupScripts
+
before_action :authorize_admin_pipeline!
before_action :define_variables
before_action do
push_frontend_feature_flag(:new_variables_ui, @project, default_enabled: true)
push_frontend_feature_flag(:ajax_new_deploy_token, @project)
- push_frontend_feature_flag(:ci_key_autocomplete, default_enabled: true)
end
+ helper_method :highlight_badge
+
+ feature_category :continuous_integration
+
def show
+ if Feature.enabled?(:ci_pipeline_triggers_settings_vue_ui, @project)
+ @triggers_json = ::Ci::TriggerSerializer.new.represent(
+ @project.triggers, current_user: current_user, project: @project
+ ).to_json
+ end
end
def update
@@ -48,8 +58,16 @@ module Projects
redirect_to namespace_project_settings_ci_cd_path
end
+ def runner_setup_scripts
+ private_runner_setup_scripts(project: @project)
+ end
+
private
+ def highlight_badge(name, content, language = nil)
+ Gitlab::Highlight.highlight(name, content, language: language)
+ end
+
def update_params
params.require(:project).permit(*permitted_project_params)
end
@@ -58,9 +76,9 @@ module Projects
[
:runners_token, :builds_enabled, :build_allow_git_fetch,
:build_timeout_human_readable, :build_coverage_regex, :public_builds,
- :auto_cancel_pending_pipelines, :forward_deployment_enabled, :ci_config_path,
+ :auto_cancel_pending_pipelines, :ci_config_path,
auto_devops_attributes: [:id, :domain, :enabled, :deploy_strategy],
- ci_cd_settings_attributes: [:default_git_depth]
+ ci_cd_settings_attributes: [:default_git_depth, :forward_deployment_enabled]
].tap do |list|
list << :max_artifacts_size if can?(current_user, :update_max_artifacts_size, project)
end
@@ -116,6 +134,7 @@ module Projects
def define_triggers_variables
@triggers = @project.triggers
.present(current_user: current_user)
+
@trigger = ::Ci::Trigger.new
.present(current_user: current_user)
end
diff --git a/app/controllers/projects/settings/integrations_controller.rb b/app/controllers/projects/settings/integrations_controller.rb
index 96bf7f474d1..fba11ff1497 100644
--- a/app/controllers/projects/settings/integrations_controller.rb
+++ b/app/controllers/projects/settings/integrations_controller.rb
@@ -6,6 +6,8 @@ module Projects
before_action :authorize_admin_project!
layout "project_settings"
+ feature_category :integrations
+
def show
@services = @project.find_or_initialize_services
end
diff --git a/app/controllers/projects/settings/operations_controller.rb b/app/controllers/projects/settings/operations_controller.rb
index 781b850ddfe..c407b15e29f 100644
--- a/app/controllers/projects/settings/operations_controller.rb
+++ b/app/controllers/projects/settings/operations_controller.rb
@@ -9,6 +9,9 @@ module Projects
respond_to :json, only: [:reset_alerting_token, :reset_pagerduty_token]
helper_method :error_tracking_setting
+ helper_method :tracing_setting
+
+ feature_category :incident_management
def update
result = ::Projects::Operations::UpdateService.new(project, current_user, update_params).execute
@@ -17,15 +20,6 @@ module Projects
render_update_response(result)
end
- # overridden in EE
- def track_events(result)
- if result[:status] == :success
- ::Gitlab::Tracking::IncidentManagement.track_from_params(
- update_params[:incident_management_setting_attributes]
- )
- end
- end
-
def reset_alerting_token
result = ::Projects::Operations::UpdateService
.new(project, current_user, alerting_params)
@@ -55,6 +49,24 @@ module Projects
private
+ def track_events(result)
+ if result[:status] == :success
+ ::Gitlab::Tracking::IncidentManagement.track_from_params(
+ update_params[:incident_management_setting_attributes]
+ )
+ track_tracing_external_url
+ end
+ end
+
+ def track_tracing_external_url
+ external_url_previous_change = project&.tracing_setting&.external_url_previous_change
+
+ return unless external_url_previous_change
+ return unless external_url_previous_change[0].blank? && external_url_previous_change[1].present?
+
+ ::Gitlab::Tracking.event('project:operations:tracing', 'external_url_populated')
+ end
+
def alerting_params
{ alerting_setting_attributes: { regenerate_token: true } }
end
@@ -106,6 +118,10 @@ module Projects
project.build_error_tracking_setting
end
+ def tracing_setting
+ @tracing_setting ||= project.tracing_setting || project.build_tracing_setting
+ end
+
def update_params
params.require(:project).permit(permitted_project_params)
end
@@ -124,7 +140,8 @@ module Projects
project: [:slug, :name, :organization_slug, :organization_name]
],
- grafana_integration_attributes: [:token, :grafana_url, :enabled]
+ grafana_integration_attributes: [:token, :grafana_url, :enabled],
+ tracing_setting_attributes: [:external_url]
}
if Feature.enabled?(:settings_operations_prometheus_service, project)
diff --git a/app/controllers/projects/settings/repository_controller.rb b/app/controllers/projects/settings/repository_controller.rb
index 35ca9336613..0994bebb1d0 100644
--- a/app/controllers/projects/settings/repository_controller.rb
+++ b/app/controllers/projects/settings/repository_controller.rb
@@ -7,8 +7,12 @@ module Projects
before_action :define_variables, only: [:create_deploy_token]
before_action do
push_frontend_feature_flag(:ajax_new_deploy_token, @project)
+ push_frontend_feature_flag(:deploy_keys_on_protected_branches, @project)
end
+ feature_category :source_code_management, [:show, :cleanup]
+ feature_category :continuous_delivery, [:create_deploy_token]
+
def show
render_show
end
@@ -125,6 +129,7 @@ module Projects
gon.push(protectable_tags_for_dropdown)
gon.push(protectable_branches_for_dropdown)
gon.push(access_levels_options)
+ gon.push(current_project_id: project.id) if project
end
end
end