summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2014-12-02 13:04:39 +0000
committerJacob Vosmaer <jacob@gitlab.com>2014-12-02 13:04:39 +0000
commit2eafd494cf1a97a839a36e0bf4ecdc50ba3f44fe (patch)
tree062a90d0ffdd16fe1493428f1bc0106968bb2a8c
parent36679b577beb6a2ee181e15c67885c99b27fbdb8 (diff)
parentede9d47a8a25fe0e88579751b49509c114d7fd54 (diff)
downloadgitlab-ce-2eafd494cf1a97a839a36e0bf4ecdc50ba3f44fe.tar.gz
Merge branch 'release/7.5.2' into '7-5-stable'
Fixes for 7.5.2 See merge request !1283
-rw-r--r--CHANGELOG4
-rw-r--r--config/initializers/4_sidekiq.rb3
-rw-r--r--doc/development/README.md1
-rw-r--r--doc/sidekiq_debugging.md14
-rw-r--r--lib/backup/repository.rb10
5 files changed, 30 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 3734611e04c..fc21dd0466a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,10 @@
v 7.5.1
- Add missing timestamps to 'members' table
+v 7.5.2
+ - Don't log Sidekiq arguments by default
+ - Fix restore of wiki repositories from backups
+
v 7.5.0
- API: Add support for Hipchat (Kevin Houdebert)
- Add time zone configuration on gitlab.yml (Sullivan Senechal)
diff --git a/config/initializers/4_sidekiq.rb b/config/initializers/4_sidekiq.rb
index 228b14cb526..75c543c0f47 100644
--- a/config/initializers/4_sidekiq.rb
+++ b/config/initializers/4_sidekiq.rb
@@ -14,7 +14,8 @@ Sidekiq.configure_server do |config|
}
config.server_middleware do |chain|
- chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger
+ chain.add Gitlab::SidekiqMiddleware::ArgumentsLogger if ENV['SIDEKIQ_LOG_ARGUMENTS']
+ chain.add Gitlab::SidekiqMiddleware::MemoryKiller if ENV['SIDEKIQ_MAX_RSS']
end
end
diff --git a/doc/development/README.md b/doc/development/README.md
index 20db6662aca..c31e5d7ae97 100644
--- a/doc/development/README.md
+++ b/doc/development/README.md
@@ -4,3 +4,4 @@
- [Shell commands](shell_commands.md) in the GitLab codebase
- [Rake tasks](rake_tasks.md) for development
- [CI setup](ci_setup.md) for testing GitLab
+- [Sidekiq debugging](sidekiq_debugging.md)
diff --git a/doc/sidekiq_debugging.md b/doc/sidekiq_debugging.md
new file mode 100644
index 00000000000..cea11e5f126
--- /dev/null
+++ b/doc/sidekiq_debugging.md
@@ -0,0 +1,14 @@
+# Sidekiq debugging
+
+## Log arguments to Sidekiq jobs
+
+If you want to see what arguments are being passed to Sidekiq jobs you can set
+the SIDEKIQ_LOG_ARGUMENTS environment variable.
+
+```
+SIDEKIQ_LOG_ARGUMENTS=1 bundle exec foreman start
+```
+
+It is not recommend to enable this setting in production because some Sidekiq
+jobs (such as sending a password reset email) take secret arguments (for
+example the password reset token).
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index faa1b3b4099..665e228b18c 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -76,10 +76,18 @@ module Backup
if File.exists?(path_to_bundle(wiki))
print " * #{wiki.path_with_namespace} ... "
- if system(*%W(git clone --bare #{path_to_bundle(wiki)} #{path_to_repo(wiki)}), silent)
+
+ # If a wiki bundle exists, first remove the empty repo
+ # that was initialized with ProjectWiki.new() and then
+ # try to restore with 'git clone --bare'.
+ FileUtils.rm_rf(path_to_repo(wiki))
+ cmd = %W(git clone --bare #{path_to_bundle(wiki)} #{path_to_repo(wiki)})
+
+ if system(*cmd, silent)
puts " [DONE]".green
else
puts " [FAILED]".red
+ puts "failed: #{cmd.join(' ')}"
abort 'Restore failed'
end
end