Skip to content

Resolve "RenameNamespace RPC appears not to be logging `From` and `To` parameters"

I think we're passing around a pointer to pb.RenameNamespaceRequest, instead of a struct literal.

This MR changes the FieldExtractor so it only handles the pointer. It would be easy to handle either, but I don't think it's necessary.

I also modify the test server so that the FieldExtractor is included in the set of middlewares. This allowed me to verify that the field extractor was working more easily. Output:

	test_hook.go:39: time="2018-07-31T17:56:00+01:00" level=info msg="finished unary call" grpc.code=OK grpc.method=RenameNamespace grpc.request.From=existing grpc.request.StorageName=default grpc.request.To=new-path grpc.service=gitaly.NamespaceService grpc.time_ms=0 peer.address=@ span.kind=server system=grpc test=TestRenameNamespace


	test_hook.go:39: time="2018-07-31T17:56:00+01:00" level=info msg="finished unary call" error="rpc error: code = InvalidArgument desc = from directory non-existing not found" grpc.code=InvalidArgument grpc.method=RenameNamespace grpc.request.From=non-existing grpc.request.StorageName=default grpc.request.To=new-path grpc.service=gitaly.NamespaceService grpc.time_ms=0 peer.address=@ span.kind=server system=grpc test=TestRenameNamespace

I also make use of the switch converted := foo.(type) idiom so we don't have to repeat type conversions in each type switch arm of the field extractor. This is a small readability improvement.

Closes #1302 (closed)

Edited by GitLab Release Tools Bot

Merge request reports