good_job 3.30.1 → 3.99.1

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: 7dd2e7c483f6ded0e42c21101bd4e7e0ff7e3ac75cdc47855f215b1484ead2bd
4
+ data.tar.gz: c74390ec62b82ba8b2281b6b14ea241726e75ad9bc1669ddf06f35511acda998
5
5
  SHA512:
6
- metadata.gz: 4d09ea0dcb8801f3ca577b349e9f671bdf70c4df38ace8b96e9b5bda8f22bc2bc4791a261c4816e2beca82aa17f188c9521f89be4460f4097d5e8a03a4f2c281
7
- data.tar.gz: 73ab002472752c47682c508b4828dfd359e9aebebc997b76f69c91f6cf5dd0ab12a4bc171fbc6f3d967e17b2a4b26a52f6afe311d43dbc90331c565a79443e25
6
+ metadata.gz: 7de33180257e794e418416b7f83ab00fa64121e64a69a6be46e7c86301cbf750b4ae5ee7851aad02501d48ca64baf38d94782ab89852ae4a79e55870c76df5e3
7
+ data.tar.gz: 36bc0111ecba9df0e983e44c2c418325b745fcc90fa8295d71da44ff4d63ad6fed733760e6355aa3f18a663d3d0d4d9df75cfac23f97cc2a2964b29fe4d5d99c
data/CHANGELOG.md CHANGED
@@ -1,5 +1,83 @@
1
1
  # Changelog
2
2
 
3
+ ## [v3.99.1](https://github.com/bensheldon/good_job/tree/v3.99.1) (2024-07-10)
4
+
5
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.0.3...v3.99.1)
6
+
7
+ **Merged pull requests:**
8
+
9
+ - Add a little more wording to the v4 "ready to upgrade" instructions [\#1415](https://github.com/bensheldon/good_job/pull/1415) ([bensheldon](https://github.com/bensheldon))
10
+
11
+ ## [v4.0.3](https://github.com/bensheldon/good_job/tree/v4.0.3) (2024-07-10)
12
+
13
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.0.2...v4.0.3)
14
+
15
+ **Fixed bugs:**
16
+
17
+ - Only set duration attribute to interval on Rails 6.1 [\#1412](https://github.com/bensheldon/good_job/pull/1412) ([bdewater-thatch](https://github.com/bdewater-thatch))
18
+
19
+ **Closed issues:**
20
+
21
+ - GoodJob error: TypeError: can't cast ActiveSupport::Duration \(on v4.0.0\) [\#1413](https://github.com/bensheldon/good_job/issues/1413)
22
+ - Question: is it possible to clean a set of scheduled jobs \(by class name\) from console? [\#1410](https://github.com/bensheldon/good_job/issues/1410)
23
+ - "Couldn't find GoodJob::BatchRecord" error [\#1387](https://github.com/bensheldon/good_job/issues/1387)
24
+ - Empty alerts "\[\]"? [\#1372](https://github.com/bensheldon/good_job/issues/1372)
25
+ - Release GoodJob 4.0 [\#764](https://github.com/bensheldon/good_job/issues/764)
26
+
27
+ **Merged pull requests:**
28
+
29
+ - Add Active Support load hooks for Job and \(Discrete\)Execution; move all outside class definition bodies [\#1414](https://github.com/bensheldon/good_job/pull/1414) ([bensheldon](https://github.com/bensheldon))
30
+
31
+ ## [v4.0.2](https://github.com/bensheldon/good_job/tree/v4.0.2) (2024-07-08)
32
+
33
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.0.1...v4.0.2)
34
+
35
+ **Fixed bugs:**
36
+
37
+ - Fix a rails 6.1 deprecation warning for the duration attribute [\#1408](https://github.com/bensheldon/good_job/pull/1408) ([Earlopain](https://github.com/Earlopain))
38
+ - Actually remove deprecated configuration for `cleanup_interval_seconds`, `cleanup_interval_jobs`; remove deprecated `Lockable` [\#1406](https://github.com/bensheldon/good_job/pull/1406) ([bensheldon](https://github.com/bensheldon))
39
+
40
+ **Closed issues:**
41
+
42
+ - PG::UndefinedColumn: ERROR: column good\_job\_processes.lock\_type does not exist [\#1405](https://github.com/bensheldon/good_job/issues/1405)
43
+ - undefined method `duration=' for an instance of GoodJob::Execution [\#1404](https://github.com/bensheldon/good_job/issues/1404)
44
+ - v3 deprecations are still present [\#1399](https://github.com/bensheldon/good_job/issues/1399)
45
+
46
+ **Merged pull requests:**
47
+
48
+ - Fix Batch integration test to not exhaust database connection thread pool [\#1409](https://github.com/bensheldon/good_job/pull/1409) ([bensheldon](https://github.com/bensheldon))
49
+ - Discrete cleanup [\#1401](https://github.com/bensheldon/good_job/pull/1401) ([Earlopain](https://github.com/Earlopain))
50
+
51
+ ## [v4.0.1](https://github.com/bensheldon/good_job/tree/v4.0.1) (2024-07-08)
52
+
53
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v4.0.0...v4.0.1)
54
+
55
+ **Fixed bugs:**
56
+
57
+ - Actually change `smaller_number_is_higher_priority` for v4 [\#1402](https://github.com/bensheldon/good_job/pull/1402) ([Earlopain](https://github.com/Earlopain))
58
+
59
+ **Merged pull requests:**
60
+
61
+ - Bump prism/rbi dev dependency [\#1403](https://github.com/bensheldon/good_job/pull/1403) ([Earlopain](https://github.com/Earlopain))
62
+ - Use index action for the performance controller [\#1398](https://github.com/bensheldon/good_job/pull/1398) ([Earlopain](https://github.com/Earlopain))
63
+
64
+ ## [v4.0.0](https://github.com/bensheldon/good_job/tree/v4.0.0) (2024-07-07)
65
+
66
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.99.0...v4.0.0)
67
+
68
+ **Implemented enhancements:**
69
+
70
+ - Release GoodJob v4 [\#1394](https://github.com/bensheldon/good_job/pull/1394) ([bensheldon](https://github.com/bensheldon))
71
+
72
+ ## [v3.99.0](https://github.com/bensheldon/good_job/tree/v3.99.0) (2024-07-07)
73
+
74
+ [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.30.1...v3.99.0)
75
+
76
+ **Merged pull requests:**
77
+
78
+ - Remove deprecation silencers for v3.99 release [\#1395](https://github.com/bensheldon/good_job/pull/1395) ([bensheldon](https://github.com/bensheldon))
79
+ - Add instructions and `GoodJob.v4_ready?` for upgrading to v4 [\#1356](https://github.com/bensheldon/good_job/pull/1356) ([bensheldon](https://github.com/bensheldon))
80
+
3
81
  ## [v3.30.1](https://github.com/bensheldon/good_job/tree/v3.30.1) (2024-07-06)
4
82
 
5
83
  [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.1'
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.migrated? && 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.1
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-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activejob