File tree Expand file tree Collapse file tree 4 files changed +11
-2
lines changed
Expand file tree Collapse file tree 4 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,10 @@ class ConfigLoader
2424 normalize_headers : true
2525 } . freeze
2626
27+ SILENCE_CONFIG_LOADER_MESSAGES = ENV . fetch (
28+ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" , "false"
29+ ) . downcase == "true" . freeze
30+
2731 # Load and merge configuration from various sources
2832 #
2933 # @param config_path [String, Hash] Path to config file or config hash
@@ -65,7 +69,7 @@ def self.load(config_path: nil)
6569
6670 # Log overrides if any were made
6771 if overrides . any?
68- puts "INFO: Configuration overrides applied from: #{ overrides . join ( ', ' ) } "
72+ puts "INFO: Configuration overrides applied from: #{ overrides . join ( ', ' ) } " unless SILENCE_CONFIG_LOADER_MESSAGES
6973 end
7074
7175 return config
@@ -112,7 +116,7 @@ def self.load_config_file(file_path)
112116 result
113117 rescue => e
114118 # Log this error with meaningful information
115- puts "ERROR: Failed to load config file '#{ file_path } ': #{ e . message } "
119+ puts "ERROR: Failed to load config file '#{ file_path } ': #{ e . message } " unless SILENCE_CONFIG_LOADER_MESSAGES
116120 nil
117121 end
118122
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3+ ENV [ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" ] = "true" # Silence config loader messages in tests
4+
35require_relative "../../lib/hooks"
46require "rack/test"
57require "json"
Original file line number Diff line number Diff line change 11# frozen_string_literal: true
22
3+ ENV [ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" ] = "true" # Silence config loader messages in tests
4+
35require_relative "../../lib/hooks"
46require "rack/test"
57require "json"
Original file line number Diff line number Diff line change 1212
1313ENV [ "GITHUB_WEBHOOK_SECRET" ] = FAKE_HMAC_SECRET
1414ENV [ "ALT_WEBHOOK_SECRET" ] = FAKE_ALT_HMAC_SECRET
15+ ENV [ "HOOKS_SILENCE_CONFIG_LOADER_MESSAGES" ] = "true"
1516
1617COV_DIR = File . expand_path ( "../../coverage" , File . dirname ( __FILE__ ) )
1718
You can’t perform that action at this time.
0 commit comments