summaryrefslogtreecommitdiff
path: root/app/models/dev_ops_report
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-11-30 18:14:49 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-11-30 18:14:49 +0000
commit99f37f7ebdeb0e7b7493d9f6294086cc90778304 (patch)
tree410b08af1243d9b7c9305f907143ee4dc42cbcd3 /app/models/dev_ops_report
parent048f666f8a2ba77e45146845ad280ea1c5460ccd (diff)
downloadgitlab-ce-99f37f7ebdeb0e7b7493d9f6294086cc90778304.tar.gz
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'app/models/dev_ops_report')
-rw-r--r--app/models/dev_ops_report/metric.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/app/models/dev_ops_report/metric.rb b/app/models/dev_ops_report/metric.rb
index 14eff725433..d30e869b155 100644
--- a/app/models/dev_ops_report/metric.rb
+++ b/app/models/dev_ops_report/metric.rb
@@ -6,6 +6,20 @@ module DevOpsReport
self.table_name = 'conversational_development_index_metrics'
+ METRICS = %w[leader_issues instance_issues percentage_issues leader_notes instance_notes
+ percentage_notes leader_milestones instance_milestones percentage_milestones
+ leader_boards instance_boards percentage_boards leader_merge_requests
+ instance_merge_requests percentage_merge_requests leader_ci_pipelines
+ instance_ci_pipelines percentage_ci_pipelines leader_environments instance_environments
+ percentage_environments leader_deployments instance_deployments percentage_deployments
+ leader_projects_prometheus_active instance_projects_prometheus_active
+ percentage_projects_prometheus_active leader_service_desk_issues instance_service_desk_issues
+ percentage_service_desk_issues].freeze
+
+ METRICS.each do |metric_name|
+ validates metric_name, presence: true, numericality: { greater_than_or_equal_to: 0 }
+ end
+
def instance_score(feature)
self["instance_#{feature}"]
end