govuk_app_config 2.8.0 → 2.9.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: 50c4b50f5a22588851e04eca092e805837d2261d7d20983c9c26c07bc2ac434f
4
- data.tar.gz: 43b503c4451da57a7b414881c11b30699f8c128574ad0fde493991e8564c7215
3
+ metadata.gz: 106a5c63b04c2882b7715da357f9c2e6d69dd87c20f7ceccefdb8b1b7a27e0b7
4
+ data.tar.gz: 0035b7c017727795f9dcc2f99c883be9b0f8c0f77992ffd14f9373a16f890e31
5
5
  SHA512:
6
- metadata.gz: c3d757ff6c8783fa3760919a50a74a17f63a050e54e02b6c92ad22b98acb77fd2548c6f0932079fc8ac2e7306a71c0e7a8ada9971f20572c22a222cb66da81e2
7
- data.tar.gz: 602885c83d0382ea1109ce3d514d783c9aa248bc3355d54364cbd81b4c81976f43e8fd9d60d210016800296591c4f1ff3909493f2dba5d38823baf927896f783
6
+ metadata.gz: 7e80717eb6c207a69f25019806a2085c93ea595126d665314a54acc3679a4053db88a7062efb3b711b4368b5937dadc784af50532e3c9be30ab2310878842a44
7
+ data.tar.gz: 568071152636585876ece594c91884ebbce3d5a284ed4df8d9e268af05836e95872f7cc84e9f6ed73b672f61a6e20284274c7fe4fb45114728efc05a15b1ebba
data/CHANGELOG.md CHANGED
@@ -1,10 +1,35 @@
1
+ # 2.9.0
2
+
3
+ * Add GovukI18n module with custom plural rules ([##187](https://github.com/alphagov/govuk_app_config/pull/187))
4
+
5
+ # 2.8.4
6
+
7
+ * Ensure Redis healthcheck avoids potential race condition ([#185](https://github.com/alphagov/govuk_app_config/pull/185))
8
+
9
+ # 2.8.3
10
+
11
+ * Add new Redis healthcheck and relevant tests ([#183](https://github.com/alphagov/govuk_app_config/pull/183))
12
+
13
+ # 2.8.2
14
+
15
+ * Allow apps to configure the host and protocol for Statsd ([#180](https://github.com/alphagov/govuk_app_config/pull/180))
16
+
17
+ # 2.8.1
18
+
19
+ * Add `GdsApi::ContentStore::ItemNotFound` to `data_sync_excluded_exceptions` (https://github.com/alphagov/govuk_app_config/pull/178)
20
+ * Dependabot bumps to allow latest versions of logstasher ([#177](https://github.com/alphagov/govuk_app_config/pull/177)) and unicorn ([#175](https://github.com/alphagov/govuk_app_config/pull/175))
21
+
22
+ # 2.8.0
23
+
24
+ * Adds govuk_app_config version to every Sentry call (https://github.com/alphagov/govuk_app_config/pull/174)
25
+
1
26
  # 2.7.1
2
27
 
3
- * Fix broken data sync error handling for non-Rails apps
28
+ * Fix broken data sync error handling for non-Rails apps (https://github.com/alphagov/govuk_app_config/pull/172)
4
29
 
5
30
  # 2.7.0
6
31
 
7
- * Ignore intermittent template retrieval errors from Slimmer
32
+ * Ignore intermittent template retrieval errors from Slimmer (https://github.com/alphagov/govuk_app_config/pull/170)
8
33
 
9
34
  # 2.6.0
10
35
 
data/README.md CHANGED
@@ -162,6 +162,10 @@ app with the following content:
162
162
  GovukContentSecurityPolicy.configure
163
163
  ```
164
164
 
165
+ ## i18n rules
166
+
167
+ Some frontend apps support languages that are not defined in the i18n gem. This provides them with our own custom rules for these languages.
168
+
165
169
  ## License
166
170
 
167
171
  [MIT License](LICENSE.md)
@@ -20,10 +20,10 @@ Gem::Specification.new do |spec|
20
20
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
21
21
  spec.require_paths = %w[lib]
22
22
 
23
- spec.add_dependency "logstasher", ">= 1.2.2", "< 1.4.0"
23
+ spec.add_dependency "logstasher", ">= 1.2.2", "< 2.2.0"
24
24
  spec.add_dependency "sentry-raven", "~> 3.1.1"
25
- spec.add_dependency "statsd-ruby", "~> 1.4.0"
26
- spec.add_dependency "unicorn", ">= 5.4", "< 5.8"
25
+ spec.add_dependency "statsd-ruby", "~> 1.5.0"
26
+ spec.add_dependency "unicorn", ">= 5.4", "< 5.9"
27
27
 
28
28
  spec.add_development_dependency "byebug"
29
29
  spec.add_development_dependency "climate_control"
@@ -3,6 +3,7 @@ require "govuk_app_config/govuk_statsd"
3
3
  require "govuk_app_config/govuk_error"
4
4
  require "govuk_app_config/govuk_error/configure"
5
5
  require "govuk_app_config/govuk_healthcheck"
6
+ require "govuk_app_config/govuk_i18n"
6
7
  # This require is deprecated and should be removed on next major version bump
7
8
  # and should be required by applications directly.
8
9
  require "govuk_app_config/govuk_unicorn"
@@ -61,6 +61,7 @@ GovukError.configure do |config|
61
61
  # rate-limited by Sentry.
62
62
  config.data_sync_excluded_exceptions = [
63
63
  "PG::Error",
64
+ "GdsApi::ContentStore::ItemNotFound",
64
65
  ]
65
66
 
66
67
  config.transport_failure_callback = proc {
@@ -2,6 +2,7 @@ require "govuk_app_config/govuk_healthcheck/checkup"
2
2
  require "govuk_app_config/govuk_healthcheck/active_record"
3
3
  require "govuk_app_config/govuk_healthcheck/mongoid"
4
4
  require "govuk_app_config/govuk_healthcheck/rails_cache"
5
+ require "govuk_app_config/govuk_healthcheck/redis"
5
6
  require "govuk_app_config/govuk_healthcheck/sidekiq_redis"
6
7
  require "govuk_app_config/govuk_healthcheck/threshold_check"
7
8
  require "govuk_app_config/govuk_healthcheck/sidekiq_queue_check"
@@ -0,0 +1,25 @@
1
+ require "securerandom"
2
+
3
+ module GovukHealthcheck
4
+ class Redis
5
+ def name
6
+ :redis_connectivity
7
+ end
8
+
9
+ def status
10
+ client = ::Redis.new
11
+
12
+ key = "healthcheck-#{SecureRandom.hex}"
13
+
14
+ client.set(key, "val")
15
+ client.get(key)
16
+ client.del(key)
17
+
18
+ client.close
19
+
20
+ GovukHealthcheck::OK
21
+ rescue StandardError
22
+ GovukHealthcheck::CRITICAL
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,38 @@
1
+ module GovukI18n
2
+ def plurals
3
+ {
4
+ # Dari - this isn't an iso code. Probably should be 'prs' as per ISO 639-3.
5
+ dr: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
6
+ # Latin America and Caribbean Spanish
7
+ "es-419": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
8
+ # Scottish Gaelic
9
+ gd: { i18n: { plural: { keys: %i[one two few other],
10
+ rule:
11
+ lambda do |n|
12
+ if [1, 11].include?(n)
13
+ :one
14
+ elsif [2, 12].include?(n)
15
+ :two
16
+ elsif [3, 4, 5, 6, 7, 8, 9, 10, 13, 14, 15, 16, 17, 18, 19].include?(n)
17
+ :few
18
+ else
19
+ :other
20
+ end
21
+ end } } },
22
+ # Armenian
23
+ hy: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
24
+ # Kazakh
25
+ kk: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
26
+ # Punjabi Shahmukhi
27
+ "pa-pk": { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
28
+ # Sinhalese
29
+ si: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
30
+ # Uzbek
31
+ uz: { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
32
+ # Chinese Hong Kong
33
+ "zh-hk" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
34
+ # Chinese Taiwan
35
+ "zh-tw" => { i18n: { plural: { keys: %i[one other], rule: ->(n) { n == 1 ? :one : :other } } } },
36
+ }
37
+ end
38
+ end
@@ -8,7 +8,7 @@ module GovukStatsd
8
8
 
9
9
  def self.client
10
10
  @client ||= begin
11
- statsd_client = ::Statsd.new("localhost")
11
+ statsd_client = ::Statsd.new(ENV["GOVUK_STATSD_HOST"] || "localhost", 8125, ENV["GOVUK_STATSD_PROTOCOL"]&.to_sym || :udp)
12
12
  statsd_client.namespace = ENV["GOVUK_STATSD_PREFIX"].to_s
13
13
  statsd_client
14
14
  end
@@ -1,3 +1,3 @@
1
1
  module GovukAppConfig
2
- VERSION = "2.8.0".freeze
2
+ VERSION = "2.9.0".freeze
3
3
  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: 2.8.0
4
+ version: 2.9.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: 2020-12-04 00:00:00.000000000 Z
11
+ date: 2021-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: logstasher
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 1.2.2
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 1.4.0
22
+ version: 2.2.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: 1.2.2
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 1.4.0
32
+ version: 2.2.0
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: sentry-raven
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -50,14 +50,14 @@ dependencies:
50
50
  requirements:
51
51
  - - "~>"
52
52
  - !ruby/object:Gem::Version
53
- version: 1.4.0
53
+ version: 1.5.0
54
54
  type: :runtime
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: 1.4.0
60
+ version: 1.5.0
61
61
  - !ruby/object:Gem::Dependency
62
62
  name: unicorn
63
63
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +67,7 @@ dependencies:
67
67
  version: '5.4'
68
68
  - - "<"
69
69
  - !ruby/object:Gem::Version
70
- version: '5.8'
70
+ version: '5.9'
71
71
  type: :runtime
72
72
  prerelease: false
73
73
  version_requirements: !ruby/object:Gem::Requirement
@@ -77,7 +77,7 @@ dependencies:
77
77
  version: '5.4'
78
78
  - - "<"
79
79
  - !ruby/object:Gem::Version
80
- version: '5.8'
80
+ version: '5.9'
81
81
  - !ruby/object:Gem::Dependency
82
82
  name: byebug
83
83
  requirement: !ruby/object:Gem::Requirement
@@ -236,11 +236,13 @@ files:
236
236
  - lib/govuk_app_config/govuk_healthcheck/checkup.rb
237
237
  - lib/govuk_app_config/govuk_healthcheck/mongoid.rb
238
238
  - lib/govuk_app_config/govuk_healthcheck/rails_cache.rb
239
+ - lib/govuk_app_config/govuk_healthcheck/redis.rb
239
240
  - lib/govuk_app_config/govuk_healthcheck/sidekiq_queue_check.rb
240
241
  - lib/govuk_app_config/govuk_healthcheck/sidekiq_queue_latency_check.rb
241
242
  - lib/govuk_app_config/govuk_healthcheck/sidekiq_redis.rb
242
243
  - lib/govuk_app_config/govuk_healthcheck/sidekiq_retry_size_check.rb
243
244
  - lib/govuk_app_config/govuk_healthcheck/threshold_check.rb
245
+ - lib/govuk_app_config/govuk_i18n.rb
244
246
  - lib/govuk_app_config/govuk_logging.rb
245
247
  - lib/govuk_app_config/govuk_statsd.rb
246
248
  - lib/govuk_app_config/govuk_unicorn.rb