Commit cf886916 authored by GitLab Bot's avatar GitLab Bot

Automatic merge of gitlab-org/gitlab-ce master

parents a6141c13 aa4cb474
---
title: Add repositories count to usage ping data
merge_request: 24823
author:
type: added
...@@ -83,6 +83,7 @@ module Gitlab ...@@ -83,6 +83,7 @@ module Gitlab
pages_domains: count(PagesDomain), pages_domains: count(PagesDomain),
projects: count(Project), projects: count(Project),
projects_imported_from_github: count(Project.where(import_type: 'github')), projects_imported_from_github: count(Project.where(import_type: 'github')),
projects_with_repositories_enabled: count(ProjectFeature.where('repository_access_level > ?', ProjectFeature::DISABLED)),
protected_branches: count(ProtectedBranch), protected_branches: count(ProtectedBranch),
releases: count(Release), releases: count(Release),
remote_mirrors: count(RemoteMirror), remote_mirrors: count(RemoteMirror),
......
...@@ -27,6 +27,8 @@ describe Gitlab::UsageData do ...@@ -27,6 +27,8 @@ describe Gitlab::UsageData do
create(:clusters_applications_prometheus, :installed, cluster: gcp_cluster) create(:clusters_applications_prometheus, :installed, cluster: gcp_cluster)
create(:clusters_applications_runner, :installed, cluster: gcp_cluster) create(:clusters_applications_runner, :installed, cluster: gcp_cluster)
create(:clusters_applications_knative, :installed, cluster: gcp_cluster) create(:clusters_applications_knative, :installed, cluster: gcp_cluster)
ProjectFeature.first.update_attribute('repository_access_level', 0)
end end
subject { described_class.data } subject { described_class.data }
...@@ -113,6 +115,7 @@ describe Gitlab::UsageData do ...@@ -113,6 +115,7 @@ describe Gitlab::UsageData do
projects_slack_notifications_active projects_slack_notifications_active
projects_slack_slash_active projects_slack_slash_active
projects_prometheus_active projects_prometheus_active
projects_with_repositories_enabled
pages_domains pages_domains
protected_branches protected_branches
releases releases
...@@ -135,6 +138,7 @@ describe Gitlab::UsageData do ...@@ -135,6 +138,7 @@ describe Gitlab::UsageData do
expect(count_data[:projects_jira_cloud_active]).to eq(1) expect(count_data[:projects_jira_cloud_active]).to eq(1)
expect(count_data[:projects_slack_notifications_active]).to eq(2) expect(count_data[:projects_slack_notifications_active]).to eq(2)
expect(count_data[:projects_slack_slash_active]).to eq(1) expect(count_data[:projects_slack_slash_active]).to eq(1)
expect(count_data[:projects_with_repositories_enabled]).to eq(2)
expect(count_data[:clusters_enabled]).to eq(7) expect(count_data[:clusters_enabled]).to eq(7)
expect(count_data[:project_clusters_enabled]).to eq(6) expect(count_data[:project_clusters_enabled]).to eq(6)
......
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