Commit 206f0c4d authored by Dmytro Zaporozhets's avatar Dmytro Zaporozhets

Merge branch 'shard_move_capture_all_errors' into 'master'

Capture all errors when updating repository storage

See merge request gitlab-org/gitlab!30119
parents 6a8fc5a7 33e969db
...@@ -18,7 +18,7 @@ module Projects ...@@ -18,7 +18,7 @@ module Projects
mark_old_paths_for_archive 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.leave_pool_repository
project.track_project_repository project.track_project_repository
...@@ -26,8 +26,8 @@ module Projects ...@@ -26,8 +26,8 @@ module Projects
success success
rescue Error, ArgumentError, Gitlab::Git::BaseError => e rescue StandardError => e
project.update(repository_read_only: false) project.update!(repository_read_only: false)
Gitlab::ErrorTracking.track_exception(e, project_path: project.full_path) Gitlab::ErrorTracking.track_exception(e, project_path: project.full_path)
......
---
title: Capture all errors when updating repository storage
merge_request: 30119
author:
type: fixed
...@@ -7,6 +7,10 @@ describe Projects::UpdateRepositoryStorageService do ...@@ -7,6 +7,10 @@ describe Projects::UpdateRepositoryStorageService do
subject { described_class.new(project) } 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 describe "#execute" do
context 'with design repository' do context 'with design repository' do
include_examples 'moves repository to another storage', 'design' do include_examples 'moves repository to another storage', 'design' do
......
...@@ -12,6 +12,7 @@ describe Projects::UpdateRepositoryStorageService do ...@@ -12,6 +12,7 @@ describe Projects::UpdateRepositoryStorageService do
before do before do
allow(Time).to receive(:now).and_return(time) allow(Time).to receive(:now).and_return(time)
allow(Gitlab.config.repositories.storages).to receive(:keys).and_return(%w[default test_second_storage])
end end
context 'without wiki and design repository' do context 'without wiki and design repository' do
......
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