Commit 56672d4a authored by Micaël Bergeron's avatar Micaël Bergeron

apply feedback

parent 521e3a7a
......@@ -374,4 +374,4 @@
.settings-content
= render partial: 'slack'
= render_if_exists 'pseudonymizer_settings'
= render_if_exists 'admin/application_settings/pseudonymizer_settings', expanded: expanded
......@@ -40,11 +40,11 @@ module EE
end
def pseudonymizer_description_text
_("GitLab will run the pseudonymizer data collection which will output pseudonymized data to be processed and analyzed.")
_("GitLab will run a background job that will produce pseudonymized CSVs of the GitLab database that will be uploaded to your configured object storage directory.")
end
def pseudonymizer_disabled_description_text
_("The pseudonymizer data collection is disabled. When enabled, it will send pseudonymized data to be processed and analyzed.")
_("The pseudonymizer data collection is disabled. When enabled, GitLab will run a background job that will produce pseudonymized CSVs of the GitLab database that will be uploaded to your configured object storage directory.")
end
override :visible_attributes
......
......@@ -3,15 +3,7 @@ class PseudonymizerWorker
include CronjobQueue
def perform
unless License.feature_available?(:pseudonymizer)
Rails.logger.warn("The pseudonymizer is not available with this license.")
return
end
unless Gitlab::CurrentSettings.pseudonymizer_enabled?
Rails.logger.info("The pseudonymizer is disabled.")
return
end
return unless Gitlab::CurrentSettings.pseudonymizer_enabled?
options = Pseudonymizer::Options.new(
config: YAML.load_file(Gitlab.config.pseudonymizer.manifest),
......
......@@ -29,7 +29,7 @@ module Pseudonymizer
ORDER BY id
LIMIT #{PAGE_SIZE}
SQL
Rails.logger.debug("#{self.class.name} fetch ids [#{id_offset}, +#{PAGE_SIZE}[")
Rails.logger.debug("#{self.class.name} fetch ids [#{id_offset}..+#{PAGE_SIZE}]")
break if results.empty?
id_offset = results.last["id"].to_i
......@@ -50,7 +50,7 @@ module Pseudonymizer
ORDER BY #{@columns.join(",")}
LIMIT #{PAGE_SIZE} OFFSET #{offset}
SQL
Rails.logger.debug("#{self.class.name} fetching offset [#{offset}, #{offset + PAGE_SIZE}[")
Rails.logger.debug("#{self.class.name} fetching offset [#{offset}..#{offset + PAGE_SIZE}]")
break if results.empty?
offset += PAGE_SIZE
......
......@@ -37,7 +37,7 @@ module Pseudonymizer
upload_file(file, remote_directory)
end
rescue ObjectStorageUnavailableError
abort "Cannot upload files, make sure the `pseudonimizer.upload.connection` is set properly".color(:red)
abort "Cannot upload files, make sure the `pseudonimizer.upload.connection` is set properly"
end
def cleanup
......@@ -45,9 +45,9 @@ module Pseudonymizer
progress_output.print "Deleting tmp directory #{@output_dir} ... "
FileUtils.rm_rf(@output_dir)
progress_output.puts "done".color(:green)
progress_output.puts "done"
rescue
progress_output.puts "failed".color(:red)
progress_output.puts "failed"
end
private
......@@ -60,9 +60,9 @@ module Pseudonymizer
if directory.files.create(key: File.join(@upload_dir, File.basename(file)),
body: File.open(file),
public: false)
progress_output.puts "done".color(:green)
progress_output.puts "done"
else
progress_output.puts "failed".color(:red)
progress_output.puts "failed"
end
end
......
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