Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0e6d9d1a
Commit
0e6d9d1a
authored
Feb 22, 2018
by
Sean McGivern
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add license ID number to usage ping
This can be used for more accurate matching than the MD5.
parent
84805b4e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
12 additions
and
0 deletions
+12
-0
ee/app/models/license.rb
ee/app/models/license.rb
+4
-0
ee/changelogs/unreleased/add-license-id-to-usage-ping.yml
ee/changelogs/unreleased/add-license-id-to-usage-ping.yml
+5
-0
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+1
-0
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+2
-0
No files found.
ee/app/models/license.rb
View file @
0e6d9d1a
...
...
@@ -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
...
...
ee/changelogs/unreleased/add-license-id-to-usage-ping.yml
0 → 100644
View file @
0e6d9d1a
---
title
:
Add license ID number to usage ping
merge_request
:
author
:
type
:
changed
lib/gitlab/usage_data.rb
View file @
0e6d9d1a
...
...
@@ -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
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
0e6d9d1a
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment