Browse Source

Add installation type to usage ping data

tags/v11.0.0-rc7
Balasankar C 1 year ago
parent
commit
9f76632d80
4 changed files with 5 additions and 0 deletions
  1. 1
    0
      INSTALLATION_TYPE
  2. 1
    0
      lib/gitlab.rb
  3. 1
    0
      lib/gitlab/usage_data.rb
  4. 2
    0
      spec/lib/gitlab/usage_data_spec.rb

+ 1
- 0
INSTALLATION_TYPE View File

@@ -0,0 +1 @@
1
+source

+ 1
- 0
lib/gitlab.rb View File

@@ -33,6 +33,7 @@ module Gitlab
33 33
   APP_DIRS_PATTERN = %r{^/?(app|config|ee|lib|spec|\(\w*\))}
34 34
   SUBDOMAIN_REGEX = %r{\Ahttps://[a-z0-9]+\.gitlab\.com\z}
35 35
   VERSION = File.read(root.join("VERSION")).strip.freeze
36
+  INSTALLATION_TYPE = File.read(root.join("INSTALLATION_TYPE")).strip.freeze
36 37
 
37 38
   def self.com?
38 39
     # Check `gl_subdomain?` as well to keep parity with gitlab.com

+ 1
- 0
lib/gitlab/usage_data.rb View File

@@ -21,6 +21,7 @@ module Gitlab
21 21
           uuid: Gitlab::CurrentSettings.uuid,
22 22
           hostname: Gitlab.config.gitlab.host,
23 23
           version: Gitlab::VERSION,
24
+          installation_type: Gitlab::INSTALLATION_TYPE,
24 25
           active_user_count: User.active.count,
25 26
           recorded_at: Time.now,
26 27
           mattermost_enabled: Gitlab.config.mattermost.enabled,

+ 2
- 0
spec/lib/gitlab/usage_data_spec.rb View File

@@ -32,6 +32,7 @@ describe Gitlab::UsageData do
32 32
         mattermost_enabled
33 33
         edition
34 34
         version
35
+        installation_type
35 36
         uuid
36 37
         hostname
37 38
         signup
@@ -156,6 +157,7 @@ describe Gitlab::UsageData do
156 157
     it "gathers license data" do
157 158
       expect(subject[:uuid]).to eq(Gitlab::CurrentSettings.uuid)
158 159
       expect(subject[:version]).to eq(Gitlab::VERSION)
160
+      expect(subject[:installation_type]).to eq(Gitlab::INSTALLATION_TYPE)
159 161
       expect(subject[:active_user_count]).to eq(User.active.count)
160 162
       expect(subject[:recorded_at]).to be_a(Time)
161 163
     end

Loading…
Cancel
Save