Skip to content

operations: Return proper error codes from UserMergeBranch

Patrick Steinhardt requested to merge pks-operations-merge-errors into master

When updating the target reference fails in the UserMergeBranch RPC, then we return an error which is embedded in the response message instead of returning a proper gRPC error with an error code. This behaviour was ported over from the old Ruby implementation, but it's not considered good practice. What makes the problem worse though is that in case git-update-ref(1) fails because of a racy update, then we neither return a gRPC error nor do we set an error message in the response. As a result, the caller can only discern this case by checking whether the response is empty.

Fix this issue by returning proper error codes in all cases and deprecating the in-struct error message.

Fixes #3582 (closed)

Edited by Patrick Steinhardt

Merge request reports