on_strum-healthcheck 0.2.0 → 0.3.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: e83d58e450413cfde81bf7e671e98b905fd5143783215bd48cb75b6e7302fd6f
4
- data.tar.gz: 579db98df237a8bc426943ca3bd7dfec79099cf50c2afdc550ef665b62eaa080
3
+ metadata.gz: fb2e5639dd837ec0e6685bfc6b14de9dd96713ffd837d7a9adb9aa7b6d41c4de
4
+ data.tar.gz: 7f43562f43acd36a2c8755cdab676e8aac9d07c776a147ac31e5cc6142c7e8da
5
5
  SHA512:
6
- metadata.gz: 1cd7bf655887c29271ed253d18ab0c841b8888aba438adfc262cdf8fd18884d65347a70db51e582ceb443fbf854103ac4691f99032e2a832d9539501e1f356fa
7
- data.tar.gz: 700639dc0e4241decc644139d478bac65cdb7f38627f74341c0bc4f55b67d6bb47ca73e8ba45ce06e32ed1fc90aded7c5eae6cfae0bd291c3a320d21a0a0160f
6
+ metadata.gz: c64ec42331c055305fc5bfdd52e46e409d49fe576d2c50db4dd438b912256ae912bd2efe18c541bc5056961942ba4be2ebfb1da0c3626b523387aefd232fd6e7
7
+ data.tar.gz: b9862d1f9cab1b6f7e4a072491e003c66dc92c65f9bc929fb986dc030a5d957b34672930f7d0a46742fa19a1e5f93b58f14c0f079222fea89de2c362c5f0817c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,26 @@
2
2
 
3
3
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
4
4
 
5
+ ## [0.3.0] - 2024-04-15
6
+
7
+ ### Added
8
+
9
+ - Added ability to show in the response current probe type
10
+
11
+ ```json
12
+ {
13
+ "data": {
14
+ "id": "a09efd18-e09f-4207-9a43-b4bf89f76b47",
15
+ "type": "application-startup-healthcheck",
16
+ "attributes": {
17
+ "postgres": true,
18
+ "redis": true,
19
+ "rabbit": true
20
+ }
21
+ }
22
+ }
23
+ ```
24
+
5
25
  ## [0.2.0] - 2024-03-28
6
26
 
7
27
  ### Added
data/README.md CHANGED
@@ -77,7 +77,7 @@ OnStrum::Healthcheck.configure do |config|
77
77
  # and return boolean.
78
78
  # It is equal to empty hash by default.
79
79
  config.services = {
80
- postges: -> { true },
80
+ postgres: -> { true },
81
81
  redis: -> { true },
82
82
  rabbit: -> { false }
83
83
  }
@@ -86,7 +86,7 @@ OnStrum::Healthcheck.configure do |config|
86
86
  # during running startup probe. As array items must be used an
87
87
  # existing keys, defined in config.services.
88
88
  # It is equal to empty array by default.
89
- config.services_startup = %i[postges]
89
+ config.services_startup = %i[postgres]
90
90
 
91
91
  # Optional parameter. The list of services that will be checked
92
92
  # during running liveness probe. As array items must be used an
@@ -98,7 +98,7 @@ OnStrum::Healthcheck.configure do |config|
98
98
  # during running liveness probe. As array items must be used an
99
99
  # existing keys, defined in config.services.
100
100
  # It is equal to empty array by default.
101
- config.services_readiness = %i[postges redis rabbit]
101
+ config.services_readiness = %i[postgres redis rabbit]
102
102
 
103
103
  # Optional parameter. The name of middleware's root
104
104
  # endpoints namespace. Use '/' if you want to use root
@@ -191,7 +191,7 @@ OnStrum::Healthcheck.configure
191
191
  # config/environment.rb
192
192
 
193
193
  Hanami.configure do
194
- middleware.use MyRackMiddleware
194
+ middleware.use OnStrum::Healthcheck::RackMiddleware
195
195
  end
196
196
  ```
197
197
 
@@ -222,11 +222,11 @@ Each healthcheck endpoint returns proper HTTP status and body. Determining the r
222
222
  {
223
223
  "data": {
224
224
  "id": "a09efd18-e09f-4207-9a43-b4bf89f76b47",
225
- "type": "application-healthcheck",
225
+ "type": "application-startup-healthcheck",
226
226
  "attributes": {
227
- "postges": true,
227
+ "postgres": true,
228
228
  "redis": true,
229
- "rebbit": true
229
+ "rabbit": true
230
230
  }
231
231
  }
232
232
  }
@@ -9,7 +9,6 @@ module OnStrum
9
9
 
10
10
  PROBE_ENDPOINTS = %i[endpoint_startup endpoint_liveness endpoint_readiness].freeze
11
11
  CONTENT_TYPE = { 'Content-Type' => 'application/json' }.freeze
12
- JSONAPI_RESPONSE_TYPE = 'application-healthcheck'
13
12
  ROOT_NAMESPACE = '/'
14
13
 
15
14
  def self.call(rack_env)
@@ -75,7 +74,7 @@ module OnStrum
75
74
  {
76
75
  data: {
77
76
  id: ::SecureRandom.uuid,
78
- type: OnStrum::Healthcheck::Resolver::JSONAPI_RESPONSE_TYPE,
77
+ type: "application-#{probe_name}-healthcheck",
79
78
  attributes: probe_result
80
79
  }
81
80
  }.to_json
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OnStrum
4
4
  module Healthcheck
5
- VERSION = '0.2.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: on_strum-healthcheck
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Vladislav Trotsenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-03-28 00:00:00.000000000 Z
11
+ date: 2024-04-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack