Fix target ref logging in merge commit error message
Cast the protobuf byte string to a string, otherwise the target_ref
value appears as a base64-encoded message.
Tested locally by hacking the OID to use 123456
:
{
"correlation_id": "01F9CXFS28H0NX6N9Z9FHP0T6J",
"error": "merge: ours commit lookup: lookup commit \"123456\": revspec '123456' not found\n",
"grpc.meta.auth_version": "v2",
"grpc.meta.client_name": "gitlab-web",
"grpc.meta.deadline_type": "regular",
"grpc.method": "UserMergeToRef",
"grpc.request.deadline": "2021-06-29T22:16:54.073Z",
"grpc.request.fullMethod": "/gitaly.OperationService/UserMergeToRef",
"grpc.request.glProjectPath": "root/test",
"grpc.request.glRepository": "project-41",
"grpc.request.repoPath": "@hashed/3d/91/3d914f9348c9cc0ff8a79716700b9fcd4d2f3e711608004eb8f138bcba7f14d9.git",
"grpc.request.repoStorage": "default",
"grpc.service": "gitaly.OperationService",
"grpc.start_time": "2021-06-29T22:15:59.173Z",
"level": "error",
"msg": "unable to create merge commit",
"peer.address": "@",
"pid": 20050,
"remote_ip": "X.X.X.X",
"source_sha": "7ea5effa2885dd284244ee0cfcd4c58cc01daf67",
"span.kind": "server",
"system": "grpc",
"target_ref": "refs/merge-requests/3/merge",
"target_sha": "2954282a035331ceec532dd8be5f044863e4f8e4",
"time": "2021-06-29T22:15:59.330Z",
"username": "root"
}
Edited by Stan Hu