solid_queue_guard 0.5.0 → 1.0.1

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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +12 -0
  3. data/.rubocop.yml +44 -0
  4. data/.ruby-version +1 -0
  5. data/CHANGELOG.md +88 -0
  6. data/Gemfile +8 -0
  7. data/Gemfile.lock +308 -0
  8. data/README.md +215 -11
  9. data/app/controllers/solid_queue_guard/health_controller.rb +1 -4
  10. data/lib/generators/solid_queue_guard/install/USAGE.ci +9 -0
  11. data/lib/generators/solid_queue_guard/install/ci_generator.rb +19 -0
  12. data/lib/generators/solid_queue_guard/install/templates/solid_queue_guard.rb +6 -0
  13. data/lib/generators/solid_queue_guard/install/templates/solid_queue_guard.yml +25 -0
  14. data/lib/solid_queue_guard/checks/base.rb +16 -0
  15. data/lib/solid_queue_guard/checks/config/async_supervisor_config_check.rb +25 -0
  16. data/lib/solid_queue_guard/checks/config/puma_colocated_check.rb +5 -11
  17. data/lib/solid_queue_guard/checks/config/queue_schema_check.rb +80 -7
  18. data/lib/solid_queue_guard/checks/registry.rb +8 -2
  19. data/lib/solid_queue_guard/checks/runtime/database_support.rb +5 -2
  20. data/lib/solid_queue_guard/checks/runtime/dispatcher_check.rb +4 -2
  21. data/lib/solid_queue_guard/checks/runtime/failed_jobs_check.rb +1 -1
  22. data/lib/solid_queue_guard/checks/runtime/puma_plugin_runtime_check.rb +39 -0
  23. data/lib/solid_queue_guard/checks/runtime/recurring_stale_check.rb +1 -1
  24. data/lib/solid_queue_guard/checks/runtime/scheduled_backlog_check.rb +1 -1
  25. data/lib/solid_queue_guard/checks/runtime/stale_process_check.rb +1 -1
  26. data/lib/solid_queue_guard/configuration.rb +34 -1
  27. data/lib/solid_queue_guard/http_status_policy.rb +35 -0
  28. data/lib/solid_queue_guard/puma_plugin_support.rb +35 -0
  29. data/lib/solid_queue_guard/recommendations/topology.rb +13 -0
  30. data/lib/solid_queue_guard/runner.rb +10 -1
  31. data/lib/solid_queue_guard/schema/solid_queue_tables.rb +126 -0
  32. data/lib/solid_queue_guard/version.rb +1 -1
  33. data/lib/solid_queue_guard.rb +1 -1
  34. data/solid_queue_guard.gemspec +54 -0
  35. metadata +16 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c3b3fded32011114a722d7207eb15c44dad0d1be1e0c5b3202bdaf32f84ea819
4
- data.tar.gz: 6ef2779a3372987138feb9a2dc9730ba7750c67a544a2c821029988877feb8de
3
+ metadata.gz: e4708571f815d3044a3aa1f952ffe250699e8b695972cf8449b38f53aa1ff4f3
4
+ data.tar.gz: ef314fa6328235a4e8d5174fe42db21a200ebb8ab067b2b6cda125b8a67b433a
5
5
  SHA512:
