From bb0daa33cd93eeffb230689d1daacd737f61b2e7 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Fri, 5 Jul 2024 15:22:03 +0800 Subject: [PATCH] DEV: Remove `git_version` from `DiscourseLogstashLogger` log event (#27730) In our official Docker image, running git commands results in the following error: ``` fatal: detected dubious ownership in repository at '/var/www/discourse' To add an exception for this directory, call: git config --global --add safe.directory /var/www/discourse ``` --- lib/discourse_logstash_logger.rb | 3 --- spec/lib/discourse_logstash_logger_spec.rb | 1 - 2 files changed, 4 deletions(-) diff --git a/lib/discourse_logstash_logger.rb b/lib/discourse_logstash_logger.rb index df435d3799b..550ae3b82c4 100644 --- a/lib/discourse_logstash_logger.rb +++ b/lib/discourse_logstash_logger.rb @@ -2,12 +2,10 @@ require "json" require "socket" -require_relative "git_utils" class DiscourseLogstashLogger < Logger PROCESS_PID = Process.pid HOST = Socket.gethostname - GIT_VERSION = GitUtils.git_version attr_accessor :customize_event, :type @@ -67,7 +65,6 @@ class DiscourseLogstashLogger < Logger "pid" => PROCESS_PID, "type" => @type.to_s, "host" => HOST, - "git_version" => GitUtils.git_version, } # Only log backtrace and env for Logger::WARN and above. diff --git a/spec/lib/discourse_logstash_logger_spec.rb b/spec/lib/discourse_logstash_logger_spec.rb index f0bbb2ae668..e094e2c18ed 100644 --- a/spec/lib/discourse_logstash_logger_spec.rb +++ b/spec/lib/discourse_logstash_logger_spec.rb @@ -21,7 +21,6 @@ RSpec.describe DiscourseLogstashLogger do "pid" => described_class::PROCESS_PID, "type" => "test", "host" => described_class::HOST, - "git_version" => described_class::GIT_VERSION, "method" => "GET", "path" => "/", "format" => "html",