Commit 3d29e784 authored by Vitali Tatarintev's avatar Vitali Tatarintev

Merge branch '224593-update-usage-ping-data-to-track-file-locking-data' into 'master'

Update usage ping data to track file locking methods

See merge request gitlab-org/gitlab!40419
parents 06ad533c d132d106
---
title: Adding counts of users using default branch locks and users using multi-branch LFS locks
merge_request: 40419
author:
type: added
......@@ -240,7 +240,9 @@ module EE
suggestions: distinct_count(::Note.with_suggestions.where(time_period),
:author_id,
start: user_minimum_id,
finish: user_maximum_id)
finish: user_maximum_id),
users_using_path_locks: distinct_count(PathLock.where(time_period), :user_id),
users_using_lfs_locks: distinct_count(LfsFileLock.where(time_period), :user_id)
}, approval_rules_counts)
end
......
......@@ -298,6 +298,18 @@ RSpec.describe Gitlab::UsageData do
create(:approval_merge_request_rule, merge_request: merge_request)
create_list(:code_owner_rule, 3, approvals_required: 2)
create_list(:code_owner_rule, 2)
create(:lfs_file_lock, project: project, path: 'a.txt')
create(:lfs_file_lock, project: project, path: 'b.txt')
create(:lfs_file_lock, user: user, project: project, path: 'c.txt')
create(:lfs_file_lock, user: user, project: project, path: 'd.txt')
create(:path_lock, project: project, path: '1.txt')
create(:path_lock, project: project, path: '2.txt')
create(:path_lock, project: project, path: '3.txt')
create(:path_lock, user: user, project: project, path: '4.txt')
create(:path_lock, user: user, project: project, path: '5.txt')
create(:path_lock, user: user, project: project, path: '6.txt')
end
expect(described_class.usage_activity_by_stage_create({})).to include(
......@@ -311,7 +323,9 @@ RSpec.describe Gitlab::UsageData do
projects_imported_from_github: 2,
projects_with_repositories_enabled: 12,
protected_branches: 2,
suggestions: 2
suggestions: 2,
users_using_lfs_locks: 6,
users_using_path_locks: 8
)
expect(described_class.usage_activity_by_stage_create(described_class.last_28_days_time_period)).to include(
approval_project_rules: 6,
......@@ -324,7 +338,9 @@ RSpec.describe Gitlab::UsageData do
projects_imported_from_github: 1,
projects_with_repositories_enabled: 6,
protected_branches: 1,
suggestions: 1
suggestions: 1,
users_using_lfs_locks: 3,
users_using_path_locks: 4
)
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