Convert UserSquash to use structured errors
UserSquash is not currently returning errors in a subset of error conditions:
- When resolving the start or end revision fails.
- When the rebase has failed, e.g. due to a conflict.
- When updating the target reference has failed, e.g. due to a race.
This makes us blind SLI-wise, but more importantly it is breaking assumptions in Gitaly Cluster because we return successfully, but did not cast a vote on the transaction. As a result, we'll create replication jobs even in the case where there is nothing that needs to be replicated.
We need to restructure the RPC to fix those edge cases and return proper errors in those cases. We should handle this migration the same as we handled the upgrade for UserMergeBranch and use structured errors such that Rails can exactly pinpoint why the RPC has failed.
Edited by Patrick Steinhardt