6
- metadata.gz: 39c815be31c9ec06116840f813f57a6a9ebcb2dcad7c3747bf47d87cb59304fbdc6e629be2ffbb725eb649c913a75409c6b1e39bcb9c3e627ac00707af579e90
7
- data.tar.gz: c338648964e042b7d5fb485c8281bc1337ab54acfe693b886e9f8ed656135aa924fe8cbc89af3382003dafea8844ab01497e4205b92ae474b376b1419751d68d
6
+ metadata.gz: 292e090e0c051b8f76d792070bfef73a33e4a21ba680f23319d85354b9de145fa1363dbd1b74efd19c3b23cf5833595b8bb45720ba19a9f41ae9a1497161fd19
7
+ data.tar.gz: 64b1b5b2a1d9e5535ba1170f1469cdf3ac693a9f358b4386fb22699c1ad03c37aabd49176b66ca2c51a0cd78c57d2f447c87581a6ee2450ebb1e317d80d6295d
data/.gitignore ADDED
@@ -0,0 +1,12 @@
1
+ /.bundle/
2
+ /Gemfile.lock.bak
3
+ /pkg/
4
+ /tmp/
5
+ /*.gem
6
+ /solid_queue_guard-*/
7
+
8
+ /test/dummy/db/*.sqlite3
9
+ /test/dummy/log/*
10
+ !/test/dummy/log/.keep
11
+ /test/dummy/tmp/*
12
+ !/test/dummy/tmp/.keep
data/.rubocop.yml ADDED
@@ -0,0 +1,44 @@
1
+ plugins:
2
+ - rubocop-rails
3
+
4
+ AllCops:
5
+ NewCops: enable
6
+ TargetRubyVersion: 3.1
7
+ SuggestExtensions: false
8
+ Exclude:
9
+ - "gemfiles/**/*"
10
+ - "test/dummy/**/*"
11
+ - "vendor/**/*"
12
+ - "tmp/**/*"
13
+
14
+ Style/Documentation:
15
+ Enabled: false
16
+
17
+ Metrics/BlockLength:
18
+ Exclude:
19
+ - "Rakefile"
20
+ - "*.gemspec"
21
+ - "lib/solid_queue_guard/tasks.rb"
22
+
23
+ Metrics/MethodLength:
24
+ Max: 25
25
+
26
+ Metrics/AbcSize:
27
+ Max: 25
28
+ Exclude:
29
+ - lib/solid_queue_guard/checks/runtime/**/*
30
+
31
+ Gemspec/DevelopmentDependencies:
32
+ Enabled: false
33
+
34
+ Rails/Exit:
35
+ Exclude:
36
+ - "lib/solid_queue_guard/cli.rb"
37
+
38
+ Naming/PredicateMethod:
39
+ Exclude:
40
+ - "lib/solid_queue_guard/tasks.rb"
41
+
42
+ Style/MultilineBlockChain:
43
+ Exclude:
44
+ - "lib/solid_queue_guard/checks/runtime/**/*"
data/.ruby-version ADDED
@@ -0,0 +1 @@
1
+ 3.4.9
data/CHANGELOG.md ADDED
@@ -0,0 +1,88 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ## [1.0.1] - 2026-07-09
9
+
10
+ ### Changed
11
+
12
+ - `QueueSchemaCheck` validates Solid Queue tables in `db/queue_schema.rb`, `db/schema.rb`, `db/structure.sql`, and the queue database instead of requiring `db/queue_schema.rb`
13
+ - README documents operational usage: doctor, CI, HTTP health, and runtime process checks
14
+
15
+ ## [1.0.0] - 2026-07-09
16
+
17
+ ### Added
18
+
19
+ - Stable public API guarantee documented in README
20
+ - Gemspec packaging via `git ls-files` for reproducible releases
21
+
22
+ ### Changed
23
+
24
+ - Deprecations now target removal in `2.0` per semver policy
25
+
26
+ ## [0.8.0] - 2026-07-09
27
+
28
+ ### Added
29
+
30
+ - Configurable HTTP status policy via `degraded_http_status` and `unhealthy_http_status`
31
+ - `solid_queue_guard:install:ci` generator for GitHub Actions doctor workflow
32
+
33
+ ## [0.7.0] - 2026-07-09
34
+
35
+ ### Added
36
+
37
+ - `AsyncSupervisorConfigCheck` for async supervisor mode
38
+ - `PumaPluginRuntimeCheck` for co-located Puma plugin health
39
+ - Async-aware topology pool recommendations
40
+
41
+ ## [0.6.0] - 2026-07-09
42
+
43
+ ### Added
44
+
45
+ - Per-check configuration via `disabled_checks` and `config.checks`
46
+ - Per-check threshold overrides for queue lag, failed jobs, stale processes, and scheduled backlog
47
+
48
+ ## [0.5.0] - 2026-07-09
49
+
50
+ ### Added
51
+
52
+ - `TopologyRecommendationCheck` for automatic `queue.yml` and pool recommendations
53
+ - `SolidQueueGuard::Recommendations::Topology` analyzer
54
+
55
+ ## [0.4.0] - 2026-07-09
56
+
57
+ ### Added
58
+
59
+ - Metrics export via `config.metrics_backends` (`:statsd`, `:prometheus`, `:opentelemetry`)
60
+ - `SolidQueueGuard::Metrics::Exporter` and per-backend exporters
61
+
62
+ ## [0.3.0] - 2026-07-09
63
+
64
+ ### Added
65
+
66
+ - Notification adapters: `:rails_logger`, `:slack`, `:datadog`, `:webhook`
67
+ - Automatic notification delivery on degraded/unhealthy CLI reports via `config.notify_with`
68
+
69
+ ## [0.2.0] - 2026-07-09
70
+
71
+ ### Added
72
+
73
+ - Runtime checks: queue lag, stale processes, dispatcher health, scheduled backlog, blocked jobs, orphaned claims, failed jobs, recurring staleness, paused queue lag, pidfile, finished jobs growth
74
+ - HTTP `/solid_queue_guard/health` endpoint with optional token auth and response caching
75
+ - `health` rake task now runs full runtime scope
76
+ - Terminal report hides skipped runtime checks
77
+ - Optional Rails `/up` integration via `integrate_rails_health`
78
+
79
+ ## [0.1.0] - 2026-07-09
80
+
81
+ ### Added
82
+
83
+ - `solid_queue_guard:doctor` rake task for configuration readiness checks
84
+ - `solid_queue_guard:report` rake task for full diagnostic output
85
+ - `solid_queue_guard:install` generator for the initializer
86
+ - JSON output via `SOLID_QUEUE_GUARD_FORMAT=json` or `doctor[json]`
87
+ - Strict CI mode via `SOLID_QUEUE_GUARD_STRICT=1` or `--strict`
88
+ - Configuration checks: adapter, queue database, `connects_to`, queue schema, thread pool, worker coverage, scheduler, environment flags, process heartbeat thresholds, and Puma co-location
data/Gemfile ADDED
@@ -0,0 +1,8 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ # RuboCop 1.75+ can pull parallel 2.x, which requires Ruby >= 3.3.
8
+ gem 'parallel', '~> 1.26'
data/Gemfile.lock ADDED
@@ -0,0 +1,308 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ solid_queue_guard (1.0.1)
5
+ actionpack (>= 7.1, < 9.0)
6
+ activejob (>= 7.1, < 9.0)
7
+ activerecord (>= 7.1, < 9.0)
8
+ activesupport (>= 7.1, < 9.0)
9
+ railties (>= 7.1, < 9.0)
10
+ solid_queue (>= 1.0, < 2.0)
11
+
12
+ GEM
13
+ remote: https://rubygems.org/
14
+ specs:
15
+ action_text-trix (2.1.19)
16
+ railties
17
+ actioncable (8.1.3)
18
+ actionpack (= 8.1.3)
19
+ activesupport (= 8.1.3)
20
+ nio4r (~> 2.0)
21
+ websocket-driver (>= 0.6.1)
22
+ zeitwerk (~> 2.6)
23
+ actionmailbox (8.1.3)
24
+ actionpack (= 8.1.3)
25
+ activejob (= 8.1.3)
26
+ activerecord (= 8.1.3)
27
+ activestorage (= 8.1.3)
28
+ activesupport (= 8.1.3)
29
+ mail (>= 2.8.0)
30
+ actionmailer (8.1.3)
31
+ actionpack (= 8.1.3)
32
+ actionview (= 8.1.3)
33
+ activejob (= 8.1.3)
34
+ activesupport (= 8.1.3)
35
+ mail (>= 2.8.0)
36
+ rails-dom-testing (~> 2.2)
37
+ actionpack (8.1.3)
38
+ actionview (= 8.1.3)
39
+ activesupport (= 8.1.3)
40
+ nokogiri (>= 1.8.5)
41
+ rack (>= 2.2.4)
42
+ rack-session (>= 1.0.1)
43
+ rack-test (>= 0.6.3)
44
+ rails-dom-testing (~> 2.2)
45
+ rails-html-sanitizer (~> 1.6)
46
+ useragent (~> 0.16)
47
+ actiontext (8.1.3)
48
+ action_text-trix (~> 2.1.15)
49
+ actionpack (= 8.1.3)
50
+ activerecord (= 8.1.3)
51
+ activestorage (= 8.1.3)
52
+ activesupport (= 8.1.3)
53
+ globalid (>= 0.6.0)
54
+ nokogiri (>= 1.8.5)
55
+ actionview (8.1.3)
56
+ activesupport (= 8.1.3)
57
+ builder (~> 3.1)
58
+ erubi (~> 1.11)
59
+ rails-dom-testing (~> 2.2)
60
+ rails-html-sanitizer (~> 1.6)
61
+ activejob (8.1.3)
62
+ activesupport (= 8.1.3)
63
+ globalid (>= 0.3.6)
64
+ activemodel (8.1.3)
65
+ activesupport (= 8.1.3)
66
+ activerecord (8.1.3)
67
+ activemodel (= 8.1.3)
68
+ activesupport (= 8.1.3)
69
+ timeout (>= 0.4.0)
70
+ activestorage (8.1.3)
71
+ actionpack (= 8.1.3)
72
+ activejob (= 8.1.3)
73
+ activerecord (= 8.1.3)
74
+ activesupport (= 8.1.3)
75
+ marcel (~> 1.0)
76
+ activesupport (8.1.3)
77
+ base64
78
+ bigdecimal
79
+ concurrent-ruby (~> 1.0, >= 1.3.1)
80
+ connection_pool (>= 2.2.5)
81
+ drb
82
+ i18n (>= 1.6, < 2)
83
+ json
84
+ logger (>= 1.4.2)
85
+ minitest (>= 5.1)
86
+ securerandom (>= 0.3)
87
+ tzinfo (~> 2.0, >= 2.0.5)
88
+ uri (>= 0.13.1)
89
+ appraisal (2.5.0)
90
+ bundler
91
+ rake
92
+ thor (>= 0.14.0)
93
+ ast (2.4.3)
94
+ base64 (0.3.0)
95
+ bigdecimal (4.1.2)
96
+ builder (3.3.0)
97
+ concurrent-ruby (1.3.7)
98
+ connection_pool (3.0.2)
99
+ crass (1.0.7)
100
+ date (3.5.1)
101
+ debug (1.11.1)
102
+ irb (~> 1.10)
103
+ reline (>= 0.3.8)
104
+ drb (2.2.3)
105
+ erb (6.0.4)
106
+ erubi (1.13.1)
107
+ et-orbi (1.4.0)
108
+ tzinfo
109
+ fugit (1.12.3)
110
+ et-orbi (~> 1.4)
111
+ raabro (~> 1.4)
112
+ globalid (1.4.0)
113
+ activesupport (>= 6.1)
114
+ i18n (1.15.2)
115
+ concurrent-ruby (~> 1.0)
116
+ io-console (0.8.2)
117
+ irb (1.18.0)
118
+ pp (>= 0.6.0)
119
+ prism (>= 1.3.0)
120
+ rdoc (>= 4.0.0)
121
+ reline (>= 0.4.2)
122
+ json (2.20.0)
123
+ language_server-protocol (3.17.0.6)
124
+ lint_roller (1.1.0)
125
+ logger (1.7.0)
126
+ loofah (2.25.1)
127
+ crass (~> 1.0.2)
128
+ nokogiri (>= 1.12.0)
129
+ mail (2.9.1)
130
+ logger
131
+ mini_mime (>= 0.1.1)
132
+ net-imap
133
+ net-pop
134
+ net-smtp
135
+ marcel (1.2.1)
136
+ mini_mime (1.1.5)
137
+ minitest (5.27.0)
138
+ mocha (3.1.0)
139
+ ruby2_keywords (>= 0.0.5)
140
+ net-imap (0.6.4.1)
141
+ date
142
+ net-protocol
143
+ net-pop (0.1.2)
144
+ net-protocol
145
+ net-protocol (0.2.2)
146
+ timeout
147
+ net-smtp (0.5.1)
148
+ net-protocol
149
+ nio4r (2.7.5)
150
+ nokogiri (1.19.4-aarch64-linux-gnu)
151
+ racc (~> 1.4)
152
+ nokogiri (1.19.4-aarch64-linux-musl)
153
+ racc (~> 1.4)
154
+ nokogiri (1.19.4-arm-linux-gnu)
155
+ racc (~> 1.4)
156
+ nokogiri (1.19.4-arm-linux-musl)
157
+ racc (~> 1.4)
158
+ nokogiri (1.19.4-arm64-darwin)
159
+ racc (~> 1.4)
160
+ nokogiri (1.19.4-x86_64-darwin)
161
+ racc (~> 1.4)
162
+ nokogiri (1.19.4-x86_64-linux-gnu)
163
+ racc (~> 1.4)
164
+ nokogiri (1.19.4-x86_64-linux-musl)
165
+ racc (~> 1.4)
166
+ parallel (1.28.0)
167
+ parser (3.3.11.1)
168
+ ast (~> 2.4.1)
169
+ racc
170
+ pp (0.6.4)
171
+ prettyprint
172
+ prettyprint (0.2.0)
173
+ prism (1.9.0)
174
+ puma (8.0.2)
175
+ nio4r (~> 2.0)
176
+ raabro (1.4.0)
177
+ racc (1.8.1)
178
+ rack (3.2.6)
179
+ rack-session (2.1.2)
180
+ base64 (>= 0.1.0)
181
+ rack (>= 3.0.0)
182
+ rack-test (2.2.0)
183
+ rack (>= 1.3)
184
+ rackup (2.3.1)
185
+ rack (>= 3)
186
+ rails (8.1.3)
187
+ actioncable (= 8.1.3)
188
+ actionmailbox (= 8.1.3)
189
+ actionmailer (= 8.1.3)
190
+ actionpack (= 8.1.3)
191
+ actiontext (= 8.1.3)
192
+ actionview (= 8.1.3)
193
+ activejob (= 8.1.3)
194
+ activemodel (= 8.1.3)
195
+ activerecord (= 8.1.3)
196
+ activestorage (= 8.1.3)
197
+ activesupport (= 8.1.3)
198
+ bundler (>= 1.15.0)
199
+ railties (= 8.1.3)
200
+ rails-dom-testing (2.3.0)
201
+ activesupport (>= 5.0.0)
202
+ minitest
203
+ nokogiri (>= 1.6)
204
+ rails-html-sanitizer (1.7.0)
205
+ loofah (~> 2.25)
206
+ nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
207
+ railties (8.1.3)
208
+ actionpack (= 8.1.3)
209
+ activesupport (= 8.1.3)
210
+ irb (~> 1.13)
211
+ rackup (>= 1.0.0)
212
+ rake (>= 12.2)
213
+ thor (~> 1.0, >= 1.2.2)
214
+ tsort (>= 0.2)
215
+ zeitwerk (~> 2.6)
216
+ rainbow (3.1.1)
217
+ rake (13.4.2)
218
+ rbs (4.0.3)
219
+ logger
220
+ prism (>= 1.6.0)
221
+ tsort
222
+ rdoc (8.0.0)
223
+ erb
224
+ prism (>= 1.6.0)
225
+ rbs (>= 4.0.0)
226
+ tsort
227
+ regexp_parser (2.12.0)
228
+ reline (0.6.3)
229
+ io-console (~> 0.5)
230
+ rubocop (1.88.2)
231
+ json (~> 2.3)
232
+ language_server-protocol (~> 3.17.0.2)
233
+ lint_roller (~> 1.1.0)
234
+ parallel (>= 1.10)
235
+ parser (>= 3.3.0.2)
236
+ rainbow (>= 2.2.2, < 4.0)
237
+ regexp_parser (>= 2.9.3, < 3.0)
238
+ rubocop-ast (>= 1.49.0, < 2.0)
239
+ ruby-progressbar (~> 1.7)
240
+ unicode-display_width (>= 2.4.0, < 4.0)
241
+ rubocop-ast (1.50.0)
242
+ parser (>= 3.3.7.2)
243
+ prism (~> 1.7)
244
+ rubocop-rails (2.35.5)
245
+ activesupport (>= 4.2.0)
246
+ lint_roller (~> 1.1)
247
+ rack (>= 1.1)
248
+ rubocop (>= 1.75.0, < 2.0)
249
+ rubocop-ast (>= 1.44.0, < 2.0)
250
+ ruby-progressbar (1.13.0)
251
+ ruby2_keywords (0.0.5)
252
+ securerandom (0.4.1)
253
+ solid_queue (1.4.0)
254
+ activejob (>= 7.1)
255
+ activerecord (>= 7.1)
256
+ concurrent-ruby (>= 1.3.1)
257
+ fugit (~> 1.11)
258
+ railties (>= 7.1)
259
+ thor (>= 1.3.1)
260
+ sqlite3 (2.9.5-aarch64-linux-gnu)
261
+ sqlite3 (2.9.5-aarch64-linux-musl)
262
+ sqlite3 (2.9.5-arm-linux-gnu)
263
+ sqlite3 (2.9.5-arm-linux-musl)
264
+ sqlite3 (2.9.5-arm64-darwin)
265
+ sqlite3 (2.9.5-x86_64-darwin)
266
+ sqlite3 (2.9.5-x86_64-linux-gnu)
267
+ sqlite3 (2.9.5-x86_64-linux-musl)
268
+ thor (1.5.0)
269
+ timeout (0.6.1)
270
+ tsort (0.2.0)
271
+ tzinfo (2.0.6)
272
+ concurrent-ruby (~> 1.0)
273
+ unicode-display_width (3.2.0)
274
+ unicode-emoji (~> 4.1)
275
+ unicode-emoji (4.2.0)
276
+ uri (1.1.1)
277
+ useragent (0.16.11)
278
+ websocket-driver (0.8.2)
279
+ base64
280
+ websocket-extensions (>= 0.1.0)
281
+ websocket-extensions (0.1.5)
282
+ zeitwerk (2.8.2)
283
+
284
+ PLATFORMS
285
+ aarch64-linux-gnu
286
+ aarch64-linux-musl
287
+ arm-linux-gnu
288
+ arm-linux-musl
289
+ arm64-darwin
290
+ x86_64-darwin
291
+ x86_64-linux-gnu
292
+ x86_64-linux-musl
293
+
294
+ DEPENDENCIES
295
+ appraisal (~> 2.5)
296
+ debug
297
+ minitest (~> 5.0)
298
+ mocha (>= 2.1)
299
+ parallel (~> 1.26)
300
+ puma (>= 6.0)
301
+ rails (>= 7.1, < 9.0)
302
+ rubocop (~> 1.75)
303
+ rubocop-rails (~> 2.30)
304
+ solid_queue_guard!
305
+ sqlite3 (~> 2.1)
306
+
307
+ BUNDLED WITH
308
+ 2.7.2