govuk_app_config 9.23.8 → 9.23.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 690da2549ce2989c3c6d623f4d5a430042291572aea58f5b97f7764ac5d3fb42
4
- data.tar.gz: 5627be2111ad3059a1759275ddb63c87b0d97bb13ae9695716b8dc91b036ec6b
3
+ metadata.gz: 8f051f8f922ce9d488a41fec6fadb061481325266a2b6e8f2cb66e2b604b3316
4
+ data.tar.gz: 245e669207f16f32cd0a810904c7040e06215e096eaa6c04615452fcf8bd843e
5
5
  SHA512:
6
- metadata.gz: 202d0501cbb46cdf13be133dd23775f3f7b7450578ce763a1f78cf9ed43e794d5916a91f4a9e54a418a30d25a949a1478f39ca4cfdf76eb7313ac2898fc23cda
7
- data.tar.gz: 06fac9dc37f2ea4e4d878c673530b7ee4f9190b4d3a0baf142449a4f83367a15e103d6378ea27eec80d828f367ca47b35d4a13a9ca49ec2defac68cb89bcb8be
6
+ metadata.gz: 5e670b32b2d4d86b1ccda4f5ff6c76dfe0b70aeb4b6f5812fbe3d5b52fe21e3de270f9b3526e8812f556cb54edd6c74b7428130b38dfde595f942b1b3b00501c
7
+ data.tar.gz: 857dec3b9eb73e61a641f434c1e86e38471ac009974bc33b2aa66ee0ffb6af6b340dd0f632d1599a8f26acaa9e248b7522b08dd40a1f733ee73cb3aa41b634c5
@@ -38,7 +38,7 @@ jobs:
38
38
  - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
39
39
  with:
40
40
  ref: ${{ inputs.ref || github.ref }}
41
- - uses: ruby/setup-ruby@e65c17d16e57e481586a6a5a0282698790062f92 # v1.300.0
41
+ - uses: ruby/setup-ruby@4c56a21280b36d862b5fc31348f463d60bdc55d5 # v1.301.0
42
42
  with:
43
43
  ruby-version: ${{ matrix.ruby }}
44
44
  bundler-cache: true
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 9.23.9
2
+
3
+ * Fix Logstasher JSON logger initialisation problems in Rails apps
4
+
1
5
  # 9.23.8
2
6
 
3
7
  * Fix Google Analytics CSP errors
@@ -95,5 +95,12 @@ module GovukJsonLogging
95
95
  # the responses it gets, so direct this to the logstasher logger.
96
96
  GdsApi::Base.default_options[:logger] = Rails.application.config.logstasher.logger
97
97
  end
98
+
99
+ # On Rails 8.1+, the default LogStasher initializer is removed to prevent a boot
100
+ # crash (see railtie.rb). We call setup explicitly here, after all config is applied.
101
+ if defined?(LogStasher) && Gem::Version.new(Rails::VERSION::STRING) >= Gem::Version.new("8.1")
102
+ LogStasher.setup_before(Rails.application.config.logstasher)
103
+ LogStasher.setup(Rails.application.config.logstasher)
104
+ end
98
105
  end
99
106
  end
@@ -7,13 +7,10 @@ begin
7
7
  # Only apply this workaround for Rails 8.1+ where the boot cycle issue exists.
8
8
  # This prevents any potential regressions for apps on older Rails versions.
9
9
  if defined?(LogStasher::Railtie) && Gem::Version.new(Rails::VERSION::STRING) >= Gem::Version.new("8.1")
10
- # Remove duplicate initializers that cause cyclic dependency
10
+ # Remove the default initializer to fix a cyclic dependency boot crash on Rails 8.1.
11
+ # LogStasher.setup is instead called explicitly in GovukJsonLogging.configure (after_initialize),
12
+ # once logstasher.enabled has been set to true.
11
13
  LogStasher::Railtie.initializers.delete_if { |i| i.name == :logstasher }
12
-
13
- # Replace with a single clean initializer that actually sets up LogStasher
14
- LogStasher::Railtie.initializer(:logstasher_govuk_fix, after: :load_config_initializers) do |app|
15
- LogStasher.setup(app) if app.config.logstasher.enabled
16
- end
17
14
  end
18
15
  rescue LoadError, NameError
19
16
  # Skip if Logstasher not present
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "9.23.8".freeze
2
+ VERSION = "9.23.9".freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_app_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.23.8
4
+ version: 9.23.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev