Skip to content

Commit

Permalink
Add support for Good Job v4
Browse files Browse the repository at this point in the history
  • Loading branch information
mrrooijen committed Jul 26, 2024
1 parent c0cd0d6 commit 74e7e62
Show file tree
Hide file tree
Showing 19 changed files with 496 additions and 14 deletions.
1 change: 1 addition & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ jobs:
- delayed_job_mongoid_3
- good_job_2
- good_job_3
- good_job_4
- queue_classic_4
- que_0
- que_1
Expand Down
6 changes: 6 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ appraise "good_job_3" do
gem "good_job", "~> 3", require: false
end

appraise "good_job_4" do
gem "pg"
gem "rails", "~> 7"
gem "good_job", "~> 4", require: false
end

appraise "queue_classic_4" do
gem "pg"
gem "rails", "~> 7"
Expand Down
2 changes: 1 addition & 1 deletion Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ APPRAISAL_VERSIONS = {
"solid_queue" => %w[0],
"sidekiq" => %w[6 7],
"bunny" => %w[2],
"good_job" => %w[2 3],
"good_job" => %w[2 3 4],
"delayed_job_active_record" => %w[4],
"delayed_job_mongoid" => %w[3],
"queue_classic" => %w[4],
Expand Down
20 changes: 20 additions & 0 deletions gemfiles/good_job_4.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "debug"
gem "rake"
gem "standardrb"
gem "minitest"
gem "webmock"
gem "mocha"
gem "timecop"
gem "yard"
gem "rack"
gem "webrick"
gem "simplecov", require: false
gem "pg"
gem "rails", "~> 7"
gem "good_job", "~> 4", require: false

gemspec path: "../"
291 changes: 291 additions & 0 deletions gemfiles/good_job_4.gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,291 @@
PATH
remote: ..
specs:
hirefire-resource (1.0.3)

GEM
remote: https://rubygems.org/
specs:
actioncable (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
nio4r (~> 2.0)
websocket-driver (>= 0.6.1)
zeitwerk (~> 2.6)
actionmailbox (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (>= 2.7.1)
net-imap
net-pop
net-smtp
actionmailer (7.1.3.4)
actionpack (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activesupport (= 7.1.3.4)
mail (~> 2.5, >= 2.5.4)
net-imap
net-pop
net-smtp
rails-dom-testing (~> 2.2)
actionpack (7.1.3.4)
actionview (= 7.1.3.4)
activesupport (= 7.1.3.4)
nokogiri (>= 1.8.5)
racc
rack (>= 2.2.4)
rack-session (>= 1.0.1)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
actiontext (7.1.3.4)
actionpack (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
globalid (>= 0.6.0)
nokogiri (>= 1.8.5)
actionview (7.1.3.4)
activesupport (= 7.1.3.4)
builder (~> 3.1)
erubi (~> 1.11)
rails-dom-testing (~> 2.2)
rails-html-sanitizer (~> 1.6)
activejob (7.1.3.4)
activesupport (= 7.1.3.4)
globalid (>= 0.3.6)
activemodel (7.1.3.4)
activesupport (= 7.1.3.4)
activerecord (7.1.3.4)
activemodel (= 7.1.3.4)
activesupport (= 7.1.3.4)
timeout (>= 0.4.0)
activestorage (7.1.3.4)
actionpack (= 7.1.3.4)
activejob (= 7.1.3.4)
activerecord (= 7.1.3.4)
activesupport (= 7.1.3.4)
marcel (~> 1.0)
activesupport (7.1.3.4)
base64
bigdecimal
concurrent-ruby (~> 1.0, >= 1.0.2)
connection_pool (>= 2.2.5)
drb
i18n (>= 1.6, < 2)
minitest (>= 5.1)
mutex_m
tzinfo (~> 2.0)
addressable (2.8.7)
public_suffix (>= 2.0.2, < 7.0)
appraisal (2.5.0)
bundler
rake
thor (>= 0.14.0)
ast (2.4.2)
base64 (0.2.0)
bigdecimal (3.1.8)
builder (3.3.0)
concurrent-ruby (1.3.3)
connection_pool (2.4.1)
crack (1.0.0)
bigdecimal
rexml
crass (1.0.6)
date (3.3.4)
debug (1.9.2)
irb (~> 1.10)
reline (>= 0.3.8)
docile (1.4.0)
drb (2.2.1)
erubi (1.13.0)
et-orbi (1.2.11)
tzinfo
fugit (1.11.0)
et-orbi (~> 1, >= 1.2.11)
raabro (~> 1.4)
globalid (1.2.1)
activesupport (>= 6.1)
good_job (4.1.0)
activejob (>= 6.1.0)
activerecord (>= 6.1.0)
concurrent-ruby (>= 1.3.1)
fugit (>= 1.11.0)
railties (>= 6.1.0)
thor (>= 1.0.0)
hashdiff (1.1.0)
i18n (1.14.5)
concurrent-ruby (~> 1.0)
io-console (0.7.2)
irb (1.14.0)
rdoc (>= 4.0.0)
reline (>= 0.4.2)
json (2.7.2)
language_server-protocol (3.17.0.3)
lint_roller (1.1.0)
loofah (2.22.0)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
mail (2.8.1)
mini_mime (>= 0.1.1)
net-imap
net-pop
net-smtp
marcel (1.0.4)
mini_mime (1.1.5)
minitest (5.24.1)
mocha (2.3.0)
ruby2_keywords (>= 0.0.5)
mutex_m (0.2.0)
net-imap (0.4.14)
date
net-protocol
net-pop (0.1.2)
net-protocol
net-protocol (0.2.2)
timeout
net-smtp (0.5.0)
net-protocol
nio4r (2.7.3)
nokogiri (1.16.6-arm64-darwin)
racc (~> 1.4)
parallel (1.24.0)
parser (3.3.2.0)
ast (~> 2.4.1)
racc
pg (1.5.6)
psych (5.1.2)
stringio
public_suffix (6.0.1)
raabro (1.4.0)
racc (1.8.0)
rack (3.1.7)
rack-session (2.0.0)
rack (>= 3.0.0)
rack-test (2.1.0)
rack (>= 1.3)
rackup (2.1.0)
rack (>= 3)
webrick (~> 1.8)
rails (7.1.3.4)
actioncable (= 7.1.3.4)
actionmailbox (= 7.1.3.4)
actionmailer (= 7.1.3.4)
actionpack (= 7.1.3.4)
actiontext (= 7.1.3.4)
actionview (= 7.1.3.4)
activejob (= 7.1.3.4)
activemodel (= 7.1.3.4)
activerecord (= 7.1.3.4)
activestorage (= 7.1.3.4)
activesupport (= 7.1.3.4)
bundler (>= 1.15.0)
railties (= 7.1.3.4)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.1.3.4)
actionpack (= 7.1.3.4)
activesupport (= 7.1.3.4)
irb
rackup (>= 1.0.0)
rake (>= 12.2)
thor (~> 1.0, >= 1.2.2)
zeitwerk (~> 2.6)
rainbow (3.1.1)
rake (13.2.1)
rdoc (6.7.0)
psych (>= 4.0.0)
regexp_parser (2.9.2)
reline (0.5.9)
io-console (~> 0.5)
rexml (3.3.2)
strscan
rubocop (1.63.5)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 1.8, < 3.0)
rexml (>= 3.2.5, < 4.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.31.3)
parser (>= 3.3.1.0)
rubocop-performance (1.21.0)
rubocop (>= 1.48.1, < 2.0)
rubocop-ast (>= 1.31.1, < 2.0)
ruby-progressbar (1.13.0)
ruby2_keywords (0.0.5)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
standard (1.36.0)
language_server-protocol (~> 3.17.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.63.0)
standard-custom (~> 1.0.0)
standard-performance (~> 1.4)
standard-custom (1.0.2)
lint_roller (~> 1.0)
rubocop (~> 1.50)
standard-performance (1.4.0)
lint_roller (~> 1.1)
rubocop-performance (~> 1.21.0)
standardrb (1.0.1)
standard
stringio (3.1.1)
strscan (3.1.0)
thor (1.3.1)
timecop (0.9.8)
timeout (0.4.1)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unicode-display_width (2.5.0)
webmock (3.23.1)
addressable (>= 2.8.0)
crack (>= 0.3.2)
hashdiff (>= 0.4.0, < 2.0.0)
webrick (1.8.1)
websocket-driver (0.7.6)
websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.5)
yard (0.9.36)
zeitwerk (2.6.16)

PLATFORMS
arm64-darwin-23

DEPENDENCIES
appraisal (~> 2)
debug
good_job (~> 4)
hirefire-resource!
minitest
mocha
pg
rack
rails (~> 7)
rake
simplecov
standardrb
timecop
webmock
webrick
yard

BUNDLED WITH
2.4.7
7 changes: 5 additions & 2 deletions lib/hirefire/macro/deprecated/good_job.rb
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
# frozen_string_literal: true

require "hirefire/macro/helpers/good_job"

module HireFire
module Macro
module Deprecated
# Provides backward compatibility with the deprecated GoodJob macro.
# For new implementations, refer to {HireFire::Macro::GoodJob}.
module GoodJob
include HireFire::Macro::Helpers::GoodJob

# Retrieves the total number of jobs in the specified queue(s) using GoodJob.
#
# This method queries the PostgreSQL database through GoodJob. It's capable
Expand All @@ -21,8 +25,7 @@ module GoodJob
# @example Counting jobs in the "default" queue
# HireFire::Macro::GoodJob.queue("default")
def queue(*queues)
base_class = defined?(::GoodJob::Execution) ? ::GoodJob::Execution : ::GoodJob::Job
scope = base_class.only_scheduled.unfinished
scope = good_job_class.only_scheduled.unfinished
scope = scope.where(queue_name: queues) if queues.any?
scope.count
end
Expand Down
Loading

0 comments on commit 74e7e62

Please sign in to comment.