summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZeger-Jan van de Weg <git@zjvandeweg.nl>2017-09-12 12:33:48 +0200
committerZeger-Jan van de Weg <git@zjvandeweg.nl>2017-09-12 12:33:48 +0200
commit74bf291c78538641bb871adf8d998bdf0f8e2508 (patch)
treeb78727d98004cb5a9e958591eca25f6aabc973a1
parent5c6f40ab6e825e8d31e3bfc362e9bcce80a14dba (diff)
downloadgitlab-ce-74bf291c78538641bb871adf8d998bdf0f8e2508.tar.gz
Add auto devops enabled/disabled to usage ping
-rw-r--r--app/models/project_auto_devops.rb3
-rw-r--r--lib/gitlab/usage_data.rb2
-rw-r--r--spec/lib/gitlab/usage_data_spec.rb2
3 files changed, 7 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/lib/gitlab/usage_data.rb b/lib/gitlab/usage_data.rb
index 47b0be5835f..36708078136 100644
--- a/lib/gitlab/usage_data.rb
+++ b/lib/gitlab/usage_data.rb
@@ -27,6 +27,8 @@ module Gitlab
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 daca5c73415..c7d9f105f04 100644
--- a/spec/lib/gitlab/usage_data_spec.rb
+++ b/spec/lib/gitlab/usage_data_spec.rb
@@ -45,6 +45,8 @@ describe Gitlab::UsageData do
ci_runners
ci_triggers
ci_pipeline_schedules
+ auto_devops_enabled
+ auto_devops_disabled
deploy_keys
deployments
environments