diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-30 18:07:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-30 18:07:02 +0300 |
commit | 826cf5293fb78029f76c5e769696e3b37e681207 (patch) | |
tree | 703bc997b5fa36c42e2bd7486f000ad41b01d252 /lib/gitlab/workhorse.rb | |
parent | 7aa22e9a103b049dd2da70045a5822c51164f7db (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/workhorse.rb')
-rw-r--r-- | lib/gitlab/workhorse.rb | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/lib/gitlab/workhorse.rb b/lib/gitlab/workhorse.rb index fb3fbc80d24..02418c45e73 100644 --- a/lib/gitlab/workhorse.rb +++ b/lib/gitlab/workhorse.rb @@ -33,7 +33,7 @@ module Gitlab GitalyServer: { address: Gitlab::GitalyClient.address(repository.storage), token: Gitlab::GitalyClient.token(repository.storage), - features: Feature::Gitaly.server_feature_flags( + call_metadata: Feature::Gitaly.server_feature_flags( user: ::Feature::Gitaly.user_actor(user), repository: repository, project: ::Feature::Gitaly.project_actor(repository.container), @@ -48,14 +48,11 @@ module Gitlab attrs[:GitConfigOptions] << "receive.maxInputSize=#{receive_max_input_size.megabytes}" end - remote_ip = Gitlab::ApplicationContext.current_context_attribute(:remote_ip) - attrs[:RemoteIP] = remote_ip if remote_ip.present? - - attrs[:GitalyServer][:call_metadata] = attrs[:GitalyServer][:features].merge( + attrs[:GitalyServer][:call_metadata].merge!( 'user_id' => attrs[:GL_ID].presence, 'username' => attrs[:GL_USERNAME].presence, - 'remote_ip' => attrs[:RemoteIP] - ).compact + 'remote_ip' => Gitlab::ApplicationContext.current_context_attribute(:remote_ip).presence + ).compact! attrs end @@ -263,18 +260,15 @@ module Gitlab end def gitaly_server_hash(repository) - features = Feature::Gitaly.server_feature_flags( - user: ::Feature::Gitaly.user_actor, - repository: repository, - project: ::Feature::Gitaly.project_actor(repository.container), - group: ::Feature::Gitaly.group_actor(repository.container) - ) - { address: Gitlab::GitalyClient.address(repository.shard), token: Gitlab::GitalyClient.token(repository.shard), - features: features, - call_metadata: features + call_metadata: Feature::Gitaly.server_feature_flags( + user: ::Feature::Gitaly.user_actor, + repository: repository, + project: ::Feature::Gitaly.project_actor(repository.container), + group: ::Feature::Gitaly.group_actor(repository.container) + ) } end |