From 94f4ac5cb39263b7fdeece85bcf696cfa22f1e59 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 19 Jul 2025 17:22:20 +0000 Subject: [PATCH] Update from merge request --- lib/api/internal/base.rb | 3 +-- lib/api/internal/shellhorse.rb | 1 + spec/requests/api/internal/base_spec.rb | 6 +++++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/api/internal/base.rb b/lib/api/internal/base.rb index d30de7ac1c4..69cd6a78089 100644 --- a/lib/api/internal/base.rb +++ b/lib/api/internal/base.rb @@ -99,8 +99,7 @@ module API gl_root_namespace_id: project&.root_namespace&.id, gl_id: Gitlab::GlId.gl_id(actor.user), gl_username: actor.username, - git_config_options: ["uploadpack.allowFilter=true", - "uploadpack.allowAnySHA1InWant=true"], + git_config_options: %w[uploadpack.allowFilter=true uploadpack.allowAnySHA1InWant=true], gitaly: gitaly_payload(params[:action]), gl_console_messages: check_result.console_messages, need_audit: need_git_audit_event? diff --git a/lib/api/internal/shellhorse.rb b/lib/api/internal/shellhorse.rb index e77742dfd91..958e428fffe 100644 --- a/lib/api/internal/shellhorse.rb +++ b/lib/api/internal/shellhorse.rb @@ -32,6 +32,7 @@ module API requires :action, type: String requires :protocol, type: String requires :gl_repository, type: String # repository identifier, such as project-7 + requires :changes, type: String optional :check_ip, type: String optional :packfile_stats, type: Hash do # wants is the number of objects the client announced it wants. diff --git a/spec/requests/api/internal/base_spec.rb b/spec/requests/api/internal/base_spec.rb index 50df8c380ae..0751d7ee59a 100644 --- a/spec/requests/api/internal/base_spec.rb +++ b/spec/requests/api/internal/base_spec.rb @@ -763,6 +763,10 @@ RSpec.describe API::Internal::Base, feature_category: :system_access do it 'does not send a git streaming audit event' do expect(::Gitlab::Audit::Auditor).not_to receive(:audit) + allow_next_instance_of(::Gitlab::GitAuditEvent) do |audit| + allow(audit).to receive(:enabled?).and_return(false) + end + pull(key, project) expect(response).to have_gitlab_http_status(:ok) @@ -784,7 +788,7 @@ RSpec.describe API::Internal::Base, feature_category: :system_access do expect(json_response["gl_root_namespace_id"]).to eq(project.root_namespace.id) expect(json_response["gl_key_type"]).to eq("key") expect(json_response["gl_key_id"]).to eq(key.id) - expect(json_response["need_audit"]).to be_falsy + expect(json_response["need_audit"]).to be_truthy expect(json_response["gitaly"]).not_to be_nil expect(json_response["gitaly"]["repository"]).not_to be_nil expect(json_response["gitaly"]["repository"]["storage_name"]).to eq(project.repository.gitaly_repository.storage_name)