Skip to content

Improve error handling when namespace cannot be moved

What does this MR do?

@stanhu This MR slightly improves error handling when namespace cannot be renamed. It does not address https://gitlab.com/gitlab-org/gitlab-ee/issues/4553 fully as that would require a global refactoring and it's not strictly needed as the error can be found but it's not really easy. Geo::HashedStorageMigrationService calls Geo::MoveRepositoryService.new(project, old_disk_path, new_disk_path).execute which never raises an exception, it just returns boolean response. It's used in two places in the GitLab's codebase. Inside it calls gitlab_shell.mv_repository which also only returns boolean response. gitlab_shell.mv_repository is used in 17 places so if we need to change it, we need to refactor all those places. It's worth to say that lib/gitlab/shell.rb itself is not very consistent in a way it handles errors. Sometimes it just returns boolean status with no logs, sometimes it returns boolean + writes logs and sometimes it just raises errors. So if we touch it, we probably need to make other methods consistent too. Let me know what you think.

/cc @mkozono

What are the relevant issue numbers?

Does this MR meet the acceptance criteria?

Closes #4553 (closed)

Edited by Valery Sizov

Merge request reports