govuk_app_config 9.11.1 → 9.12.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2e328b8f14abd03a18e3f68c5334eca8681fd149b6572bbc30bd2336f32fa4a8
4
- data.tar.gz: f31ef5725579cb25b04fcc0ddfb75a00e1efedb7e6f6ca838182edea6fdfd0ff
3
+ metadata.gz: 20f6c0f84338e2323ad36493234894a5b960374c173111f134062d2911d5f224
4
+ data.tar.gz: 1a83af7fc6f2ea3710bdfc34e8c0bec33c3c0799b9d00448943f433bfb6a70e2
5
5
  SHA512:
6
- metadata.gz: 6387c742d5b1e535e8e26b7e60f5161377e410c9a1a974aae32572546746f9e6bed7cbbf09ed2501492106d3db82bf57293f661c116d748e79e5d973f2242ca9
7
- data.tar.gz: 8b5283cc08344c0975d0cdd5904f380bfd937e87f41f4f89e10c296b4f3eb906d76625160130aea6ad77f399f4e2b0e129e648dd6df1bfb278ddea65ad821704
6
+ metadata.gz: 81e16fe6cde2884271be25e436753544e12f75415643b4972390ab55563f72ff9e144de4e7b0692c9eced7ce8591be121c40c06d175ef014128a0d92ec0583c4
7
+ data.tar.gz: f6d1b1bdc33591394cdb16f156e51e713312b02dcd108066c71a9f05c5c27a89d2bf7b36836ce349f899058c0c0891313e1ac6a511f8878aa8b58bb4d081fabd
@@ -1,3 +1,5 @@
1
+ name: CI
2
+
1
3
  on:
2
4
  push:
