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
90c1f1f2
Commit
90c1f1f2
authored
Mar 31, 2017
by
Stan Hu
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'feature/add-uuid-usage-ping' into 'master'
Add uuid to usage ping Closes #1894 See merge request !1521
parents
cf91b76a
4807fa3c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
2 deletions
+28
-2
changelogs/unreleased-ee/feature-add-uuid-usage-ping.yml
changelogs/unreleased-ee/feature-add-uuid-usage-ping.yml
+4
-0
db/migrate/20170328010804_add_uuid_to_application_settings.rb
...igrate/20170328010804_add_uuid_to_application_settings.rb
+16
-0
db/schema.rb
db/schema.rb
+2
-1
lib/gitlab/usage_data.rb
lib/gitlab/usage_data.rb
+4
-1
spec/lib/gitlab/usage_data_spec.rb
spec/lib/gitlab/usage_data_spec.rb
+2
-0
No files found.
changelogs/unreleased-ee/feature-add-uuid-usage-ping.yml
0 → 100644
View file @
90c1f1f2
---
title
:
Add uuid to usage ping
merge_request
:
author
:
db/migrate/20170328010804_add_uuid_to_application_settings.rb
0 → 100644
View file @
90c1f1f2
class
AddUuidToApplicationSettings
<
ActiveRecord
::
Migration
include
Gitlab
::
Database
::
MigrationHelpers
DOWNTIME
=
false
disable_ddl_transaction!
def
up
add_column
:application_settings
,
:uuid
,
:string
execute
(
"UPDATE application_settings SET uuid =
#{
quote
(
SecureRandom
.
uuid
)
}
"
)
end
def
down
remove_column
:application_settings
,
:uuid
end
end
db/schema.rb
View file @
90c1f1f2
...
...
@@ -11,7 +11,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord
::
Schema
.
define
(
version:
201703
1720355
4
)
do
ActiveRecord
::
Schema
.
define
(
version:
201703
2801080
4
)
do
# These are extensions that must be enabled in order to support this database
enable_extension
"plpgsql"
...
...
@@ -129,6 +129,7 @@ ActiveRecord::Schema.define(version: 20170317203554) do
t
.
string
"elasticsearch_aws_access_key"
t
.
string
"elasticsearch_aws_secret_access_key"
t
.
integer
"geo_status_timeout"
,
default:
10
t
.
string
"uuid"
end
create_table
"approvals"
,
force: :cascade
do
|
t
|
...
...
lib/gitlab/usage_data.rb
View file @
90c1f1f2
module
Gitlab
class
UsageData
include
Gitlab
::
CurrentSettings
class
<<
self
def
data
(
force_refresh:
false
)
Rails
.
cache
.
fetch
(
'usage_data'
,
force:
force_refresh
,
expires_in:
2
.
weeks
)
{
uncached_data
}
...
...
@@ -51,7 +53,8 @@ module Gitlab
end
def
license_usage_data
usage_data
=
{
version:
Gitlab
::
VERSION
,
usage_data
=
{
uuid:
current_application_settings
.
uuid
,
version:
Gitlab
::
VERSION
,
active_user_count:
User
.
active
.
count
,
mattermost_enabled:
Gitlab
.
config
.
mattermost
.
enabled
}
...
...
spec/lib/gitlab/usage_data_spec.rb
View file @
90c1f1f2
...
...
@@ -22,6 +22,7 @@ describe Gitlab::UsageData do
recorded_at
version
mattermost_enabled
uuid
)
)
end
...
...
@@ -72,6 +73,7 @@ describe Gitlab::UsageData do
it
"gathers license data"
do
license
=
::
License
.
current
expect
(
subject
[
:uuid
]).
to
eq
(
current_application_settings
.
uuid
)
expect
(
subject
[
:license_md5
]).
to
eq
(
Digest
::
MD5
.
hexdigest
(
license
.
data
))
expect
(
subject
[
:version
]).
to
eq
(
Gitlab
::
VERSION
)
expect
(
subject
[
:licensee
]).
to
eq
(
license
.
licensee
)
...
...
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