Commit 219f6621 authored by Ash McKenzie's avatar Ash McKenzie

Merge branch 'remove-duplicate-usage-data' into 'master'

Remove duplicate usage data that are already defined in stage create

See merge request gitlab-org/gitlab!48662
parents 1ba0026a 212ae963
......@@ -200,14 +200,6 @@ module EE
ldap_keys: count(::LDAPKey),
ldap_users: count(::User.ldap, 'users.id'),
pod_logs_usages_total: redis_usage_data { ::Gitlab::UsageCounters::PodLogs.usage_totals[:total] },
projects_enforcing_code_owner_approval: count(::Project.without_deleted.non_archived.requiring_code_owner_approval),
merge_requests_with_added_rules: distinct_count(::ApprovalMergeRequestRule.with_added_approval_rules,
:merge_request_id,
start: approval_merge_request_rule_minimum_id,
finish: approval_merge_request_rule_maximum_id),
merge_requests_with_optional_codeowners: distinct_count(::ApprovalMergeRequestRule.code_owner_approval_optional, :merge_request_id),
merge_requests_with_overridden_project_rules: merge_requests_with_overridden_project_rules,
merge_requests_with_required_codeowners: distinct_count(::ApprovalMergeRequestRule.code_owner_approval_required, :merge_request_id),
merged_merge_requests_using_approval_rules: count(::MergeRequest.merged.joins(:approval_rules), # rubocop: disable CodeReuse/ActiveRecord
start: merge_request_minimum_id,
finish: merge_request_maximum_id),
......
......@@ -219,24 +219,6 @@ RSpec.describe Gitlab::UsageData do
end
end
describe 'code owner approval required' do
before do
create(:protected_branch, code_owner_approval_required: true)
create(:protected_branch,
code_owner_approval_required: true,
project: create(:project, :archived))
create(:protected_branch,
code_owner_approval_required: true,
project: create(:project, pending_delete: true))
end
it 'counts the projects actively requiring code owner approval' do
expect(described_class.system_usage_data[:counts][:projects_enforcing_code_owner_approval]).to eq(1)
end
end
describe 'merge requests merged using approval rules' do
before do
create(:approval_merge_request_rule, merge_request: create(:merge_request, :merged))
......
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