Skip to content

Commit 9f76632

Browse files
balasankarcsmcgivern
authored andcommitted
Add installation type to usage ping data
1 parent 75ee50f commit 9f76632

File tree

4 files changed

+5
-0
lines changed

4 files changed

+5
-0
lines changed

INSTALLATION_TYPE

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
source

lib/gitlab.rb

+1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def self.revision
3333
APP_DIRS_PATTERN = %r{^/?(app|config|ee|lib|spec|\(\w*\))}
3434
SUBDOMAIN_REGEX = %r{\Ahttps://[a-z0-9]+\.gitlab\.com\z}
3535
VERSION = File.read(root.join("VERSION")).strip.freeze
36+
INSTALLATION_TYPE = File.read(root.join("INSTALLATION_TYPE")).strip.freeze
3637

3738
def self.com?
3839
# Check `gl_subdomain?` as well to keep parity with gitlab.com

lib/gitlab/usage_data.rb

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def license_usage_data
2121
uuid: Gitlab::CurrentSettings.uuid,
2222
hostname: Gitlab.config.gitlab.host,
2323
version: Gitlab::VERSION,
24+
installation_type: Gitlab::INSTALLATION_TYPE,
2425
active_user_count: User.active.count,
2526
recorded_at: Time.now,
2627
mattermost_enabled: Gitlab.config.mattermost.enabled,

spec/lib/gitlab/usage_data_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
mattermost_enabled
3333
edition
3434
version
35+
installation_type
3536
uuid
3637
hostname
3738
signup
@@ -156,6 +157,7 @@
156157
it "gathers license data" do
157158
expect(subject[:uuid]).to eq(Gitlab::CurrentSettings.uuid)
158159
expect(subject[:version]).to eq(Gitlab::VERSION)
160+
expect(subject[:installation_type]).to eq(Gitlab::INSTALLATION_TYPE)
159161
expect(subject[:active_user_count]).to eq(User.active.count)
160162
expect(subject[:recorded_at]).to be_a(Time)
161163
end

0 commit comments

Comments
 (0)