diff options
author | Igor Drozdov <idrozdov@gitlab.com> | 2020-07-31 12:58:42 +0000 |
---|---|---|
committer | Igor Drozdov <idrozdov@gitlab.com> | 2020-07-31 12:58:42 +0000 |
commit | e0a8b72bc3a9dbfcbe4d32be08f66efb12f24bcd (patch) | |
tree | 6a28feda2a62ec88e889593d7fbf3ae950659e35 /internal/command/receivepack | |
parent | 701ebca0b5d4a8451afe677c3bdb19cc92a5a2f0 (diff) | |
parent | 87402ed127d9855b8123e5e08a4c89d373cc79e8 (diff) | |
download | gitlab-shell-e0a8b72bc3a9dbfcbe4d32be08f66efb12f24bcd.tar.gz |
Merge branch 'sh-inject-and-log-correlation-di' into 'master'
Generate and log correlation IDs
See merge request gitlab-org/gitlab-shell!400
Diffstat (limited to 'internal/command/receivepack')
-rw-r--r-- | internal/command/receivepack/gitalycall.go | 4 | ||||
-rw-r--r-- | internal/command/receivepack/gitalycall_test.go | 1 |
2 files changed, 2 insertions, 3 deletions
diff --git a/internal/command/receivepack/gitalycall.go b/internal/command/receivepack/gitalycall.go index ffe0b6f..0754a3e 100644 --- a/internal/command/receivepack/gitalycall.go +++ b/internal/command/receivepack/gitalycall.go @@ -32,11 +32,9 @@ func (c *Command) performGitalyCall(response *accessverifier.Response) error { } return gc.RunGitalyCommand(func(ctx context.Context, conn *grpc.ClientConn) (int32, error) { - ctx, cancel := context.WithCancel(ctx) + ctx, cancel := gc.PrepareContext(ctx, request.Repository, response, request.GitProtocol) defer cancel() - gc.LogExecution(request.Repository, response, request.GitProtocol) - rw := c.ReadWriter return client.ReceivePack(ctx, conn, rw.In, rw.Out, rw.ErrOut, request) }) diff --git a/internal/command/receivepack/gitalycall_test.go b/internal/command/receivepack/gitalycall_test.go index df922d9..8bee484 100644 --- a/internal/command/receivepack/gitalycall_test.go +++ b/internal/command/receivepack/gitalycall_test.go @@ -56,4 +56,5 @@ func TestReceivePack(t *testing.T) { require.Contains(t, entries[1].Message, "remote_ip=127.0.0.1") require.Contains(t, entries[1].Message, "gl_key_type=key") require.Contains(t, entries[1].Message, "gl_key_id=123") + require.Contains(t, entries[1].Message, "correlation_id=") } |