Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
33e969db
Commit
33e969db
authored
Apr 22, 2020
by
James Fargher
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Capture all errors when updating repository storage
parent
f0284ee0
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
3 deletions
+13
-3
app/services/projects/update_repository_storage_service.rb
app/services/projects/update_repository_storage_service.rb
+3
-3
changelogs/unreleased/shard_move_capture_all_errors.yml
changelogs/unreleased/shard_move_capture_all_errors.yml
+5
-0
ee/spec/services/projects/update_repository_storage_service_spec.rb
...rvices/projects/update_repository_storage_service_spec.rb
+4
-0
spec/services/projects/update_repository_storage_service_spec.rb
...rvices/projects/update_repository_storage_service_spec.rb
+1
-0
No files found.
app/services/projects/update_repository_storage_service.rb
View file @
33e969db
...
...
@@ -18,7 +18,7 @@ module Projects
mark_old_paths_for_archive
project
.
update
(
repository_storage:
new_repository_storage_key
,
repository_read_only:
false
)
project
.
update
!
(
repository_storage:
new_repository_storage_key
,
repository_read_only:
false
)
project
.
leave_pool_repository
project
.
track_project_repository
...
...
@@ -26,8 +26,8 @@ module Projects
success
rescue
Error
,
ArgumentError
,
Gitlab
::
Git
::
Base
Error
=>
e
project
.
update
(
repository_read_only:
false
)
rescue
Standard
Error
=>
e
project
.
update
!
(
repository_read_only:
false
)
Gitlab
::
ErrorTracking
.
track_exception
(
e
,
project_path:
project
.
full_path
)
...
...
changelogs/unreleased/shard_move_capture_all_errors.yml
0 → 100644
View file @
33e969db
---
title
:
Capture all errors when updating repository storage
merge_request
:
30119
author
:
type
:
fixed
ee/spec/services/projects/update_repository_storage_service_spec.rb
View file @
33e969db
...
...
@@ -7,6 +7,10 @@ describe Projects::UpdateRepositoryStorageService do
subject
{
described_class
.
new
(
project
)
}
before
do
allow
(
Gitlab
.
config
.
repositories
.
storages
).
to
receive
(
:keys
).
and_return
(
%w[default test_second_storage]
)
end
describe
"#execute"
do
context
'with design repository'
do
include_examples
'moves repository to another storage'
,
'design'
do
...
...
spec/services/projects/update_repository_storage_service_spec.rb
View file @
33e969db
...
...
@@ -12,6 +12,7 @@ describe Projects::UpdateRepositoryStorageService do
before
do
allow
(
Time
).
to
receive
(
:now
).
and_return
(
time
)
allow
(
Gitlab
.
config
.
repositories
.
storages
).
to
receive
(
:keys
).
and_return
(
%w[default test_second_storage]
)
end
context
'without wiki and design repository'
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment