diff options
Diffstat (limited to 'lib/gitlab/gitaly_client')
-rw-r--r-- | lib/gitlab/gitaly_client/commit_service.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/gitaly_client/conflicts_service.rb | 3 | ||||
-rw-r--r-- | lib/gitlab/gitaly_client/operation_service.rb | 26 | ||||
-rw-r--r-- | lib/gitlab/gitaly_client/storage_settings.rb | 5 |
4 files changed, 23 insertions, 14 deletions
diff --git a/lib/gitlab/gitaly_client/commit_service.rb b/lib/gitlab/gitaly_client/commit_service.rb index ea940150941..ef5221a8042 100644 --- a/lib/gitlab/gitaly_client/commit_service.rb +++ b/lib/gitlab/gitaly_client/commit_service.rb @@ -335,7 +335,8 @@ module Gitlab all: !!options[:all], first_parent: !!options[:first_parent], global_options: parse_global_options!(options), - disable_walk: true # This option is deprecated. The 'walk' implementation is being removed. + disable_walk: true, # This option is deprecated. The 'walk' implementation is being removed. + trailers: options[:trailers] ) request.after = GitalyClient.timestamp(options[:after]) if options[:after] request.before = GitalyClient.timestamp(options[:before]) if options[:before] diff --git a/lib/gitlab/gitaly_client/conflicts_service.rb b/lib/gitlab/gitaly_client/conflicts_service.rb index 6f08dcc69b6..fc40c23611a 100644 --- a/lib/gitlab/gitaly_client/conflicts_service.rb +++ b/lib/gitlab/gitaly_client/conflicts_service.rb @@ -67,7 +67,8 @@ module Gitlab source_branch: encode_binary(source_branch), target_branch: encode_binary(target_branch), commit_message: encode_binary(resolution.commit_message), - user: Gitlab::Git::User.from_gitlab(resolution.user).to_gitaly + user: Gitlab::Git::User.from_gitlab(resolution.user).to_gitaly, + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) end end diff --git a/lib/gitlab/gitaly_client/operation_service.rb b/lib/gitlab/gitaly_client/operation_service.rb index 4850d646de4..6f302b2c4e7 100644 --- a/lib/gitlab/gitaly_client/operation_service.rb +++ b/lib/gitlab/gitaly_client/operation_service.rb @@ -32,7 +32,8 @@ module Gitlab user: Gitlab::Git::User.from_gitlab(user).to_gitaly, tag_name: encode_binary(tag_name), target_revision: encode_binary(target), - message: encode_binary(message.to_s) + message: encode_binary(message.to_s), + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) response = GitalyClient.call(@repository.storage, :operation_service, :user_create_tag, request, timeout: GitalyClient.long_timeout) @@ -111,7 +112,8 @@ module Gitlab user: Gitlab::Git::User.from_gitlab(user).to_gitaly, message: encode_binary(message), first_parent_ref: encode_binary(first_parent_ref), - allow_conflicts: allow_conflicts + allow_conflicts: allow_conflicts, + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) response = GitalyClient.call(@repository.storage, :operation_service, @@ -140,7 +142,8 @@ module Gitlab user: Gitlab::Git::User.from_gitlab(user).to_gitaly, commit_id: source_sha, branch: encode_binary(target_branch), - message: encode_binary(message) + message: encode_binary(message), + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) ) @@ -234,7 +237,8 @@ module Gitlab branch_sha: branch_sha, remote_repository: remote_repository.gitaly_repository, remote_branch: encode_binary(remote_branch), - git_push_options: push_options + git_push_options: push_options, + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) ) ) @@ -255,7 +259,7 @@ module Gitlab request_enum.close end - def user_squash(user, squash_id, start_sha, end_sha, author, message) + def user_squash(user, squash_id, start_sha, end_sha, author, message, time = Time.now.utc) request = Gitaly::UserSquashRequest.new( repository: @gitaly_repo, user: Gitlab::Git::User.from_gitlab(user).to_gitaly, @@ -263,7 +267,8 @@ module Gitlab start_sha: start_sha, end_sha: end_sha, author: Gitlab::Git::User.from_gitlab(author).to_gitaly, - commit_message: encode_binary(message) + commit_message: encode_binary(message), + timestamp: Google::Protobuf::Timestamp.new(seconds: time.to_i) ) response = GitalyClient.call( @@ -288,7 +293,8 @@ module Gitlab commit_sha: commit_sha, branch: encode_binary(branch), submodule: encode_binary(submodule), - commit_message: encode_binary(message) + commit_message: encode_binary(message), + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) response = GitalyClient.call( @@ -357,7 +363,8 @@ module Gitlab header = Gitaly::UserApplyPatchRequest::Header.new( repository: @gitaly_repo, user: Gitlab::Git::User.from_gitlab(user).to_gitaly, - target_branch: encode_binary(branch_name) + target_branch: encode_binary(branch_name), + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) reader = binary_io(patches) @@ -446,7 +453,8 @@ module Gitlab start_branch_name: encode_binary(start_branch_name), start_repository: start_repository.gitaly_repository, force: force, - start_sha: encode_binary(start_sha) + start_sha: encode_binary(start_sha), + timestamp: Google::Protobuf::Timestamp.new(seconds: Time.now.utc.to_i) ) end # rubocop:enable Metrics/ParameterLists diff --git a/lib/gitlab/gitaly_client/storage_settings.rb b/lib/gitlab/gitaly_client/storage_settings.rb index 43848772947..5e50ac72965 100644 --- a/lib/gitlab/gitaly_client/storage_settings.rb +++ b/lib/gitlab/gitaly_client/storage_settings.rb @@ -23,7 +23,6 @@ module Gitlab MUTEX = Mutex.new - DISK_ACCESS_DENIED_FLAG = :deny_disk_access ALLOW_KEY = :allow_disk_access # If your code needs this method then your code needs to be fixed. @@ -34,7 +33,7 @@ module Gitlab def self.disk_access_denied? return false if rugged_enabled? - !temporarily_allowed?(ALLOW_KEY) && Feature::Gitaly.enabled?(DISK_ACCESS_DENIED_FLAG) + !temporarily_allowed?(ALLOW_KEY) rescue false # Err on the side of caution, don't break gitlab for people end @@ -62,7 +61,7 @@ module Gitlab def legacy_disk_path if self.class.disk_access_denied? - raise DirectPathAccessError, "git disk access denied via the gitaly_#{DISK_ACCESS_DENIED_FLAG} feature" + raise DirectPathAccessError, "git disk access denied" end @legacy_disk_path |