Commit c3226fe7 authored by Rubén Dávila's avatar Rubén Dávila

Merge branch 'add-license-id-to-usage-ping' into 'master'

Add license ID number to usage ping

See merge request gitlab-org/gitlab-ee!4679
parents e4322445 0e6d9d1a
...@@ -264,6 +264,10 @@ class License < ActiveRecord::Base ...@@ -264,6 +264,10 @@ class License < ActiveRecord::Base
features.include?(feature) features.include?(feature)
end end
def license_id
restricted_attr(:id)
end
def restricted_user_count def restricted_user_count
restricted_attr(:active_user_count) restricted_attr(:active_user_count)
end end
......
---
title: Add license ID number to usage ping
merge_request:
author:
type: changed
...@@ -32,6 +32,7 @@ module Gitlab ...@@ -32,6 +32,7 @@ module Gitlab
if license if license
usage_data[:license_md5] = license.md5 usage_data[:license_md5] = license.md5
usage_data[:license_id] = license.license_id
usage_data[:historical_max_users] = ::HistoricalData.max_historical_user_count usage_data[:historical_max_users] = ::HistoricalData.max_historical_user_count
usage_data[:licensee] = license.licensee usage_data[:licensee] = license.licensee
usage_data[:license_user_count] = license.restricted_user_count usage_data[:license_user_count] = license.restricted_user_count
......
...@@ -30,6 +30,7 @@ describe Gitlab::UsageData do ...@@ -30,6 +30,7 @@ describe Gitlab::UsageData do
license_trial license_trial
licensee licensee
license_md5 license_md5
license_id
recorded_at recorded_at
mattermost_enabled mattermost_enabled
edition edition
...@@ -160,6 +161,7 @@ describe Gitlab::UsageData do ...@@ -160,6 +161,7 @@ describe Gitlab::UsageData do
expect(subject[:uuid]).to eq(Gitlab::CurrentSettings.uuid) expect(subject[:uuid]).to eq(Gitlab::CurrentSettings.uuid)
expect(subject[:license_md5]).to eq(Digest::MD5.hexdigest(license.data)) expect(subject[:license_md5]).to eq(Digest::MD5.hexdigest(license.data))
expect(subject[:license_id]).to eq(license.license_id)
expect(subject[:version]).to eq(Gitlab::VERSION) expect(subject[:version]).to eq(Gitlab::VERSION)
expect(subject[:licensee]).to eq(license.licensee) expect(subject[:licensee]).to eq(license.licensee)
expect(subject[:active_user_count]).to eq(User.active.count) expect(subject[:active_user_count]).to eq(User.active.count)
......
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