Commit ab4950ab authored by Max Woolf's avatar Max Woolf

Add projects with compliance label to usage ping

Sends count of projects with a compliance framework with
usage ping payload back to GitLab
parent f8ed6ad8
---
title: Add number of projects with compliance framework to usage ping
merge_request: 31923
author:
type: added
......@@ -272,7 +272,8 @@ module EE
ldap_keys: distinct_count(::LDAPKey.where(time_period), :user_id),
ldap_users: distinct_count(::GroupMember.of_ldap_type.where(time_period), :user_id),
users_created: count(::User.where(time_period)),
value_stream_management_customized_group_stages: count(::Analytics::CycleAnalytics::GroupStage.where(custom: true))
value_stream_management_customized_group_stages: count(::Analytics::CycleAnalytics::GroupStage.where(custom: true)),
projects_with_compliance_framework: count(::ComplianceManagement::ComplianceFramework::ProjectSettings)
}
end
......
......@@ -419,6 +419,7 @@ describe Gitlab::UsageData do
create(:key, type: 'LDAPKey', user: user)
create(:group_member, ldap: true, user: user)
create(:cycle_analytics_group_stage)
create(:compliance_framework_project_setting)
end
expect(described_class.uncached_data[:usage_activity_by_stage][:manage]).to eq(
......@@ -426,16 +427,18 @@ describe Gitlab::UsageData do
groups: 2,
ldap_keys: 2,
ldap_users: 2,
users_created: 6,
value_stream_management_customized_group_stages: 2
users_created: 8,
value_stream_management_customized_group_stages: 2,
projects_with_compliance_framework: 2
)
expect(described_class.uncached_data[:usage_activity_by_stage_monthly][:manage]).to eq(
events: 1,
groups: 1,
ldap_keys: 1,
ldap_users: 1,
users_created: 4,
value_stream_management_customized_group_stages: 2
users_created: 5,
value_stream_management_customized_group_stages: 2,
projects_with_compliance_framework: 2
)
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