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
0f52db38
Commit
0f52db38
authored
Jun 01, 2018
by
Jacob Schatz
Committed by
Micaël Bergeron
Jun 22, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated based on feedback.
parent
1595907a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
50 additions
and
22 deletions
+50
-22
app/views/admin/application_settings/_elt_database_cron_job.html.haml
...min/application_settings/_elt_database_cron_job.html.haml
+10
-6
app/views/admin/application_settings/show.html.haml
app/views/admin/application_settings/show.html.haml
+11
-10
config/initializers/1_settings.rb
config/initializers/1_settings.rb
+1
-1
ee/app/helpers/ee/application_settings_helper.rb
ee/app/helpers/ee/application_settings_helper.rb
+16
-0
ee/app/models/ee/application_setting.rb
ee/app/models/ee/application_setting.rb
+6
-2
ee/app/models/license.rb
ee/app/models/license.rb
+2
-1
ee/lib/assets/pseudonymity_dump.yml
ee/lib/assets/pseudonymity_dump.yml
+0
-2
lib/tasks/gitlab/db.rake
lib/tasks/gitlab/db.rake
+4
-0
No files found.
app/views/admin/application_settings/_elt_database_cron_job.html.haml
View file @
0f52db38
...
@@ -4,16 +4,20 @@
...
@@ -4,16 +4,20 @@
%fieldset
%fieldset
.form-group.row
.form-group.row
.offset-sm-2.col-sm-10
.offset-sm-2.col-sm-10
-
can_be_configured
=
@application_setting
.
elt_database_dump_can_be_configured?
-
is_enabled
=
@application_setting
.
elt_database_dump_enabled?
-
is_available
=
@application_setting
.
elt_database_dump_available?
.form-check
.form-check
=
f
.
label
:elt_database_dump_enabled
do
=
f
.
label
:elt_database_dump_enabled
do
=
f
.
check_box
:elt_database_dump_enabled
,
disabled:
!
can_be_configured
=
f
.
check_box
:elt_database_dump_enabled
,
disabled:
!
is_available
Enable
ELT
Database Cron Job
Enable
Meltano
Database Cron Job
.form-text.text-muted
.form-text.text-muted
-
if
can_be_configur
ed
-
if
is_enabl
ed
GitLab will run a cron job which will send pseudoanonymized data to be processed and analyzed.
=
meltano_elt_description_text
-
else
-
else
The ELT database cron job is disabled. When enabled the cron job will send pseudoanonymized data to be processed and analyzed.
-
if
is_available
=
meltano_elt_disabled_description_text
-
else
=
meltano_elt_unavailable_description_text
=
f
.
submit
'Save changes'
,
class:
"btn btn-success"
=
f
.
submit
'Save changes'
,
class:
"btn btn-success"
app/views/admin/application_settings/show.html.haml
View file @
0f52db38
...
@@ -237,14 +237,15 @@
...
@@ -237,14 +237,15 @@
.settings-content
.settings-content
=
render
'usage'
=
render
'usage'
%section
.settings.as-usage.no-animate
#js-elt-database-dump-settings
{
class:
(
'expanded'
if
expanded
)
}
-
if
meltano_elt_database_dump_enabled?
%section
.settings.as-usage.no-animate
#js-elt-database-dump-settings
{
class:
(
'expanded'
if
expanded
)
}
.settings-header
.settings-header
%h4
%h4
=
_
(
'
ELT Database Cron Job'
)
=
_
(
'Meltano
ELT Database Cron Job'
)
%button
.btn.btn-default.js-settings-toggle
{
type:
'button'
}
%button
.btn.btn-default.js-settings-toggle
{
type:
'button'
}
=
expanded
?
_
(
'Collapse'
)
:
_
(
'Expand'
)
=
expanded
?
_
(
'Collapse'
)
:
_
(
'Expand'
)
%p
%p
=
_
(
'Enable or disable
ELT Database Cron Job.'
)
=
_
(
'Enable or disable Meltano
ELT Database Cron Job.'
)
.settings-content
.settings-content
=
render
'elt_database_cron_job'
=
render
'elt_database_cron_job'
...
...
config/initializers/1_settings.rb
View file @
0f52db38
...
@@ -162,7 +162,7 @@ Settings.gitlab['import_sources'] ||= Gitlab::ImportSources.values
...
@@ -162,7 +162,7 @@ Settings.gitlab['import_sources'] ||= Gitlab::ImportSources.values
Settings
.
gitlab
[
'trusted_proxies'
]
||=
[]
Settings
.
gitlab
[
'trusted_proxies'
]
||=
[]
Settings
.
gitlab
[
'no_todos_messages'
]
||=
YAML
.
load_file
(
Rails
.
root
.
join
(
'config'
,
'no_todos_messages.yml'
))
Settings
.
gitlab
[
'no_todos_messages'
]
||=
YAML
.
load_file
(
Rails
.
root
.
join
(
'config'
,
'no_todos_messages.yml'
))
Settings
.
gitlab
[
'usage_ping_enabled'
]
=
true
if
Settings
.
gitlab
[
'usage_ping_enabled'
].
nil?
Settings
.
gitlab
[
'usage_ping_enabled'
]
=
true
if
Settings
.
gitlab
[
'usage_ping_enabled'
].
nil?
Settings
.
gitlab
[
'elt_database_dump_enabled'
]
=
tru
e
if
Settings
.
gitlab
[
'elt_database_dump_enabled'
].
nil?
Settings
.
gitlab
[
'elt_database_dump_enabled'
]
=
fals
e
if
Settings
.
gitlab
[
'elt_database_dump_enabled'
].
nil?
#
#
# Elasticseacrh
# Elasticseacrh
...
...
ee/app/helpers/ee/application_settings_helper.rb
View file @
0f52db38
...
@@ -35,6 +35,22 @@ module EE
...
@@ -35,6 +35,22 @@ module EE
"and the value is encrypted at rest."
)
"and the value is encrypted at rest."
)
end
end
def
meltano_elt_database_dump_enabled?
return
License
.
feature_available?
:meltano_elt_database_dump
end
def
meltano_elt_description_text
_
(
"GitLab will run the Meltano ELT cron job which will send pseudoanonymized data to be processed and analyzed."
)
end
def
meltano_elt_disabled_description_text
_
(
"The Meltano ELT database cron job is disabled. When enabled the cron job will send pseudoanonymized data to be processed and analyzed."
)
end
def
meltano_elt_unavailable_description_text
_
(
"The Meltano ELT database cron job is disabled. Once enabled, the cron job will send pseudoanonymized data to be processed and analyzed."
)
end
override
:visible_attributes
override
:visible_attributes
def
visible_attributes
def
visible_attributes
super
+
[
super
+
[
...
...
ee/app/models/ee/application_setting.rb
View file @
0f52db38
...
@@ -106,11 +106,15 @@ module EE
...
@@ -106,11 +106,15 @@ module EE
end
end
end
end
def
elt_database_dump_available?
License
.
feature_available?
:meltano_elt_database_dump
end
def
elt_database_dump_can_be_configured?
def
elt_database_dump_can_be_configured?
Settings
.
gitlab
.
elt_database_dump_enabled
Settings
.
gitlab
.
elt_database_dump_enabled
&&
License
.
feature_available?
(
:meltano_elt_database_dump
)
end
end
def
elt_database_dump_enabled
def
elt_database_dump_enabled
?
elt_database_dump_can_be_configured?
&&
super
elt_database_dump_can_be_configured?
&&
super
end
end
...
...
ee/app/models/license.rb
View file @
0f52db38
...
@@ -30,7 +30,8 @@ class License < ActiveRecord::Base
...
@@ -30,7 +30,8 @@ class License < ActiveRecord::Base
related_issues
related_issues
repository_mirrors
repository_mirrors
repository_size_limit
repository_size_limit
scoped_issue_board
scoped_issue_board,
meltano_elt_database_dump
]
.
freeze
]
.
freeze
EEP_FEATURES
=
EES_FEATURES
+
%i[
EEP_FEATURES
=
EES_FEATURES
+
%i[
...
...
ee/lib/assets/pseudonymity_dump.yml
View file @
0f52db38
output
:
csv
:
'
/tmp/'
tables
:
tables
:
approvals
:
approvals
:
whitelist
:
whitelist
:
...
...
lib/tasks/gitlab/db.rake
View file @
0f52db38
...
@@ -46,6 +46,10 @@ namespace :gitlab do
...
@@ -46,6 +46,10 @@ namespace :gitlab do
desc
'Configures the database by running migrate, or by loading the schema and seeding if needed'
desc
'Configures the database by running migrate, or by loading the schema and seeding if needed'
task
configure: :environment
do
task
configure: :environment
do
unless
License
.
feature_available?
:meltano_elt_database_dump
raise
"The Meltano ELT extract is not available with this license."
end
if
ActiveRecord
::
Base
.
connection
.
tables
.
any?
if
ActiveRecord
::
Base
.
connection
.
tables
.
any?
Rake
::
Task
[
'db:migrate'
].
invoke
Rake
::
Task
[
'db:migrate'
].
invoke
else
else
...
...
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