Skip to content

gitaly: Adapt to structured errors returned by UserRebaseConfirmable

John Cai requested to merge jc-user-rebase-confirmable-structured-errors into master

What does this MR do and why?

Gitaly is in the process of migrating UserSquash to use detailed errors like we already do for UserMergeBranch and UserSquash. This change will break the current calling convention, where Gitaly will return some errors by returning successfully, but with an git_error field set in the response. Instead, Gitaly will return a proper error for all conditions but give clients the ability to distinguish error cases via error details.

Prepare UserRebaseConfirmable for this change by handling those new error details. Theoretically, this allows us to implement more fine-grained handling of these errors now: AccessCheck contain an error from Gitaly calling the Gitlab API, and MergeConflictErrors contain information about the files that have been conflicting. To ease the transition though we're treating those errors exactly the same as we did previously, where we raised a PreReceiveError when there was a error during pre_receive and GitError otherwise. We can still iterate on this at a later point.

The end result should be that there is no real user-visible change in how we handle UserRebaseConfirmable.

MR acceptance checklist

This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.

Merge request reports