Commit 26d06e3f authored by Dylan Griffith's avatar Dylan Griffith

Merge branch 'jh-migration_mvc_gmau' into 'master'

Group Migration MVC: Add GMAU usage ping

See merge request gitlab-org/gitlab!45536
parents 63fd5337 fc28148b
---
title: Add usage ping for unique users importing groups and projects via the group
migration tool
merge_request: 45536
author:
type: changed
...@@ -585,6 +585,9 @@ module Gitlab ...@@ -585,6 +585,9 @@ module Gitlab
users_created: count(::User.where(time_period), start: user_minimum_id, finish: user_maximum_id), users_created: count(::User.where(time_period), start: user_minimum_id, finish: user_maximum_id),
omniauth_providers: filtered_omniauth_provider_names.reject { |name| name == 'group_saml' }, omniauth_providers: filtered_omniauth_provider_names.reject { |name| name == 'group_saml' },
user_auth_by_provider: distinct_count_user_auth_by_provider(time_period), user_auth_by_provider: distinct_count_user_auth_by_provider(time_period),
bulk_imports: {
gitlab: distinct_count(::BulkImport.where(time_period, source_type: :gitlab), :user_id)
},
projects_imported: { projects_imported: {
gitlab_project: projects_imported_count('gitlab_project', time_period), gitlab_project: projects_imported_count('gitlab_project', time_period),
gitlab: projects_imported_count('gitlab', time_period), gitlab: projects_imported_count('gitlab', time_period),
......
...@@ -203,6 +203,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -203,6 +203,8 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
for_defined_days_back do for_defined_days_back do
user = create(:user) user = create(:user)
create(:bulk_import, user: user)
%w(gitlab_project gitlab github bitbucket bitbucket_server gitea git manifest fogbugz phabricator).each do |type| %w(gitlab_project gitlab github bitbucket bitbucket_server gitea git manifest fogbugz phabricator).each do |type|
create(:project, import_type: type, creator_id: user.id) create(:project, import_type: type, creator_id: user.id)
end end
...@@ -215,6 +217,9 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -215,6 +217,9 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
expect(described_class.usage_activity_by_stage_manage({})).to include( expect(described_class.usage_activity_by_stage_manage({})).to include(
{ {
bulk_imports: {
gitlab: 2
},
projects_imported: { projects_imported: {
gitlab_project: 2, gitlab_project: 2,
gitlab: 2, gitlab: 2,
...@@ -235,6 +240,9 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -235,6 +240,9 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
) )
expect(described_class.usage_activity_by_stage_manage(described_class.last_28_days_time_period)).to include( expect(described_class.usage_activity_by_stage_manage(described_class.last_28_days_time_period)).to include(
{ {
bulk_imports: {
gitlab: 1
},
projects_imported: { projects_imported: {
gitlab_project: 1, gitlab_project: 1,
gitlab: 1, gitlab: 1,
......
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