govuk_app_config 9.18.0 → 9.19.0

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: 66fcd91cb96937dd1e1175cb3b1ce381e1ff96315a48d78fbb4ff82b10c3d445
4
- data.tar.gz: 35bbec2bb311363df456acb40443eab276da3a5b7b5f27d9b13f737ee5f36ff0
3
+ metadata.gz: ab40b8b4b0ecbf73887e3e946b57547fd8f68ba6e5f7da78a60052b2c44c6358
4
+ data.tar.gz: 65256f6a26e4173507dc4eb9c3d3805456bbe806df25e32f375eba1fb68f5b3d
5
5
  SHA512:
6
- metadata.gz: d2d35864851dfeb978c0b45ef1bac25516ab3772db30f79c43db62d03dffba7e750fba571355f76c99f9a623888d0006a1be465435eeeb517837d99f95f055ec
7
- data.tar.gz: 872b3cd2ba3a58f55ba068a57d0bb512f62acb2514e2bcf90c2a63c863303764b9917f209620c6f4aa6bd61b6025634c871e264e19c3c0e0d68887773abc2e47
6
+ metadata.gz: 011b0b5dfe895521562348f134bf4d650d318420b0698213328ad5f1aed377baac4f4edf2c43002f22eeeccb16aedd9a3921a2a7c30ebbdbcbb670f4272913f7
7
+ data.tar.gz: b81b57c6775a1d9b9405e459ec4b53c9d91251627cd6e2aae52cb5f66a920a20f402be06c516104c71ba7fd6a752d04948578ed233eaf3c8b58ccd57e1ebecfd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ # 9.19.0
2
+
3
+ * Add `GovukHealthcheck.EmergencyBannerRedis` healthcheck
4
+
5
+ # 9.18.1
6
+
7
+ * Properly export `GovukEnvironment.current` feature
8
+
1
9
  # 9.18.0
2
10
 
3
11
  * Add `GovukEnvironment.current` feature
data/docs/healthchecks.md CHANGED
@@ -29,7 +29,9 @@ Built-in checks you can use include:
29
29
 
30
30
  - `GovukHealthcheck::RailsCache` - checks that the Rails cache store, such as Memcached, is acessible by writing and reading back a cache entry called "healthcheck-cache".
31
31
 
32
- - `GovukHealthcheck::Redis` - checks that the app can connect to Redis by writing and reading back a cache entry called "healthcheck-cache".
32
+ - `GovukHealthcheck::Redis` - checks that the app can connect to Redis by writing and reading back a cache entry called "healthcheck-<random_hex>".
33
+
34
+ - `GovukHealthcheck::EmergencyBannerRedis` - checks that the app can connect to the Redis instance which has the emergency banner config by writing and reading back a cache entry called "healthcheck-emergency-banner-<random_hex>".
33
35
 
34
36
  - `GovukHealthcheck::Mongoid` - checks that the app has a connection to its Mongo database via Mongoid.
35
37
 
@@ -0,0 +1,28 @@
1
+ require "securerandom"
2
+
3
+ module GovukHealthcheck
4
+ class EmergencyBannerRedis
5
+ def name
6
+ :emergency_banner_redis_connectivity
7
+ end
8
+
9
+ def status
10
+ client = ::Redis.new(
11
+ url: ENV["EMERGENCY_BANNER_REDIS_URL"],
12
+ reconnect_attempts: [0, 0.25], # Purposefully short since this is a healthcheck
13
+ )
14
+
15
+ key = "healthcheck-emergency-banner-#{SecureRandom.hex}"
16
+
17
+ client.set(key, "val")
18
+ client.get(key)
19
+ client.del(key)
20
+
21
+ client.close
22
+
23
+ GovukHealthcheck::OK
24
+ rescue StandardError
25
+ GovukHealthcheck::CRITICAL
26
+ end
27
+ end
28
+ end
@@ -1,5 +1,6 @@
1
1
  require "govuk_app_config/govuk_healthcheck/checkup"
2
2
  require "govuk_app_config/govuk_healthcheck/active_record"
3
+ require "govuk_app_config/govuk_healthcheck/emergency_banner_redis"
3
4
  require "govuk_app_config/govuk_healthcheck/mongoid"
4
5
  require "govuk_app_config/govuk_healthcheck/rails_cache"
5
6
  require "govuk_app_config/govuk_healthcheck/redis"
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "9.18.0".freeze
2
+ VERSION = "9.19.0".freeze
3
3
  end
@@ -8,6 +8,7 @@ require "govuk_app_config/version"
8
8
 
9
9
  if defined?(Rails)
10
10
  require "govuk_app_config/govuk_content_security_policy"
11
+ require "govuk_app_config/govuk_environment"
11
12
  require "govuk_app_config/govuk_i18n"
12
13
  require "govuk_app_config/govuk_json_logging"
13
14
  require "govuk_app_config/govuk_timezone"
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.18.0
4
+ version: 9.19.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
@@ -364,6 +364,7 @@ files:
364
364
  - lib/govuk_app_config/govuk_healthcheck.rb
365
365
  - lib/govuk_app_config/govuk_healthcheck/active_record.rb
366
366
  - lib/govuk_app_config/govuk_healthcheck/checkup.rb
367
+ - lib/govuk_app_config/govuk_healthcheck/emergency_banner_redis.rb
367
368
  - lib/govuk_app_config/govuk_healthcheck/mongoid.rb
368
369
  - lib/govuk_app_config/govuk_healthcheck/rails_cache.rb
369
370
  - lib/govuk_app_config/govuk_healthcheck/redis.rb