summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2016-07-25 15:08:20 +0000
committerRémy Coutable <remy@rymai.me>2016-07-27 13:10:19 +0200
commit54b71febb29908f9d9077847036aebb64a727e82 (patch)
tree9bb9cef8ce362ed8751e2d17ec504e2c268a84c0
parentd258a522fba7ec6185ca655f0a5e44427efe511b (diff)
downloadgitlab-ce-54b71febb29908f9d9077847036aebb64a727e82.tar.gz
Merge branch 'fix-backup-restore' into 'master'
Fix backup restore ## What does this MR do? This MR fixes the backup restore task. ## Are there points in the code the reviewer needs to double check? Whether the mode 0277 makes sense. (Group SUID + group/user read/write permissions) ## Why was this MR needed? 86359ec8 broke this, and it was not caught by any specs. Users would see: ``` Restoring repositories ... rake aborted! NameError: undefined local variable or method `repos_path' for #<Backup::Repository:0x00000007cea1d8> /opt/gitlab/embedded/service/gitlab-rails/lib/backup/repository.rb:59:in `restore' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:79:in `block (4 levels) in <top (required)>' /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/backup.rake:54:in `block (3 levels) in <top (required)>' Tasks: TOP => gitlab:backup:repo:restore (See full trace by running task with --trace) ``` ## What are the relevant issue numbers? #20188 ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - Tests - [ ] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) See merge request !5459 Signed-off-by: Rémy Coutable <remy@rymai.me>
-rw-r--r--CHANGELOG2
-rw-r--r--lib/backup/repository.rb4
2 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG b/CHANGELOG
index 81253bd4fab..d00efa8dd91 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@ Please view this file on the master branch, on stable branches it's out of date.
v 8.10.2 (unreleased)
- User can now search branches by name. !5144
- Add branch or tag icon to ref in builds page. !5434
+ - Fix backup restore. !5459
- Don't show comment button in gutter of diffs on MR discussion tab
v 8.10.1
@@ -13,6 +14,7 @@ v 8.10.1
- Fix bug where replies to commit notes displayed in the MR discussion tab wouldn't show up on the commit page. !5446
- Ignore invalid trusted proxies in X-Forwarded-For header. !5454
- Add links to the real markdown.md file for all GFM examples. !5458
+ - Use project ID in repository cache to prevent stale data from persisting across projects
v 8.10.0
- Fix profile activity heatmap to show correct day name (eanplatter)
diff --git a/lib/backup/repository.rb b/lib/backup/repository.rb
index b9773f98d75..1f5917b8127 100644
--- a/lib/backup/repository.rb
+++ b/lib/backup/repository.rb
@@ -54,10 +54,10 @@ module Backup
# Move repos dir to 'repositories.old' dir
bk_repos_path = File.join(path, '..', 'repositories.old.' + Time.now.to_i.to_s)
FileUtils.mv(path, bk_repos_path)
+ # This is expected from gitlab:check
+ FileUtils.mkdir_p(path, mode: 2770)
end
- FileUtils.mkdir_p(repos_path)
-
Project.find_each(batch_size: 1000) do |project|
$progress.print " * #{project.path_with_namespace} ... "