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-10-20 11:43:02 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-10-20 11:43:02 +0300
commitd9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch)
tree2341ef426af70ad1e289c38036737e04b0aa5007 /lib/gitlab/usage_data_counters
parentd6e514dd13db8947884cd58fe2a9c2a063400a9b (diff)
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'lib/gitlab/usage_data_counters')
-rw-r--r--lib/gitlab/usage_data_counters/ci_template_unique_counter.rb28
-rw-r--r--lib/gitlab/usage_data_counters/guest_package_events.yml34
-rw-r--r--lib/gitlab/usage_data_counters/known_events/ci_templates.yml50
-rw-r--r--lib/gitlab/usage_data_counters/known_events/common.yml4
-rw-r--r--lib/gitlab/usage_data_counters/known_events/epic_board_events.yml3
-rw-r--r--lib/gitlab/usage_data_counters/known_events/importer_events.yml17
6 files changed, 37 insertions, 99 deletions
diff --git a/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb b/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb
index e5a50c92329..b8de7de848d 100644
--- a/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb
+++ b/lib/gitlab/usage_data_counters/ci_template_unique_counter.rb
@@ -5,23 +5,14 @@ module Gitlab::UsageDataCounters
REDIS_SLOT = 'ci_templates'
KNOWN_EVENTS_FILE_PATH = File.expand_path('known_events/ci_templates.yml', __dir__)
- # NOTE: Events originating from implicit Auto DevOps pipelines get prefixed with `implicit_`
- TEMPLATE_TO_EVENT = {
- '5-Minute-Production-App.gitlab-ci.yml' => '5_min_production_app',
- 'Auto-DevOps.gitlab-ci.yml' => 'auto_devops',
- 'AWS/CF-Provision-and-Deploy-EC2.gitlab-ci.yml' => 'aws_cf_deploy_ec2',
- 'AWS/Deploy-ECS.gitlab-ci.yml' => 'aws_deploy_ecs',
- 'Jobs/Build.gitlab-ci.yml' => 'auto_devops_build',
- 'Jobs/Deploy.gitlab-ci.yml' => 'auto_devops_deploy',
- 'Jobs/Deploy.latest.gitlab-ci.yml' => 'auto_devops_deploy_latest',
- 'Security/SAST.gitlab-ci.yml' => 'security_sast',
- 'Security/Secret-Detection.gitlab-ci.yml' => 'security_secret_detection',
- 'Terraform/Base.latest.gitlab-ci.yml' => 'terraform_base_latest'
- }.freeze
-
class << self
def track_unique_project_event(project_id:, template:, config_source:)
- Gitlab::UsageDataCounters::HLLRedisCounter.track_event(ci_template_event_name(template, config_source), values: project_id)
+ expanded_template_name = expand_template_name(template)
+ return unless expanded_template_name
+
+ Gitlab::UsageDataCounters::HLLRedisCounter.track_event(
+ ci_template_event_name(expanded_template_name, config_source), values: project_id
+ )
end
def ci_templates(relative_base = 'lib/gitlab/ci/templates')
@@ -30,9 +21,12 @@ module Gitlab::UsageDataCounters
def ci_template_event_name(template_name, config_source)
prefix = 'implicit_' if config_source.to_s == 'auto_devops_source'
- template_event_name = TEMPLATE_TO_EVENT[template_name] || template_to_event_name(template_name)
- "p_#{REDIS_SLOT}_#{prefix}#{template_event_name}"
+ "p_#{REDIS_SLOT}_#{prefix}#{template_to_event_name(template_name)}"
+ end
+
+ def expand_template_name(template_name)
+ Gitlab::Template::GitlabCiYmlTemplate.find(template_name.chomp('.gitlab-ci.yml'))&.full_name
end
private
diff --git a/lib/gitlab/usage_data_counters/guest_package_events.yml b/lib/gitlab/usage_data_counters/guest_package_events.yml
deleted file mode 100644
index a9b9f8ea235..00000000000
--- a/lib/gitlab/usage_data_counters/guest_package_events.yml
+++ /dev/null
@@ -1,34 +0,0 @@
----
-- i_package_composer_guest_delete
-- i_package_composer_guest_pull
-- i_package_composer_guest_push
-- i_package_conan_guest_delete
-- i_package_conan_guest_pull
-- i_package_conan_guest_push
-- i_package_container_guest_delete
-- i_package_container_guest_pull
-- i_package_container_guest_push
-- i_package_debian_guest_delete
-- i_package_debian_guest_pull
-- i_package_debian_guest_push
-- i_package_generic_guest_delete
-- i_package_generic_guest_pull
-- i_package_generic_guest_push
-- i_package_golang_guest_delete
-- i_package_golang_guest_pull
-- i_package_golang_guest_push
-- i_package_maven_guest_delete
-- i_package_maven_guest_pull
-- i_package_maven_guest_push
-- i_package_npm_guest_delete
-- i_package_npm_guest_pull
-- i_package_npm_guest_push
-- i_package_nuget_guest_delete
-- i_package_nuget_guest_pull
-- i_package_nuget_guest_push
-- i_package_pypi_guest_delete
-- i_package_pypi_guest_pull
-- i_package_pypi_guest_push
-- i_package_tag_guest_delete
-- i_package_tag_guest_pull
-- i_package_tag_guest_push
diff --git a/lib/gitlab/usage_data_counters/known_events/ci_templates.yml b/lib/gitlab/usage_data_counters/known_events/ci_templates.yml
index cf790767f17..99bdd3ca9e9 100644
--- a/lib/gitlab/usage_data_counters/known_events/ci_templates.yml
+++ b/lib/gitlab/usage_data_counters/known_events/ci_templates.yml
@@ -1,44 +1,8 @@
-# Implicit Auto DevOps pipeline events
-- name: p_ci_templates_implicit_auto_devops
- category: ci_templates
- redis_slot: ci_templates
- aggregation: weekly
-
-# Explicit include:template pipeline events
-- name: p_ci_templates_5_min_production_app
- category: ci_templates
- redis_slot: ci_templates
- aggregation: weekly
-
-- name: p_ci_templates_aws_cf_deploy_ec2
- category: ci_templates
- redis_slot: ci_templates
- aggregation: weekly
-
-- name: p_ci_templates_auto_devops_build
- category: ci_templates
- redis_slot: ci_templates
- aggregation: weekly
-
-- name: p_ci_templates_auto_devops_deploy
- category: ci_templates
- redis_slot: ci_templates
- aggregation: weekly
-
-- name: p_ci_templates_auto_devops_deploy_latest
- category: ci_templates
- redis_slot: ci_templates
- aggregation: weekly
-
-# This part of the file is generated automatically by
+# This file is generated automatically by
# bin/rake gitlab:usage_data:generate_ci_template_events
#
# Do not edit it manually!
-#
-# The section above this should be removed once we roll out tracking all ci
-# templates
-# https://gitlab.com/gitlab-org/gitlab/-/issues/339684
-
+---
- name: p_ci_templates_terraform_base_latest
category: ci_templates
redis_slot: ci_templates
@@ -463,6 +427,10 @@
category: ci_templates
redis_slot: ci_templates
aggregation: weekly
+- name: p_ci_templates_implicit_auto_devops
+ category: ci_templates
+ redis_slot: ci_templates
+ aggregation: weekly
- name: p_ci_templates_implicit_jobs_dast_default_branch_deploy
category: ci_templates
redis_slot: ci_templates
@@ -499,11 +467,11 @@
category: ci_templates
redis_slot: ci_templates
aggregation: weekly
-- name: p_ci_templates_implicit_auto_devops_deploy
+- name: p_ci_templates_implicit_jobs_deploy
category: ci_templates
redis_slot: ci_templates
aggregation: weekly
-- name: p_ci_templates_implicit_auto_devops_build
+- name: p_ci_templates_implicit_jobs_build
category: ci_templates
redis_slot: ci_templates
aggregation: weekly
@@ -515,7 +483,7 @@
category: ci_templates
redis_slot: ci_templates
aggregation: weekly
-- name: p_ci_templates_implicit_auto_devops_deploy_latest
+- name: p_ci_templates_implicit_jobs_deploy_latest
category: ci_templates
redis_slot: ci_templates
aggregation: weekly
diff --git a/lib/gitlab/usage_data_counters/known_events/common.yml b/lib/gitlab/usage_data_counters/known_events/common.yml
index 261d3b37783..feebc7f395a 100644
--- a/lib/gitlab/usage_data_counters/known_events/common.yml
+++ b/lib/gitlab/usage_data_counters/known_events/common.yml
@@ -149,7 +149,6 @@
category: testing
redis_slot: testing
aggregation: weekly
- feature_flag: usage_data_i_testing_test_case_parsed
- name: i_testing_metrics_report_widget_total
category: testing
redis_slot: testing
@@ -158,7 +157,6 @@
category: testing
redis_slot: testing
aggregation: weekly
- feature_flag: usage_data_i_testing_group_code_coverage_visit_total
- name: i_testing_full_code_quality_report_total
category: testing
redis_slot: testing
@@ -179,12 +177,10 @@
category: testing
redis_slot: testing
aggregation: weekly
- feature_flag: usage_data_i_testing_metrics_report_artifact_uploaders
- name: i_testing_summary_widget_total
category: testing
redis_slot: testing
aggregation: weekly
- feature_flag: usage_data_i_testing_summary_widget_total
# Project Management group
- name: g_project_management_issue_title_changed
category: issues_edit
diff --git a/lib/gitlab/usage_data_counters/known_events/epic_board_events.yml b/lib/gitlab/usage_data_counters/known_events/epic_board_events.yml
index 281db441829..3879c561cc4 100644
--- a/lib/gitlab/usage_data_counters/known_events/epic_board_events.yml
+++ b/lib/gitlab/usage_data_counters/known_events/epic_board_events.yml
@@ -7,16 +7,13 @@
category: epic_boards_usage
redis_slot: project_management
aggregation: daily
- feature_flag: track_epic_boards_activity
- name: g_project_management_users_viewing_epic_boards
category: epic_boards_usage
redis_slot: project_management
aggregation: daily
- feature_flag: track_epic_boards_activity
- name: g_project_management_users_updating_epic_board_names
category: epic_boards_usage
redis_slot: project_management
aggregation: daily
- feature_flag: track_epic_boards_activity
diff --git a/lib/gitlab/usage_data_counters/known_events/importer_events.yml b/lib/gitlab/usage_data_counters/known_events/importer_events.yml
new file mode 100644
index 00000000000..79bbac229bc
--- /dev/null
+++ b/lib/gitlab/usage_data_counters/known_events/importer_events.yml
@@ -0,0 +1,17 @@
+---
+# Importer events
+- name: github_import_project_start
+ category: importer
+ redis_slot: import
+ aggregation: weekly
+ feature_flag: track_importer_activity
+- name: github_import_project_success
+ category: importer
+ redis_slot: import
+ aggregation: weekly
+ feature_flag: track_importer_activity
+- name: github_import_project_failure
+ category: importer
+ redis_slot: import
+ aggregation: weekly
+ feature_flag: track_importer_activity