deployangel 0.1.22 → 0.1.23

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: edccb6c72eff7d259c14c59deaa403fb78c890cb091b40d59b080623945e1e9f
4
- data.tar.gz: 364fd681c6199d591292fc67799cb6f7933da99736113ef382ff4ccf628697f8
3
+ metadata.gz: 2635666118ec2250b5414245e3ea0aa1026d30e4369788e2c82bf6e6b0a52f71
4
+ data.tar.gz: 0fac6aa9bf419e2ad7a93a289902c94fa94a6d0b42c1418d7370afbaf90501cd
5
5
  SHA512:
6
- metadata.gz: 0ec79d7a8b20600e3fc57604b990749ff578a6b39bdd2caf945c8f60bf5f39ed74f3991659f8d3e26c851e8a7509cc4dabca339f36f35aaa79aca33648ba4c9d
7
- data.tar.gz: 37db580510184b407f7941e6c27ad00eb956fab8df6fb59a68406753c14813bca7007de9da53ca7cf9a858f456d40f2a5da2fdd872c44bdd33997b052132ba2c
6
+ metadata.gz: 41f77d3e77fae4bccf35c82570582e01501246314c540d6bf6d227cdcd15e033237d62d9b0b2769e80766f53293982b4e8fe07e644ced1e99d93ca13a57b93f2
7
+ data.tar.gz: 674cb4c4972c88d861375904572c1048f247f041400c52b8d5380f44b3ff76d8b6f473362b404bedcf2377e1b6811cf96eea39f5cb9934b07271ddd627376afa
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.1.23 (2026-10-09)
4
+
5
+ - GoodJob's cron (`config.good_job.cron`, or `GOOD_JOB_CRON`) is read from
6
+ the processes that run it, so its jobs are expected on schedule. Entries
7
+ whose schedule or class is a lambda, or that are off by default, are
8
+ left out; schedules without a zone are read in the server's.
9
+
3
10
  ## 0.1.22 (2026-10-09)
4
11
 
5
12
  - Work scheduled outside the app's own scheduler is watched too.
data/README.md CHANGED
@@ -98,7 +98,8 @@ the dashboard says so.
98
98
  as it is. If your app's messages might hold personal or health data, [turn
99
99
  messages off](#exception-messages).
100
100
  - Once per process: the route table, job classes, recurring schedules
101
- declared for Solid Queue, sidekiq-cron, or sidekiq-scheduler, critical
101
+ declared for Solid Queue, GoodJob, sidekiq-cron, sidekiq-scheduler, or
102
+ whenever, critical
102
103
  flows, and file digests (relative paths and hashes, never file contents) so
103
104
  DeployAngel can tell which routes changed in a release.
104
105
  Disable digests with `DEPLOYANGEL_FILE_DIGESTS=false`.
@@ -210,6 +211,13 @@ end
210
211
  Jobs that exist only in Redis, such as ones created in code or in the
211
212
  Sidekiq web UI, aren't read.
212
213
 
214
+ GoodJob's cron (`config.good_job.cron`, or `GOOD_JOB_CRON`) is read from the
215
+ processes that run it, the ones with cron enabled. Schedules without a zone
216
+ are read in the server's, as GoodJob reads them. An entry whose `cron:` or
217
+ `class:` is a lambda, or that's `enabled_by_default: false`, isn't expected.
218
+ The agent doesn't see entries turned off in GoodJob's dashboard, so one you
219
+ switch off there will look missed after the next deploy.
220
+
213
221
  #### Cron, Heroku Scheduler, and whenever
214
222
 
215
223
  Work that something outside the app starts on a schedule, such as cron,
@@ -3,7 +3,7 @@
3
3
  module DeployAngel
4
4
  module Rails
5
5
  # The Rails adapter: the route table from the router, job classes from
6
- # Active Job, and Solid Queue's recurring tasks. The schedule files
6
+ # Active Job, and Solid Queue's and GoodJob's recurring tasks. The schedule files
7
7
  # sidekiq-cron and sidekiq-scheduler read, and the file digests, are
8
8
  # gathered in DeployAngel::Metadata.
9
9
  class Metadata < ::DeployAngel::Metadata
@@ -44,10 +44,10 @@ module DeployAngel
44
44
  []
45
45
  end
46
46
 
47
- # Solid Queue's schedule is Rails' own; the rest are read the same way
48
- # on every framework.
47
+ # Solid Queue's and GoodJob's schedules live in the Rails app; the rest
48
+ # are read the same way on every framework.
49
49
  def schedules
50
- solid_queue_schedules + super
50
+ solid_queue_schedules + good_job_schedules + super
51
51
  end
52
52
 
53
53
  # Solid Queue recurring tasks for the current environment.
@@ -69,6 +69,33 @@ module DeployAngel
69
69
  []
70
70
  end
71
71
 
72
+ # GoodJob's cron, from a process that runs it. GoodJob turns cron on
73
+ # per process (often only the worker's, with GOOD_JOB_ENABLE_CRON), and
74
+ # its CLI applies --enable-cron after boot, before metadata is first
75
+ # sent. A schedule without a zone is read in the server's, as Fugit
76
+ # reads it. A schedule or class given as a lambda can't be known
77
+ # without running app code, so it's left out.
78
+ def good_job_schedules
79
+ return [] unless defined?(::GoodJob) && ::GoodJob.respond_to?(:configuration)
80
+
81
+ configuration = ::GoodJob.configuration
82
+ return [] unless configuration.enable_cron?
83
+
84
+ configuration.cron.filter_map do |key, entry|
85
+ next unless entry.is_a?(Hash)
86
+
87
+ entry = entry.transform_keys(&:to_sym)
88
+ cron, job_class = entry.values_at(:cron, :class)
89
+ job_class = job_class.name if job_class.is_a?(Module)
90
+ next if entry[:enabled_by_default] == false
91
+ next unless cron.is_a?(String) && !cron.strip.empty? && job_class.is_a?(String) && !job_class.empty?
92
+
93
+ { "key" => key.to_s, "class" => job_class, "schedule" => cron, "source" => "good_job", "time_zone" => local_time_zone }
94
+ end
95
+ rescue StandardError
96
+ []
97
+ end
98
+
72
99
  # A command task runs as a job of this class, so its runs show up in
73
100
  # job telemetry under that name.
74
101
  def command_job_class
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module DeployAngel
4
- VERSION = "0.1.22"
4
+ VERSION = "0.1.23"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: deployangel
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.22
4
+ version: 0.1.23
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jordan Owens