summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKamil Trzciński <ayufan@ayufan.eu>2017-09-13 08:48:20 +0000
committerKamil Trzciński <ayufan@ayufan.eu>2017-09-13 08:48:20 +0000
commite19827ab3b9979324b978422978518d86ba3b3a9 (patch)
tree2b2a759b4cd3db29181db37416cf3996b29ce2e8
parent3b215d051857c14ee27e9d906fedea934f1ca92d (diff)
parent74bf291c78538641bb871adf8d998bdf0f8e2508 (diff)
downloadgitlab-ce-e19827ab3b9979324b978422978518d86ba3b3a9.tar.gz
Merge branch 'zj-usage-data-auto-devops' into 'master'
Add usage ping for Auto DevOps Closes #37648 See merge request !14162
-rw-r--r--app/models/project_auto_devops.rb3
-rw-r--r--changelogs/unreleased/zj-usage-data-auto-devops.yml5
-rw-r--r--lib/gitlab/usage_data.rb4
-rw-r--r--spec/lib/gitlab/usage_data_spec.rb4
4 files changed, 16 insertions, 0 deletions
diff --git a/app/models/project_auto_devops.rb b/app/models/project_auto_devops.rb
index 53731579e87..7af3b6870e2 100644
--- a/app/models/project_auto_devops.rb
+++ b/app/models/project_auto_devops.rb
@@ -1,6 +1,9 @@
class ProjectAutoDevops < ActiveRecord::Base
belongs_to :project
+ scope :enabled, -> { where(enabled: true) }
+ scope :disabled, -> { where(enabled: false) }
+
validates :domain, allow_blank: true, hostname: { allow_numeric_hostname: true }
def variables
diff --git a/changelogs/unreleased/zj-usage-data-auto-devops.yml b/changelogs/unreleased/zj-usage-data-auto-devops.yml
new file mode 100644
index 00000000000..9b5ec894042
--- /dev/null
+++ b/changelogs/unreleased/zj-usage-data-auto-devops.yml
@@ -0,0 +1,5 @@
+---
+title: Add usage data for Auto DevOps
+merge_request:
+author:
+type: other
diff --git a/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 3cf26625108..36708078136 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -22,9 +22,13 @@ module Gitlab
ci_builds: ::Ci::Build.count,
ci_internal_pipelines: ::Ci::Pipeline.internal.count,
ci_external_pipelines: ::Ci::Pipeline.external.count,
+ ci_pipeline_config_auto_devops: ::Ci::Pipeline.auto_devops_source.count,
+ ci_pipeline_config_repository: ::Ci::Pipeline.repository_source.count,
ci_runners: ::Ci::Runner.count,
ci_triggers: ::Ci::Trigger.count,
ci_pipeline_schedules: ::Ci::PipelineSchedule.count,
+ auto_devops_enabled: ::ProjectAutoDevops.enabled.count,
+ auto_devops_disabled: ::ProjectAutoDevops.disabled.count,
deploy_keys: DeployKey.count,
deployments: Deployment.count,
environments: ::Environment.count,
diff --git a/spec/lib/gitlab/usage_data_spec.rb b/spec/lib/gitlab/usage_data_spec.rb
index 68429d792f2..c7d9f105f04 100644
--- a/spec/lib/gitlab/usage_data_spec.rb
+++ b/spec/lib/gitlab/usage_data_spec.rb
@@ -40,9 +40,13 @@ describe Gitlab::UsageData do
ci_builds
ci_internal_pipelines
ci_external_pipelines
+ ci_pipeline_config_auto_devops
+ ci_pipeline_config_repository
ci_runners
ci_triggers
ci_pipeline_schedules
+ auto_devops_enabled
+ auto_devops_disabled
deploy_keys
deployments
environments