Commit 9bac0b35 authored by Luis Mejia's avatar Luis Mejia

Reuse usage data deprecated value in ee

parent 1e1a633e
......@@ -3,8 +3,6 @@
module EE
module Gitlab
module UsageData
DEPRECATED_VALUE = -1000
extend ActiveSupport::Concern
EE_MEMOIZED_VALUES = %i(
......@@ -203,7 +201,7 @@ module EE
issues_with_health_status: count(::Issue.with_health_status, start: minimum_id(::Issue), finish: maximum_id(::Issue)),
ldap_keys: count(::LDAPKey),
ldap_users: count(::User.ldap, 'users.id'),
pod_logs_usages_total: DEPRECATED_VALUE,
pod_logs_usages_total: Gitlab::UsageData::DEPRECATED_VALUE,
merged_merge_requests_using_approval_rules: count(::MergeRequest.merged.joins(:approval_rules), # rubocop: disable CodeReuse/ActiveRecord
start: minimum_id(::MergeRequest),
finish: maximum_id(::MergeRequest)),
......@@ -236,7 +234,7 @@ module EE
super.merge({
projects_slack_notifications_active: distinct_count(::Project.with_slack_service.where(time_period), :creator_id),
projects_slack_slash_active: distinct_count(::Project.with_slack_slash_commands_service.where(time_period), :creator_id),
projects_with_prometheus_alerts: DEPRECATED_VALUE
projects_with_prometheus_alerts: Gitlab::UsageData::DEPRECATED_VALUE
})
end
......
......@@ -125,7 +125,7 @@ RSpec.describe Gitlab::UsageData do
network_policy_drops
))
expect(count_data[:projects_with_prometheus_alerts]).to eq(EE::Gitlab::UsageData::DEPRECATED_VALUE)
expect(count_data[:projects_with_prometheus_alerts]).to eq(Gitlab::UsageData::DEPRECATED_VALUE)
expect(count_data[:feature_flags]).to eq(1)
expect(count_data[:status_page_projects]).to eq(1)
expect(count_data[:status_page_issues]).to eq(1)
......@@ -268,12 +268,12 @@ RSpec.describe Gitlab::UsageData do
expect(described_class.usage_activity_by_stage_configure({})).to include(
projects_slack_notifications_active: 2,
projects_slack_slash_active: 2,
projects_with_prometheus_alerts: EE::Gitlab::UsageData::DEPRECATED_VALUE
projects_with_prometheus_alerts: Gitlab::UsageData::DEPRECATED_VALUE
)
expect(described_class.usage_activity_by_stage_configure(described_class.last_28_days_time_period)).to include(
projects_slack_notifications_active: 1,
projects_slack_slash_active: 1,
projects_with_prometheus_alerts: EE::Gitlab::UsageData::DEPRECATED_VALUE
projects_with_prometheus_alerts: Gitlab::UsageData::DEPRECATED_VALUE
)
end
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment