diff options
author | Sami Hiltunen <shiltunen@gitlab.com> | 2023-07-28 19:43:28 +0300 |
---|---|---|
committer | Sami Hiltunen <shiltunen@gitlab.com> | 2023-09-26 20:10:28 +0300 |
commit | 4edd816483173fc31503c57c767f9b3e30ba5395 (patch) | |
tree | d1575d8e5f2ea51b95d8dfd61551c1427a20a3cf /cmd | |
parent | 8c1599b6468757739e4114f2e0e3ace212b34c86 (diff) |
Include transaction ID in the hook payload
The reference transaction hook needs the transaction ID in order
to stage the reference changes in the transaction. This commit
includes the transaction ID in the hook payload.
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/gitaly-hooks/hooks_test.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/gitaly-hooks/hooks_test.go b/cmd/gitaly-hooks/hooks_test.go index 1503e7077..c8886caac 100644 --- a/cmd/gitaly-hooks/hooks_test.go +++ b/cmd/gitaly-hooks/hooks_test.go @@ -22,6 +22,7 @@ import ( "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/config/prometheus" "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/service" "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/service/hook" + "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/storage" "gitlab.com/gitlab-org/gitaly/v16/internal/gitaly/transaction" "gitlab.com/gitlab-org/gitaly/v16/internal/gitlab" "gitlab.com/gitlab-org/gitaly/v16/internal/grpc/metadata" @@ -79,7 +80,11 @@ func envForHooks(tb testing.TB, ctx context.Context, cfg config.Cfg, repo *gital Username: glHookValues.GLUsername, Protocol: glHookValues.GLProtocol, RemoteIP: glHookValues.RemoteIP, - }, git.AllHooks, featureFlags(ctx)).Env() + }, + git.AllHooks, + featureFlags(ctx), + storage.ExtractTransactionID(ctx), + ).Env() require.NoError(tb, err) env := append(command.AllowedEnvironment(os.Environ()), []string{ @@ -453,6 +458,7 @@ func TestHooksPostReceiveFailed(t *testing.T) { }, git.PostReceiveHook, featureFlags(ctx), + storage.ExtractTransactionID(ctx), ).Env() require.NoError(t, err) @@ -557,6 +563,7 @@ func TestRequestedHooks(t *testing.T) { nil, git.AllHooks&^hook, nil, + 0, ).Env() require.NoError(t, err) @@ -579,6 +586,7 @@ func TestRequestedHooks(t *testing.T) { nil, hook, nil, + 0, ).Env() require.NoError(t, err) |