good_job 3.30.1 → 3.99.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: 5ca44ad0fbf6d55478287f58fb49c9295ebcbbb5875ec8c3c2e94859dec23393
4
- data.tar.gz: ded000fbd60a45e9028a97bda6f1dc0240310a7b9281708d15543331a8a19706
3
+ metadata.gz: ad688cdbb78a81f0ec43164332e370dfa1cd1e63be003a8649ae4af3791da8fe
4
+ data.tar.gz: 3dcbc882063ea4085d4c58d4899a6e4dc4ae893220cc38f4648c4e00759bf27f
5
5
  SHA512:
6
- metadata.gz: 4d09ea0dcb8801f3ca577b349e9f671bdf70c4df38ace8b96e9b5bda8f22bc2bc4791a261c4816e2beca82aa17f188c9521f89be4460f4097d5e8a03a4f2c281
7
- data.tar.gz: 73ab002472752c47682c508b4828dfd359e9aebebc997b76f69c91f6cf5dd0ab12a4bc171fbc6f3d967e17b2a4b26a52f6afe311d43dbc90331c565a79443e25
6
+ metadata.gz: 52c1a70e3d0bc608318692cb7875c8736e36412186b3b53b19bd3ce4ea7535afdd63e16b98bdf89d726e80ffb5d17b18b9ff1d0452c44e4812df21cd77cab3b6
7
+ data.tar.gz: eeee619d6aff6be854122b54262eedf5ee732d7e56bec5ff516705643076e340326788e06fc6684d0e819ffd62dda1c9cc767327ad0b9e6e462feecd7467e862
data/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.99.0](https://github.com/bensheldon/good_job/tree/v3.99.0) (2024-07-07)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.30.1...v3.99.0)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Remove deprecation silencers for v3.99 release [\#1395](https://github.com/bensheldon/good_job/pull/1395) ([bensheldon](https://github.com/bensheldon))
10
+ - Add instructions and `GoodJob.v4_ready?` for upgrading to v4 [\#1356](https://github.com/bensheldon/good_job/pull/1356) ([bensheldon](https://github.com/bensheldon))
11
+
3
12
  ## [v3.30.1](https://github.com/bensheldon/good_job/tree/v3.30.1) (2024-07-06)
4
13
 
5
14
  [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.30.0...v3.30.1)
data/README.md CHANGED
@@ -53,6 +53,7 @@ For more of the story of GoodJob, read the [introductory blog post](https://isla
53
53
  - [Batches](#batches)
54
54
  - [Updating](#updating)
55
55
  - [Upgrading minor versions](#upgrading-minor-versions)
56
+ - [Upgrading v3 to v4](#upgrading-v3-to-v4)
56
57
  - [Upgrading v2 to v3](#upgrading-v2-to-v3)
57
58
  - [Upgrading v1 to v2](#upgrading-v1-to-v2)
58
59
  - [Go deeper](#go-deeper)
@@ -873,6 +874,27 @@ To perform upgrades to the GoodJob database tables:
873
874
  1. Commit the migration files and resulting `db/schema.rb` changes.
874
875
  1. Deploy the code, run the migrations against the production database, and restart server/worker processes.
875
876
 
877
+ #### Upgrading v3 to v4
878
+
879
+ GoodJob v4 changes how job and job execution records are stored in the database; moving from job and executions being commingled in the `good_jobs` table to separately and discretely storing job executions in `good_job_executions`. To safely upgrade, all unfinished jobs must use the new format. This change was introduced in GoodJob [v3.15.4 (April 2023)](https://github.com/bensheldon/good_job/releases/tag/v3.15.4), so your application is likely ready-to-upgrade already if you have kept up with GoodJob updates.
880
+
881
+ To upgrade:
882
+
883
+ 1. Upgrade to v3.99.x, following the minor version upgrade process, running any remaining database migrations (rails g good_job:update) and addressing deprecation warnings.
884
+ 1. Check if your application is safe to upgrade to the new job record format by running either:
885
+ - In a production console, run `GoodJob.v4_ready?` which should return `true` when safely upgradable.
886
+ - Or, when connected to the production database verify that `SELECT COUNT(*) FROM "good_jobs" WHERE finished_at IS NULL AND is_discrete IS NOT TRUE` returns `0`
887
+
888
+ If not all unfinished jobs are stored in the new format, either wait to upgrade until those jobs finish or discard them. Not waiting could prevent those jobs from successfully running when upgrading to v4.
889
+ 1. Upgrade from v3.99.x to v4.x.
890
+
891
+ Notable changes:
892
+
893
+ - Only supports Rails 6.1+, CRuby 3.0+ and JRuby 9.4+, Postgres 12+. Rails 6.0 is no longer supported. CRuby 2.6 and 2.7 are no longer supported. JRuby 9.3 is no longer supported.
894
+ - Changes job `priority` to give smaller numbers higher priority (default: `0`), in accordance with Active Job's definition of priority.
895
+ - Enqueues and executes jobs via the `GoodJob::Job` model instead of `GoodJob::Execution`
896
+ - Setting `config.good_job.cleanup_interval_jobs`, `GOOD_JOB_CLEANUP_INTERVAL_JOBS`, `config.good_job.cleanup_interval_seconds`, or `GOOD_JOB_CLEANUP_INTERVAL_SECONDS` to `nil` or `""` no longer disables count- or time-based cleanups. Set to `false` to disable, or `-1` to run a cleanup after every job execution.
897
+
876
898
  #### Upgrading v2 to v3
877
899
 
878
900
  GoodJob v3 is operationally identical to v2; upgrading to GoodJob v3 should be simple. If you are already using `>= v2.9+` no other changes are necessary.
@@ -310,11 +310,10 @@ module GoodJob
310
310
 
311
311
  # Construct arguments for GoodJob::Execution from an ActiveJob instance.
312
312
  def self.enqueue_args(active_job, overrides = {})
313
- if active_job.priority && GoodJob.configuration.smaller_number_is_higher_priority.nil?
313
+ if active_job.priority && GoodJob.configuration.smaller_number_is_higher_priority.in?([nil, false])
314
314
  GoodJob.deprecator.warn(<<~DEPRECATION)
315
315
  The next major version of GoodJob (v4.0) will change job `priority` to give smaller numbers higher priority (default: `0`), in accordance with Active Job's definition of priority.
316
316
  To opt-in to this behavior now, set `config.good_job.smaller_number_is_higher_priority = true` in your GoodJob initializer or application.rb.
317
- To not opt-in yet, but silence this deprecation warning, set `config.good_job.smaller_number_is_higher_priority = false`.
318
317
  DEPRECATION
319
318
  end
320
319
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module GoodJob
4
4
  # GoodJob gem version.
5
- VERSION = '3.30.1'
5
+ VERSION = '3.99.0'
6
6
 
7
7
  # GoodJob version as Gem::Version object
8
8
  GEM_VERSION = Gem::Version.new(VERSION)
data/lib/good_job.rb CHANGED
@@ -269,6 +269,12 @@ module GoodJob
269
269
  end
270
270
  end
271
271
 
272
+ # Tests whether GoodJob can be safely upgraded to v4
273
+ # @return [Boolean]
274
+ def self.v4_ready?
275
+ GoodJob::Job.discrete_support? && GoodJob::Job.where(finished_at: nil).where(is_discrete: [nil, false]).none?
276
+ end
277
+
272
278
  # Deprecator for providing deprecation warnings.
273
279
  # @return [ActiveSupport::Deprecation]
274
280
  def self.deprecator
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: good_job
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.30.1
4
+ version: 3.99.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Sheldon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-07-06 00:00:00.000000000 Z
11
+ date: 2024-07-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob