Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2022-06-03 17:37:46 +0300
committerJohn Cai <jcai@gitlab.com>2022-06-15 18:33:49 +0300
commit8171885cedaf3dda9648275ca27f34daf7af818f (patch)
tree434099eb278c7a9430676208e7e3f5e8063472ba
parent3db8440314039da24ee9af910e2115f3d1d57fdd (diff)
git: Change ReceiveHooksPayload to UserDetails
The ReceiveHooksPayload contains information like the UserID, Username, Protocol that would also be useful for UploadPack. Rename this to UserDetails to be more generic, so that we can share this in both places. However, in order to keep upgrades compatible, keep the ReceiveHooksPayload and the receive_hooks_payload json tag. During an upgrade, the gitaly-hooks binary will be replaced before the gitaly binary, so there will be a short period of time when an old gitaly will be sending to a newer gitaly-hooks. For this reason, we want to allow the newer gitaly-hooks to still recognize a receive_hooks_payload key.
-rw-r--r--cmd/gitaly-hooks/hooks_test.go4
-rw-r--r--internal/git/hooks_options.go12
-rw-r--r--internal/git/hooks_payload.go20
-rw-r--r--internal/git/hooks_payload_test.go4
-rw-r--r--internal/git/updateref/update_with_hooks.go2
-rw-r--r--internal/git/updateref/update_with_hooks_test.go2
-rw-r--r--internal/gitaly/hook/custom.go6
-rw-r--r--internal/gitaly/hook/postreceive.go6
-rw-r--r--internal/gitaly/hook/postreceive_test.go6
-rw-r--r--internal/gitaly/hook/prereceive.go18
-rw-r--r--internal/gitaly/hook/prereceive_test.go6
-rw-r--r--internal/gitaly/hook/transactions_test.go2
-rw-r--r--internal/gitaly/hook/update.go2
-rw-r--r--internal/gitaly/hook/update_test.go4
-rw-r--r--internal/gitaly/service/hook/post_receive_test.go4
-rw-r--r--internal/gitaly/service/hook/pre_receive_test.go8
-rw-r--r--internal/gitaly/service/hook/update_test.go2
-rw-r--r--internal/gitaly/service/smarthttp/receive_pack_test.go2
-rw-r--r--internal/gitaly/service/ssh/receive_pack_test.go2
-rw-r--r--ruby/lib/gitlab/git/hook.rb2
-rw-r--r--ruby/spec/lib/gitlab/git/hook_spec.rb2
21 files changed, 64 insertions, 52 deletions
diff --git a/cmd/gitaly-hooks/hooks_test.go b/cmd/gitaly-hooks/hooks_test.go
index be59445d2..9db2ea23f 100644
--- a/cmd/gitaly-hooks/hooks_test.go
+++ b/cmd/gitaly-hooks/hooks_test.go
@@ -58,7 +58,7 @@ func rawFeatureFlags(ctx context.Context) featureflag.Raw {
// envForHooks generates a set of environment variables for gitaly hooks
func envForHooks(t testing.TB, ctx context.Context, cfg config.Cfg, repo *gitalypb.Repository, glHookValues glHookValues, proxyValues proxyValues, gitPushOptions ...string) []string {
- payload, err := git.NewHooksPayload(cfg, repo, nil, &git.ReceiveHooksPayload{
+ payload, err := git.NewHooksPayload(cfg, repo, nil, &git.UserDetails{
UserID: glHookValues.GLID,
Username: glHookValues.GLUsername,
Protocol: glHookValues.GLProtocol,
@@ -407,7 +407,7 @@ func TestHooksPostReceiveFailed(t *testing.T) {
Node: "node",
Primary: tc.primary,
},
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: glID,
Username: glUsername,
Protocol: glProtocol,
diff --git a/internal/git/hooks_options.go b/internal/git/hooks_options.go
index f88fbd9ba..6c29a33e7 100644
--- a/internal/git/hooks_options.go
+++ b/internal/git/hooks_options.go
@@ -81,7 +81,7 @@ func (cc *cmdCfg) configureHooks(
repo *gitalypb.Repository,
cfg config.Cfg,
gitCmdFactory CommandFactory,
- receiveHooksPayload *ReceiveHooksPayload,
+ userDetails *UserDetails,
requestedHooks Hook,
) error {
if cc.hooksConfigured {
@@ -95,7 +95,13 @@ func (cc *cmdCfg) configureHooks(
return err
}
- payload, err := NewHooksPayload(cfg, repo, transaction, receiveHooksPayload, requestedHooks, featureflag.RawFromContext(ctx)).Env()
+ payload, err := NewHooksPayload(
+ cfg,
+ repo,
+ transaction,
+ userDetails,
+ requestedHooks,
+ featureflag.RawFromContext(ctx)).Env()
if err != nil {
return err
}
@@ -126,7 +132,7 @@ type ReceivePackRequest interface {
// git-receive-pack(1).
func WithReceivePackHooks(req ReceivePackRequest, protocol string) CmdOpt {
return func(ctx context.Context, cfg config.Cfg, gitCmdFactory CommandFactory, cc *cmdCfg) error {
- if err := cc.configureHooks(ctx, req.GetRepository(), cfg, gitCmdFactory, &ReceiveHooksPayload{
+ if err := cc.configureHooks(ctx, req.GetRepository(), cfg, gitCmdFactory, &UserDetails{
UserID: req.GetGlId(),
Username: req.GetGlUsername(),
Protocol: protocol,
diff --git a/internal/git/hooks_payload.go b/internal/git/hooks_payload.go
index 96e2758ee..f0185d495 100644
--- a/internal/git/hooks_payload.go
+++ b/internal/git/hooks_payload.go
@@ -71,15 +71,21 @@ type HooksPayload struct {
// it's not set, no transactional voting will happen.
Transaction *txinfo.Transaction `json:"transaction"`
- // ReceiveHooksPayload contains information required when executing
- // git-receive-pack.
- ReceiveHooksPayload *ReceiveHooksPayload `json:"receive_hooks_payload"`
+ // UserDetails contains information required when executing
+ // git-receive-pack or git-upload-pack
+ UserDetails *UserDetails `json:"user_details"`
+ // ReceiveHooksPayload should be identical to UserDetails.
+ // Since the git2go binary is replaced before the gitaly binary, there
+ // is a period of time during an upgrade when the gitaly binary is older
+ // than the corresponding git2go binary. So, we need to keep the
+ // receive_hooks_payload key for one release before we can remove it.
+ ReceiveHooksPayload *UserDetails `json:"receive_hooks_payload"`
}
-// ReceiveHooksPayload contains all information which is required for hooks
+// UserDetails contains all information which is required for hooks
// executed by git-receive-pack, namely the pre-receive, update or post-receive
// hook.
-type ReceiveHooksPayload struct {
+type UserDetails struct {
// Username contains the name of the user who has caused the hook to be executed.
Username string `json:"username"`
// UserID contains the ID of the user who has caused the hook to be executed.
@@ -102,7 +108,7 @@ func NewHooksPayload(
cfg config.Cfg,
repo *gitalypb.Repository,
tx *txinfo.Transaction,
- receiveHooksPayload *ReceiveHooksPayload,
+ userDetails *UserDetails,
requestedHooks Hook,
featureFlags featureflag.Raw,
) HooksPayload {
@@ -112,7 +118,7 @@ func NewHooksPayload(
InternalSocket: cfg.InternalSocketPath(),
InternalSocketToken: cfg.Auth.Token,
Transaction: tx,
- ReceiveHooksPayload: receiveHooksPayload,
+ UserDetails: userDetails,
RequestedHooks: requestedHooks,
FeatureFlags: featureFlags,
}
diff --git a/internal/git/hooks_payload_test.go b/internal/git/hooks_payload_test.go
index 1ed392636..b6220d656 100644
--- a/internal/git/hooks_payload_test.go
+++ b/internal/git/hooks_payload_test.go
@@ -75,7 +75,7 @@ func TestHooksPayload(t *testing.T) {
})
t.Run("receive hooks payload", func(t *testing.T) {
- env, err := git.NewHooksPayload(cfg, repo, nil, &git.ReceiveHooksPayload{
+ env, err := git.NewHooksPayload(cfg, repo, nil, &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "ssh",
@@ -95,7 +95,7 @@ func TestHooksPayload(t *testing.T) {
RuntimeDir: cfg.RuntimeDir,
InternalSocket: cfg.InternalSocketPath(),
InternalSocketToken: cfg.Auth.Token,
- ReceiveHooksPayload: &git.ReceiveHooksPayload{
+ UserDetails: &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "ssh",
diff --git a/internal/git/updateref/update_with_hooks.go b/internal/git/updateref/update_with_hooks.go
index 236036dbd..de4c7cb92 100644
--- a/internal/git/updateref/update_with_hooks.go
+++ b/internal/git/updateref/update_with_hooks.go
@@ -172,7 +172,7 @@ func (u *UpdaterWithHooks) UpdateReference(
changes := fmt.Sprintf("%s %s %s\n", oldrev, newrev, reference)
- receiveHooksPayload := git.ReceiveHooksPayload{
+ receiveHooksPayload := git.UserDetails{
UserID: user.GetGlId(),
Username: user.GetGlUsername(),
Protocol: "web",
diff --git a/internal/git/updateref/update_with_hooks_test.go b/internal/git/updateref/update_with_hooks_test.go
index ab5e5ca97..fa02c5069 100644
--- a/internal/git/updateref/update_with_hooks_test.go
+++ b/internal/git/updateref/update_with_hooks_test.go
@@ -110,7 +110,7 @@ func TestUpdaterWithHooks_UpdateReference(t *testing.T) {
oldRev := "1e292f8fedd741b75372e19097c76d327140c312"
- payload, err := git.NewHooksPayload(cfg, repo, nil, &git.ReceiveHooksPayload{
+ payload, err := git.NewHooksPayload(cfg, repo, nil, &git.UserDetails{
UserID: "1234",
Username: "Username",
Protocol: "web",
diff --git a/internal/gitaly/hook/custom.go b/internal/gitaly/hook/custom.go
index 8c1c6c4ec..327e014de 100644
--- a/internal/gitaly/hook/custom.go
+++ b/internal/gitaly/hook/custom.go
@@ -193,9 +193,9 @@ func (m *GitLabHookManager) customHooksEnv(ctx context.Context, payload git.Hook
"GIT_DIR="+repoPath,
"GL_REPOSITORY="+payload.Repo.GetGlRepository(),
"GL_PROJECT_PATH="+payload.Repo.GetGlProjectPath(),
- "GL_ID="+payload.ReceiveHooksPayload.UserID,
- "GL_USERNAME="+payload.ReceiveHooksPayload.Username,
- "GL_PROTOCOL="+payload.ReceiveHooksPayload.Protocol,
+ "GL_ID="+payload.UserDetails.UserID,
+ "GL_USERNAME="+payload.UserDetails.Username,
+ "GL_PROTOCOL="+payload.UserDetails.Protocol,
), nil
}
diff --git a/internal/gitaly/hook/postreceive.go b/internal/gitaly/hook/postreceive.go
index 2058baa4d..9ac6e041b 100644
--- a/internal/gitaly/hook/postreceive.go
+++ b/internal/gitaly/hook/postreceive.go
@@ -150,10 +150,10 @@ func (m *GitLabHookManager) postReceiveHook(ctx context.Context, payload git.Hoo
return helper.ErrInternalf("hook got no reference updates")
}
- if payload.ReceiveHooksPayload == nil {
+ if payload.UserDetails == nil {
return helper.ErrInternalf("payload has no receive hooks info")
}
- if payload.ReceiveHooksPayload.UserID == "" {
+ if payload.UserDetails.UserID == "" {
return helper.ErrInternalf("user ID not set")
}
if repo.GetGlRepository() == "" {
@@ -162,7 +162,7 @@ func (m *GitLabHookManager) postReceiveHook(ctx context.Context, payload git.Hoo
ok, messages, err := m.gitlabClient.PostReceive(
ctx, repo.GetGlRepository(),
- payload.ReceiveHooksPayload.UserID,
+ payload.UserDetails.UserID,
string(stdin),
pushOptions...,
)
diff --git a/internal/gitaly/hook/postreceive_test.go b/internal/gitaly/hook/postreceive_test.go
index 8fb8a377d..d8afe3ff5 100644
--- a/internal/gitaly/hook/postreceive_test.go
+++ b/internal/gitaly/hook/postreceive_test.go
@@ -75,7 +75,7 @@ func TestPostReceive_customHook(t *testing.T) {
t, gitlab.MockAllowed, gitlab.MockPreReceive, gitlab.MockPostReceive,
))
- receiveHooksPayload := &git.ReceiveHooksPayload{
+ receiveHooksPayload := &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
@@ -240,7 +240,7 @@ func (m *postreceiveAPIMock) PostReceive(ctx context.Context, glRepository, glID
func TestPostReceive_gitlab(t *testing.T) {
cfg, repo, repoPath := testcfg.BuildWithRepo(t)
- payload, err := git.NewHooksPayload(cfg, repo, nil, &git.ReceiveHooksPayload{
+ payload, err := git.NewHooksPayload(cfg, repo, nil, &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
@@ -381,7 +381,7 @@ func TestPostReceive_quarantine(t *testing.T) {
} {
t.Run(fmt.Sprintf("quarantined: %v", isQuarantined), func(t *testing.T) {
env, err := git.NewHooksPayload(cfg, repo, nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
diff --git a/internal/gitaly/hook/prereceive.go b/internal/gitaly/hook/prereceive.go
index c38b989cb..c6425b2c1 100644
--- a/internal/gitaly/hook/prereceive.go
+++ b/internal/gitaly/hook/prereceive.go
@@ -113,13 +113,13 @@ func (m *GitLabHookManager) preReceiveHook(ctx context.Context, payload git.Hook
if repo.GetGlRepository() == "" {
return helper.ErrInternalf("repository not set")
}
- if payload.ReceiveHooksPayload == nil {
+ if payload.UserDetails == nil {
return helper.ErrInternalf("payload has no receive hooks info")
}
- if payload.ReceiveHooksPayload.UserID == "" {
+ if payload.UserDetails.UserID == "" {
return helper.ErrInternalf("user ID not set")
}
- if payload.ReceiveHooksPayload.Protocol == "" {
+ if payload.UserDetails.Protocol == "" {
return helper.ErrInternalf("protocol not set")
}
@@ -128,8 +128,8 @@ func (m *GitLabHookManager) preReceiveHook(ctx context.Context, payload git.Hook
GitObjectDirectory: repo.GitObjectDirectory,
GitAlternateObjectDirectories: repo.GitAlternateObjectDirectories,
GLRepository: repo.GetGlRepository(),
- GLID: payload.ReceiveHooksPayload.UserID,
- GLProtocol: payload.ReceiveHooksPayload.Protocol,
+ GLID: payload.UserDetails.UserID,
+ GLProtocol: payload.UserDetails.Protocol,
Changes: string(changes),
}
@@ -143,8 +143,8 @@ func (m *GitLabHookManager) preReceiveHook(ctx context.Context, payload git.Hook
// changes in gitlab-shell first.
return NotAllowedError{
Message: err.Error(),
- UserID: payload.ReceiveHooksPayload.UserID,
- Protocol: payload.ReceiveHooksPayload.Protocol,
+ UserID: payload.UserDetails.UserID,
+ Protocol: payload.UserDetails.Protocol,
Changes: changes,
}
}
@@ -154,8 +154,8 @@ func (m *GitLabHookManager) preReceiveHook(ctx context.Context, payload git.Hook
if !allowed {
return NotAllowedError{
Message: message,
- UserID: payload.ReceiveHooksPayload.UserID,
- Protocol: payload.ReceiveHooksPayload.Protocol,
+ UserID: payload.UserDetails.UserID,
+ Protocol: payload.UserDetails.Protocol,
Changes: changes,
}
}
diff --git a/internal/gitaly/hook/prereceive_test.go b/internal/gitaly/hook/prereceive_test.go
index ff2bb4af2..12dc504bd 100644
--- a/internal/gitaly/hook/prereceive_test.go
+++ b/internal/gitaly/hook/prereceive_test.go
@@ -34,7 +34,7 @@ func TestPrereceive_customHooks(t *testing.T) {
t, gitlab.MockAllowed, gitlab.MockPreReceive, gitlab.MockPostReceive,
))
- receiveHooksPayload := &git.ReceiveHooksPayload{
+ receiveHooksPayload := &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
@@ -200,7 +200,7 @@ func TestPrereceive_quarantine(t *testing.T) {
} {
t.Run(fmt.Sprintf("quarantined: %v", isQuarantined), func(t *testing.T) {
env, err := git.NewHooksPayload(cfg, repo, nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
@@ -252,7 +252,7 @@ func (m *prereceiveAPIMock) PostReceive(context.Context, string, string, string,
func TestPrereceive_gitlab(t *testing.T) {
cfg, repo, repoPath := testcfg.BuildWithRepo(t)
- payload, err := git.NewHooksPayload(cfg, repo, nil, &git.ReceiveHooksPayload{
+ payload, err := git.NewHooksPayload(cfg, repo, nil, &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
diff --git a/internal/gitaly/hook/transactions_test.go b/internal/gitaly/hook/transactions_test.go
index 05373e05b..5c485983f 100644
--- a/internal/gitaly/hook/transactions_test.go
+++ b/internal/gitaly/hook/transactions_test.go
@@ -39,7 +39,7 @@ func TestHookManager_stopCalled(t *testing.T) {
cfg,
repo,
&expectedTx,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
diff --git a/internal/gitaly/hook/update.go b/internal/gitaly/hook/update.go
index c00da7e5b..564e1550a 100644
--- a/internal/gitaly/hook/update.go
+++ b/internal/gitaly/hook/update.go
@@ -45,7 +45,7 @@ func (m *GitLabHookManager) updateHook(ctx context.Context, payload git.HooksPay
if err := git.ValidateObjectID(newValue); err != nil {
return helper.ErrInternalf("hook got invalid new value: %w", err)
}
- if payload.ReceiveHooksPayload == nil {
+ if payload.UserDetails == nil {
return helper.ErrInternalf("payload has no receive hooks info")
}
diff --git a/internal/gitaly/hook/update_test.go b/internal/gitaly/hook/update_test.go
index f55f76eb8..464340861 100644
--- a/internal/gitaly/hook/update_test.go
+++ b/internal/gitaly/hook/update_test.go
@@ -31,7 +31,7 @@ func TestUpdate_customHooks(t *testing.T) {
t, gitlab.MockAllowed, gitlab.MockPreReceive, gitlab.MockPostReceive,
))
- receiveHooksPayload := &git.ReceiveHooksPayload{
+ receiveHooksPayload := &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
@@ -231,7 +231,7 @@ func TestUpdate_quarantine(t *testing.T) {
} {
t.Run(fmt.Sprintf("quarantined: %v", isQuarantined), func(t *testing.T) {
env, err := git.NewHooksPayload(cfg, repo, nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "1234",
Username: "user",
Protocol: "web",
diff --git a/internal/gitaly/service/hook/post_receive_test.go b/internal/gitaly/service/hook/post_receive_test.go
index 05fb94866..39b0aeb27 100644
--- a/internal/gitaly/service/hook/post_receive_test.go
+++ b/internal/gitaly/service/hook/post_receive_test.go
@@ -103,7 +103,7 @@ func TestHooksMissingStdin(t *testing.T) {
Node: "node-1",
Primary: tc.primary,
},
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "key_id",
Username: "username",
Protocol: "protocol",
@@ -231,7 +231,7 @@ To create a merge request for okay, visit:
cfg,
repo,
nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "key_id",
Username: "username",
Protocol: "protocol",
diff --git a/internal/gitaly/service/hook/pre_receive_test.go b/internal/gitaly/service/hook/pre_receive_test.go
index fb46709c7..34175bb46 100644
--- a/internal/gitaly/service/hook/pre_receive_test.go
+++ b/internal/gitaly/service/hook/pre_receive_test.go
@@ -143,7 +143,7 @@ func TestPreReceiveHook_GitlabAPIAccess(t *testing.T) {
cfg,
repo,
nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: glID,
Username: "username",
Protocol: protocol,
@@ -265,7 +265,7 @@ func TestPreReceive_APIErrors(t *testing.T) {
cfg,
repo,
nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "key-123",
Username: "username",
Protocol: "web",
@@ -339,7 +339,7 @@ exit %d
cfg,
repo,
nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "key-123",
Username: "username",
Protocol: "web",
@@ -472,7 +472,7 @@ func TestPreReceiveHook_Primary(t *testing.T) {
Node: "node-1",
Primary: tc.primary,
},
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "key-123",
Username: "username",
Protocol: "web",
diff --git a/internal/gitaly/service/hook/update_test.go b/internal/gitaly/service/hook/update_test.go
index b28a49cd8..98e30678c 100644
--- a/internal/gitaly/service/hook/update_test.go
+++ b/internal/gitaly/service/hook/update_test.go
@@ -41,7 +41,7 @@ func TestUpdate_CustomHooks(t *testing.T) {
cfg,
repo,
nil,
- &git.ReceiveHooksPayload{
+ &git.UserDetails{
UserID: "key-123",
Username: "username",
Protocol: "web",
diff --git a/internal/gitaly/service/smarthttp/receive_pack_test.go b/internal/gitaly/service/smarthttp/receive_pack_test.go
index 22ba8f62c..2be7e9dc9 100644
--- a/internal/gitaly/service/smarthttp/receive_pack_test.go
+++ b/internal/gitaly/service/smarthttp/receive_pack_test.go
@@ -106,7 +106,7 @@ func TestSuccessfulReceivePackRequest(t *testing.T) {
RuntimeDir: cfg.RuntimeDir,
InternalSocket: cfg.InternalSocketPath(),
InternalSocketToken: cfg.Auth.Token,
- ReceiveHooksPayload: &git.ReceiveHooksPayload{
+ UserDetails: &git.UserDetails{
UserID: "123",
Username: "user",
Protocol: "http",
diff --git a/internal/gitaly/service/ssh/receive_pack_test.go b/internal/gitaly/service/ssh/receive_pack_test.go
index 2158add1b..a7802461e 100644
--- a/internal/gitaly/service/ssh/receive_pack_test.go
+++ b/internal/gitaly/service/ssh/receive_pack_test.go
@@ -161,7 +161,7 @@ func TestReceivePackPushSuccess(t *testing.T) {
RuntimeDir: cfg.RuntimeDir,
InternalSocket: cfg.InternalSocketPath(),
InternalSocketToken: cfg.Auth.Token,
- ReceiveHooksPayload: &git.ReceiveHooksPayload{
+ UserDetails: &git.UserDetails{
UserID: "123",
Username: "user",
Protocol: "ssh",
diff --git a/ruby/lib/gitlab/git/hook.rb b/ruby/lib/gitlab/git/hook.rb
index 58c99503c..8084cd74c 100644
--- a/ruby/lib/gitlab/git/hook.rb
+++ b/ruby/lib/gitlab/git/hook.rb
@@ -116,7 +116,7 @@ module Gitlab
git_path: Gitlab.config.git.bin_path,
internal_socket: Gitlab.config.gitaly.internal_socket,
internal_socket_token: ENV['GITALY_TOKEN'],
- receive_hooks_payload: {
+ user_details: {
userid: gl_id,
username: gl_username,
protocol: GL_PROTOCOL
diff --git a/ruby/spec/lib/gitlab/git/hook_spec.rb b/ruby/spec/lib/gitlab/git/hook_spec.rb
index 4839407e0..1d5454728 100644
--- a/ruby/spec/lib/gitlab/git/hook_spec.rb
+++ b/ruby/spec/lib/gitlab/git/hook_spec.rb
@@ -44,7 +44,7 @@ describe Gitlab::Git::Hook do
git_path: Gitlab.config.git.bin_path,
internal_socket: Gitlab.config.gitaly.internal_socket,
internal_socket_token: nil,
- receive_hooks_payload: {
+ user_details: {
userid: 'user-123',
username: 'janedoe',
protocol: 'web'