Commit 7a22772c authored by Andreas Brandl's avatar Andreas Brandl

Merge branch 'georgekoltsov/add-importing-issues-usage-pings' into 'master'

Add issue importers usage pings

See merge request gitlab-org/gitlab!40382
parents e85e336c 21e3d5ff
---
title: Add issue importers usage pings (FogBugz, Phabricator, Jira)
merge_request: 40382
author:
type: added
......@@ -524,6 +524,11 @@ module Gitlab
gitea: projects_imported_count('gitea', time_period),
git: projects_imported_count('git', time_period),
manifest: projects_imported_count('manifest', time_period)
},
issues_imported: {
jira: distinct_count(::JiraImportState.where(time_period), :user_id),
fogbugz: projects_imported_count('fogbugz', time_period),
phabricator: projects_imported_count('phabricator', time_period)
}
}
end
......
......@@ -194,13 +194,16 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
)
end
it 'includes project imports usage data' do
it 'includes imports usage data' do
for_defined_days_back do
user = create(:user)
%w(gitlab_project gitlab github bitbucket bitbucket_server gitea git manifest).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)
end
jira_project = create(:project, creator_id: user.id)
create(:jira_import_state, :finished, project: jira_project)
end
expect(described_class.usage_activity_by_stage_manage({})).to include(
......@@ -214,6 +217,11 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
gitea: 2,
git: 2,
manifest: 2
},
issues_imported: {
jira: 2,
fogbugz: 2,
phabricator: 2
}
}
)
......@@ -228,6 +236,11 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
gitea: 1,
git: 1,
manifest: 1
},
issues_imported: {
jira: 1,
fogbugz: 1,
phabricator: 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