Commit 0f52db38 authored by Jacob Schatz's avatar Jacob Schatz Committed by Micaël Bergeron

Updated based on feedback.

parent 1595907a
...@@ -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_configured - if is_enabled
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"
...@@ -237,16 +237,17 @@ ...@@ -237,16 +237,17 @@
.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?
.settings-header %section.settings.as-usage.no-animate#js-elt-database-dump-settings{ class: ('expanded' if expanded) }
%h4 .settings-header
= _('ELT Database Cron Job') %h4
%button.btn.btn-default.js-settings-toggle{ type: 'button' } = _('Meltano ELT Database Cron Job')
= expanded ? _('Collapse') : _('Expand') %button.btn.btn-default.js-settings-toggle{ type: 'button' }
%p = expanded ? _('Collapse') : _('Expand')
= _('Enable or disable ELT Database Cron Job.') %p
.settings-content = _('Enable or disable Meltano ELT Database Cron Job.')
= render 'elt_database_cron_job' .settings-content
= render 'elt_database_cron_job'
%section.settings.as-email.no-animate#js-email-settings{ class: ('expanded' if expanded) } %section.settings.as-email.no-animate#js-email-settings{ class: ('expanded' if expanded) }
.settings-header .settings-header
......
...@@ -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'] = true if Settings.gitlab['elt_database_dump_enabled'].nil? Settings.gitlab['elt_database_dump_enabled'] = false if Settings.gitlab['elt_database_dump_enabled'].nil?
# #
# Elasticseacrh # Elasticseacrh
......
...@@ -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 + [
......
...@@ -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
......
...@@ -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[
......
output:
csv: '/tmp/'
tables: tables:
approvals: approvals:
whitelist: whitelist:
......
...@@ -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
......
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