3
5
  branches:
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 9.12.0
2
+
3
+ * Set time_zone to London in all GOV.UK apps ([#381](https://github.com/alphagov/govuk_app_config/pull/381))
4
+
5
+ # 9.11.2
6
+
7
+ * Fix Logstasher monkey patch overriding patch from this library for OpenTelemetry errors ([#377](https://github.com/alphagov/govuk_app_config/pull/377))
8
+
1
9
  # 9.11.1
2
10
 
3
11
  * Fix OpenTelemetry errors when using with Logstasher gem ([#372](https://github.com/alphagov/govuk_app_config/pull/372))
data/README.md CHANGED
@@ -8,6 +8,7 @@ Adds the basics of a GOV.UK application:
8
8
  - Statsd client for reporting stats (deprecated; use Prometheus instead)
9
9
  - Rails logging
10
10
  - Content Security Policy generation for frontend apps
11
+ - Sets the time zone to London
11
12
 
12
13
  ## Installation
13
14
 
@@ -181,6 +182,9 @@ GovukContentSecurityPolicy.configure
181
182
 
182
183
  Some frontend apps support languages that are not defined in the i18n gem. This provides them with our own custom rules for these languages.
183
184
 
185
+ ## Time zone
186
+
187
+ This gem sets `config.time_zone` to `"London"` - this cannot currently be overridden in application config.
184
188
 
185
189
  ## License
186
190
 
@@ -21,8 +21,8 @@ Gem::Specification.new do |spec|
21
21
  spec.require_paths = %w[lib]
22
22
 
23
23
  spec.add_dependency "logstasher", "~> 2.1"
24
- spec.add_dependency "opentelemetry-exporter-otlp", ">= 0.25", "< 0.27"
25
- spec.add_dependency "opentelemetry-instrumentation-all", ">= 0.39.1", "< 0.61.0"
24
+ spec.add_dependency "opentelemetry-exporter-otlp", ">= 0.25", "< 0.29"
25
+ spec.add_dependency "opentelemetry-instrumentation-all", ">= 0.39.1", "< 0.62.0"
26
26
  spec.add_dependency "opentelemetry-sdk", "~> 1.2"
27
27
  spec.add_dependency "plek", ">= 4", "< 6"
28
28
  spec.add_dependency "prometheus_exporter", "~> 2.0"
@@ -39,7 +39,7 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "rake", "~> 13.0"
40
40
  spec.add_development_dependency "rspec", "~> 3.10"
41
41
  spec.add_development_dependency "rspec-its", "~> 1.3"
42
- spec.add_development_dependency "rubocop-govuk", "4.17.1"
42
+ spec.add_development_dependency "rubocop-govuk", "4.18.0"
43
43
  spec.add_development_dependency "simplecov"
44
44
  spec.add_development_dependency "webmock"
45
45
  end
@@ -20,6 +20,8 @@ module GovukJsonLogging
20
20
  config = Rails.application.config.logstasher
21
21
  if (!config.controller_monkey_patch && config.controller_monkey_patch != false) || config.controller_monkey_patch == true
22
22
  require_relative "./govuk_json_logging/rails_ext/action_controller/metal/instrumentation"
23
+ # Prevent the old monkey patch being applied
24
+ config.controller_monkey_patch = false
23
25
  end
24
26
 
25
27
  configuration = Configuration.new
@@ -0,0 +1,14 @@
1
+ module GovukTimezone
2
+ def self.configure(config)
3
+ case config.time_zone
4
+ when "UTC"
5
+ Rails.logger.info "govuk_app_config changing time_zone from UTC (the default) to London"
6
+ when "London"
7
+ Rails.logger.info "govuk_app_config always sets time_zone to London - there is no need to set config.time_zone in your app"
8
+ else
9
+ raise "govuk_app_config prevents configuring time_zones other than London - config.time_zone was set to #{config.time_zone}"
10
+ end
11
+
12
+ config.time_zone = "London"
13
+ end
14
+ end
@@ -14,6 +14,10 @@ module GovukAppConfig
14
14
  end
15
15
  end
16
16
 
17
+ initializer "govuk_app_config.configure_timezone", before: "active_support.initialize_time_zone" do |app|
18
+ GovukTimezone.configure(app.config)
19
+ end
20
+
17
21
  config.before_initialize do
18
22
  GovukJsonLogging.configure if ENV["GOVUK_RAILS_JSON_LOGGING"]
19
23
  end
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "9.11.1".freeze
2
+ VERSION = "9.12.0".freeze
3
3
  end
@@ -9,5 +9,6 @@ require "govuk_app_config/govuk_prometheus_exporter"
9
9
  if defined?(Rails)
10
10
  require "govuk_app_config/govuk_json_logging"
11
11
  require "govuk_app_config/govuk_content_security_policy"
12
+ require "govuk_app_config/govuk_timezone"
12
13
  require "govuk_app_config/railtie"
13
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_app_config
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.11.1
4
+ version: 9.12.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-06-05 00:00:00.000000000 Z
11
+ date: 2024-06-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstasher
@@ -33,7 +33,7 @@ dependencies:
33
33
  version: '0.25'
34
34
  - - "<"
35
35
  - !ruby/object:Gem::Version
36
- version: '0.27'
36
+ version: '0.29'
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '0.25'
44
44
  - - "<"
45
45
  - !ruby/object:Gem::Version
46
- version: '0.27'
46
+ version: '0.29'
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: opentelemetry-instrumentation-all
49
49
  requirement: !ruby/object:Gem::Requirement
@@ -53,7 +53,7 @@ dependencies:
53
53
  version: 0.39.1
54
54
  - - "<"
55
55
  - !ruby/object:Gem::Version
56
- version: 0.61.0
56
+ version: 0.62.0
57
57
  type: :runtime
58
58
  prerelease: false
59
59
  version_requirements: !ruby/object:Gem::Requirement
@@ -63,7 +63,7 @@ dependencies:
63
63
  version: 0.39.1
64
64
  - - "<"
65
65
  - !ruby/object:Gem::Version
66
- version: 0.61.0
66
+ version: 0.62.0
67
67
  - !ruby/object:Gem::Dependency
68
68
  name: opentelemetry-sdk
69
69
  requirement: !ruby/object:Gem::Requirement
@@ -292,14 +292,14 @@ dependencies:
292
292
  requirements:
293
293
  - - '='
294
294
  - !ruby/object:Gem::Version
295
- version: 4.17.1
295
+ version: 4.18.0
296
296
  type: :development
297
297
  prerelease: false
298
298
  version_requirements: !ruby/object:Gem::Requirement
299
299
  requirements:
300
300
  - - '='
301
301
  - !ruby/object:Gem::Version
302
- version: 4.17.1
302
+ version: 4.18.0
303
303
  - !ruby/object:Gem::Dependency
304
304
  name: simplecov
305
305
  requirement: !ruby/object:Gem::Requirement
@@ -372,6 +372,7 @@ files:
372
372
  - lib/govuk_app_config/govuk_proxy/static_proxy.rb
373
373
  - lib/govuk_app_config/govuk_puma.rb
374
374
  - lib/govuk_app_config/govuk_statsd.rb
375
+ - lib/govuk_app_config/govuk_timezone.rb
375
376
  - lib/govuk_app_config/railtie.rb
376
377
  - lib/govuk_app_config/version.rb
377
378
  homepage: https://github.com/alphagov/govuk_app_config
@@ -393,7 +394,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
393
394
  - !ruby/object:Gem::Version
394
395
  version: '0'
395
396
  requirements: []
396
- rubygems_version: 3.5.11
397
+ rubygems_version: 3.5.14
397
398
  signing_key:
398
399
  specification_version: 4
399
400
  summary: Base configuration for GOV.UK applications