Unable to discover user data in update hook during push operation

Hi everyone,

I have custom hooks which validate specific rules based on name of the user who’s pushing code to the server. Before migrate to Gitlab 12, my hooks worked this way:

key_id    = ENV.delete('GL_ID')
require '/opt/gitlab/embedded/service/gitlab-shell/lib/gitlab_net'
api = GitlabNet.new
user = api.discover(key_id) # here I can get user['name'] 

After migrate to Gitlab 12, the GitlabNet class does not have the discover method anymore.

Is there another way to achieve this?


since there was a transition to Gitaly, you probably need to investigate over there.

I’d recommend adding your use case to this working issue:


Hi, @dnsmichi

@nick.thomas’s advice helped to solve the problem: https://gitlab.com/gitlab-org/gitaly/-/issues/2885#note_363945494

Thank you, guys.

1 Like