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 @@
%fieldset
.form-group.row
.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
= f.label :elt_database_dump_enabled do
= f.check_box :elt_database_dump_enabled, disabled: !can_be_configured
Enable ELT Database Cron Job
= f.check_box :elt_database_dump_enabled, disabled: !is_available
Enable Meltano Database Cron Job
.form-text.text-muted
- if can_be_configured
GitLab will run a cron job which will send pseudoanonymized data to be processed and analyzed.
- if is_enabled
= meltano_elt_description_text
- 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"
......@@ -237,16 +237,17 @@
.settings-content
= render 'usage'
%section.settings.as-usage.no-animate#js-elt-database-dump-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('ELT Database Cron Job')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
= _('Enable or disable ELT Database Cron Job.')
.settings-content
= render 'elt_database_cron_job'
- if meltano_elt_database_dump_enabled?
%section.settings.as-usage.no-animate#js-elt-database-dump-settings{ class: ('expanded' if expanded) }
.settings-header
%h4
= _('Meltano ELT Database Cron Job')
%button.btn.btn-default.js-settings-toggle{ type: 'button' }
= expanded ? _('Collapse') : _('Expand')
%p
= _('Enable or disable Meltano ELT Database Cron Job.')
.settings-content
= render 'elt_database_cron_job'
%section.settings.as-email.no-animate#js-email-settings{ class: ('expanded' if expanded) }
.settings-header
......
......@@ -162,7 +162,7 @@ Settings.gitlab['import_sources'] ||= Gitlab::ImportSources.values
Settings.gitlab['trusted_proxies'] ||= []
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['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
......
......@@ -35,6 +35,22 @@ module EE
"and the value is encrypted at rest.")
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
def visible_attributes
super + [
......
......@@ -106,11 +106,15 @@ module EE
end
end
def elt_database_dump_available?
License.feature_available? :meltano_elt_database_dump
end
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
def elt_database_dump_enabled
def elt_database_dump_enabled?
elt_database_dump_can_be_configured? && super
end
......
......@@ -30,7 +30,8 @@ class License < ActiveRecord::Base
related_issues
repository_mirrors
repository_size_limit
scoped_issue_board
scoped_issue_board,
meltano_elt_database_dump
].freeze
EEP_FEATURES = EES_FEATURES + %i[
......
output:
csv: '/tmp/'
tables:
approvals:
whitelist:
......
......@@ -46,6 +46,10 @@ namespace :gitlab do
desc 'Configures the database by running migrate, or by loading the schema and seeding if needed'
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?
Rake::Task['db:migrate'].invoke
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