Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-07-20 12:55:51 +0300
commite8d2c2579383897a1dd7f9debd359abe8ae8373d (patch)
treec42be41678c2586d49a75cabce89322082698334 /lib/gitlab/database_importers
parentfc845b37ec3a90aaa719975f607740c22ba6a113 (diff)
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'lib/gitlab/database_importers')
-rw-r--r--lib/gitlab/database_importers/instance_administrators/create_group.rb2
-rw-r--r--lib/gitlab/database_importers/self_monitoring/project/create_service.rb19
2 files changed, 11 insertions, 10 deletions
diff --git a/lib/gitlab/database_importers/instance_administrators/create_group.rb b/lib/gitlab/database_importers/instance_administrators/create_group.rb
index d9425810405..79244120776 100644
--- a/lib/gitlab/database_importers/instance_administrators/create_group.rb
+++ b/lib/gitlab/database_importers/instance_administrators/create_group.rb
@@ -89,7 +89,7 @@ module Gitlab
end
def track_event(result)
- ::Gitlab::Tracking.event("instance_administrators_group", "group_created")
+ ::Gitlab::Tracking.event("instance_administrators_group", "group_created", namespace: result[:group])
success(result)
end
diff --git a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
index d1ada8c723e..57d354eb907 100644
--- a/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
+++ b/lib/gitlab/database_importers/self_monitoring/project/create_service.rb
@@ -75,13 +75,13 @@ module Gitlab
if response
# In the add_prometheus_manual_configuration method, the Prometheus
- # server_address config is saved as an api_url in the PrometheusService
- # model. There are validates hooks in the PrometheusService model that
- # check if the project associated with the PrometheusService is the
+ # server_address config is saved as an api_url in the Integrations::Prometheus
+ # model. There are validates hooks in the Integrations::Prometheus model that
+ # check if the project associated with the Integrations::Prometheus is the
# self_monitoring project. It checks
# Gitlab::CurrentSettings.self_monitoring_project_id, which is why the
# Gitlab::CurrentSettings cache needs to be expired here, so that
- # PrometheusService sees the latest self_monitoring_project_id.
+ # Integrations::Prometheus sees the latest self_monitoring_project_id.
Gitlab::CurrentSettings.expire_current_application_settings
success(result)
else
@@ -107,10 +107,10 @@ module Gitlab
return success(result) unless prometheus_enabled?
return success(result) unless prometheus_server_address.present?
- service = result[:project].find_or_initialize_service('prometheus')
+ prometheus = result[:project].find_or_initialize_integration('prometheus')
- unless service.update(prometheus_service_attributes)
- log_error('Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}' % { errors: service.errors.full_messages })
+ unless prometheus.update(prometheus_integration_attributes)
+ log_error('Could not save prometheus manual configuration for self-monitoring project. Errors: %{errors}' % { errors: prometheus.errors.full_messages })
return error(_('Could not save prometheus manual configuration'))
end
@@ -118,7 +118,8 @@ module Gitlab
end
def track_event(result)
- ::Gitlab::Tracking.event("self_monitoring", "project_created")
+ project = result[:project]
+ ::Gitlab::Tracking.event("self_monitoring", "project_created", project: project, namespace: project.namespace)
success(result)
end
@@ -156,7 +157,7 @@ module Gitlab
::Gitlab::Prometheus::Internal.uri
end
- def prometheus_service_attributes
+ def prometheus_integration_attributes
{
api_url: internal_prometheus_server_address_uri,
manual_configuration: true,