Commit 7c7033ca authored by Mikołaj Wawrzyniak's avatar Mikołaj Wawrzyniak

Merge branch 'remove_suggestion_usage_data' into 'master'

Remove the duplicated suggestion usage data

See merge request gitlab-org/gitlab!77570
parents bef503c2 2daa14c3
...@@ -8,7 +8,7 @@ product_stage: create ...@@ -8,7 +8,7 @@ product_stage: create
product_group: group::code review product_group: group::code review
product_category: code_review product_category: code_review
value_type: number value_type: number
status: active status: removed
time_frame: 28d time_frame: 28d
data_source: database data_source: database
distribution: distribution:
...@@ -20,3 +20,4 @@ tier: ...@@ -20,3 +20,4 @@ tier:
- ultimate - ultimate
performance_indicator_type: [] performance_indicator_type: []
milestone: "<13.9" milestone: "<13.9"
milestone_removed: '14.7'
...@@ -7,7 +7,7 @@ product_stage: create ...@@ -7,7 +7,7 @@ product_stage: create
product_group: group::code review product_group: group::code review
product_category: code_review product_category: code_review
value_type: number value_type: number
status: active status: removed
time_frame: all time_frame: all
data_source: database data_source: database
distribution: distribution:
...@@ -18,3 +18,4 @@ tier: ...@@ -18,3 +18,4 @@ tier:
- premium - premium
- ultimate - ultimate
milestone: "<13.9" milestone: "<13.9"
milestone_removed: '14.7'
...@@ -522,11 +522,7 @@ module Gitlab ...@@ -522,11 +522,7 @@ module Gitlab
projects_with_disable_overriding_approvers_per_merge_request: count(::Project.where(time_period.merge(disable_overriding_approvers_per_merge_request: true))), projects_with_disable_overriding_approvers_per_merge_request: count(::Project.where(time_period.merge(disable_overriding_approvers_per_merge_request: true))),
projects_without_disable_overriding_approvers_per_merge_request: count(::Project.where(time_period.merge(disable_overriding_approvers_per_merge_request: [false, nil]))), projects_without_disable_overriding_approvers_per_merge_request: count(::Project.where(time_period.merge(disable_overriding_approvers_per_merge_request: [false, nil]))),
remote_mirrors: distinct_count(::Project.with_remote_mirrors.where(time_period), :creator_id), remote_mirrors: distinct_count(::Project.with_remote_mirrors.where(time_period), :creator_id),
snippets: distinct_count(::Snippet.where(time_period), :author_id), snippets: distinct_count(::Snippet.where(time_period), :author_id)
suggestions: distinct_count(::Note.with_suggestions.where(time_period),
:author_id,
start: minimum_id(::User),
finish: maximum_id(::User))
}.tap do |h| }.tap do |h|
if time_period.present? if time_period.present?
h[:merge_requests_users] = merge_requests_users(time_period) h[:merge_requests_users] = merge_requests_users(time_period)
......
...@@ -161,7 +161,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -161,7 +161,6 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
another_project = create(:project, :repository, creator: another_user) another_project = create(:project, :repository, creator: another_user)
create(:remote_mirror, project: another_project, enabled: false) create(:remote_mirror, project: another_project, enabled: false)
create(:snippet, author: user) create(:snippet, author: user)
create(:suggestion, note: create(:note, project: project))
end end
expect(described_class.usage_activity_by_stage_create({})).to include( expect(described_class.usage_activity_by_stage_create({})).to include(
...@@ -171,8 +170,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -171,8 +170,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
projects_with_disable_overriding_approvers_per_merge_request: 2, projects_with_disable_overriding_approvers_per_merge_request: 2,
projects_without_disable_overriding_approvers_per_merge_request: 6, projects_without_disable_overriding_approvers_per_merge_request: 6,
remote_mirrors: 2, remote_mirrors: 2,
snippets: 2, snippets: 2
suggestions: 2
) )
expect(described_class.usage_activity_by_stage_create(described_class.monthly_time_range_db_params)).to include( expect(described_class.usage_activity_by_stage_create(described_class.monthly_time_range_db_params)).to include(
deploy_keys: 1, deploy_keys: 1,
...@@ -181,8 +179,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -181,8 +179,7 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
projects_with_disable_overriding_approvers_per_merge_request: 1, projects_with_disable_overriding_approvers_per_merge_request: 1,
projects_without_disable_overriding_approvers_per_merge_request: 3, projects_without_disable_overriding_approvers_per_merge_request: 3,
remote_mirrors: 1, remote_mirrors: 1,
snippets: 1, snippets: 1
suggestions: 1
) )
end end
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