Commit 0e6d9d1a authored by Sean McGivern's avatar Sean McGivern

Add license ID number to usage ping

This can be used for more accurate matching than the MD5.
parent 84805b4e
......@@ -264,6 +264,10 @@ class License < ActiveRecord::Base
features.include?(feature)
end
def license_id
restricted_attr(:id)
end
def restricted_user_count
restricted_attr(:active_user_count)
end
......
---
title: Add license ID number to usage ping
merge_request:
author:
type: changed
......@@ -32,6 +32,7 @@ module Gitlab
if license
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[:licensee] = license.licensee
usage_data[:license_user_count] = license.restricted_user_count
......
......@@ -30,6 +30,7 @@ describe Gitlab::UsageData do
license_trial
licensee
license_md5
license_id
recorded_at
mattermost_enabled
edition
......@@ -160,6 +161,7 @@ describe Gitlab::UsageData do
expect(subject[:uuid]).to eq(Gitlab::CurrentSettings.uuid)
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[:licensee]).to eq(license.licensee)
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