Commit 21e3d5ff authored by George Koltsov's avatar George Koltsov

Add issue importers usage pings

- Add usage pings for Issue Importers types.
  FogBugz, Phabricator & JIRA
parent 9087ad74
---
title: Add issue importers usage pings (FogBugz, Phabricator, Jira)
merge_request: 40382
author:
type: added
---
title: Add usage pings for project import using various importers (GitLab, Bitbucket, Gitea, GitHub and more)
merge_request: 40130
author:
type: added
...@@ -523,6 +523,11 @@ module Gitlab ...@@ -523,6 +523,11 @@ module Gitlab
gitea: projects_imported_count('gitea', time_period), gitea: projects_imported_count('gitea', time_period),
git: projects_imported_count('git', time_period), git: projects_imported_count('git', time_period),
manifest: projects_imported_count('manifest', 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 end
......
...@@ -194,13 +194,16 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -194,13 +194,16 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
) )
end end
it 'includes project imports usage data' do it 'includes imports usage data' do
for_defined_days_back do for_defined_days_back do
user = create(:user) 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) create(:project, import_type: type, creator_id: user.id)
end end
jira_project = create(:project, creator_id: user.id)
create(:jira_import_state, :finished, project: jira_project)
end end
expect(described_class.usage_activity_by_stage_manage({})).to include( expect(described_class.usage_activity_by_stage_manage({})).to include(
...@@ -214,6 +217,11 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -214,6 +217,11 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
gitea: 2, gitea: 2,
git: 2, git: 2,
manifest: 2 manifest: 2
},
issues_imported: {
jira: 2,
fogbugz: 2,
phabricator: 2
} }
} }
) )
...@@ -228,6 +236,11 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do ...@@ -228,6 +236,11 @@ RSpec.describe Gitlab::UsageData, :aggregate_failures do
gitea: 1, gitea: 1,
git: 1, git: 1,
manifest: 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