diff --git a/.rubocop.yml b/.rubocop.yml index d80ecf5d..008996f9 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -5,6 +5,7 @@ require: - rubocop-performance - rubocop-rails - rubocop-rspec + - rubocop-rspec_rails inherit_mode: merge: @@ -29,6 +30,9 @@ AllCops: - lib/good_job/sd_notify.rb NewCops: enable +Capybara/ClickLinkOrButtonStyle: + Enabled: false + Gemspec/DevelopmentDependencies: Enabled: false diff --git a/.ruby-version b/.ruby-version index 619b5376..a0891f56 100644 --- a/.ruby-version +++ b/.ruby-version @@ -1 +1 @@ -3.3.3 +3.3.4 diff --git a/.yard_support.rb b/.yard_support.rb index c92350a7..ac02adfb 100644 --- a/.yard_support.rb +++ b/.yard_support.rb @@ -8,7 +8,7 @@ class KramdownGfmDocument < Kramdown::Document def initialize(source, options = {}) options[:input] = 'GFM' unless options.key?(:input) - super(source, options) + super end end diff --git a/Gemfile b/Gemfile index 85e86495..b0bf5125 100644 --- a/Gemfile +++ b/Gemfile @@ -54,9 +54,11 @@ platforms :ruby do gem "i18n-tasks" gem "mdl" gem "rubocop" + gem "rubocop-capybara" gem "rubocop-performance" gem "rubocop-rails" gem "rubocop-rspec" + gem "rubocop-rspec_rails" gem "sorbet" gem "sorbet-runtime" gem "spoom", require: false diff --git a/Gemfile.lock b/Gemfile.lock index 9a9aec2b..c24489cf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,35 +12,35 @@ PATH GEM remote: https://rubygems.org/ specs: - actioncable (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + 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) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + 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) - actionpack (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activesupport (= 7.1.3) + 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) - actionview (= 7.1.3) - activesupport (= 7.1.3) + actionpack (7.1.3.4) + actionview (= 7.1.3.4) + activesupport (= 7.1.3.4) nokogiri (>= 1.8.5) racc rack (>= 2.2.4) @@ -48,43 +48,43 @@ GEM rack-test (>= 0.6.3) rails-dom-testing (~> 2.2) rails-html-sanitizer (~> 1.6) - actiontext (7.1.3) - actionpack (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + 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) - activesupport (= 7.1.3) + 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) - activesupport (= 7.1.3) + activejob (7.1.3.4) + activesupport (= 7.1.3.4) globalid (>= 0.3.6) - activemodel (7.1.3) - activesupport (= 7.1.3) - activerecord (7.1.3) - activemodel (= 7.1.3) - activesupport (= 7.1.3) + 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) activerecord-explain-analyze (0.1.0) activerecord (>= 4) pg - activerecord-jdbc-adapter (70.1-java) + activerecord-jdbc-adapter (70.2-java) activerecord (~> 7.0) - activerecord-jdbcpostgresql-adapter (70.1-java) - activerecord-jdbc-adapter (= 70.1) + activerecord-jdbcpostgresql-adapter (70.2-java) + activerecord-jdbc-adapter (= 70.2) jdbc-postgres (>= 9.4, < 43) - activestorage (7.1.3) - actionpack (= 7.1.3) - activejob (= 7.1.3) - activerecord (= 7.1.3) - activesupport (= 7.1.3) + 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) + activesupport (7.1.3.4) base64 bigdecimal concurrent-ruby (~> 1.0, >= 1.0.2) @@ -94,49 +94,47 @@ GEM minitest (>= 5.1) mutex_m tzinfo (~> 2.0) - addressable (2.8.6) - public_suffix (>= 2.0.2, < 6.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) - async (2.6.5) - console (~> 1.10) + async (2.14.2) + console (~> 1.25, >= 1.25.2) fiber-annotation - io-event (~> 1.1) - timers (~> 4.1) - async-http (0.61.0) - async (>= 1.25) - async-io (>= 1.28) - async-pool (>= 0.2) - protocol-http (~> 0.25.0) - protocol-http1 (~> 0.16.0) - protocol-http2 (~> 0.15.0) - traces (>= 0.10.0) - async-http-faraday (0.12.0) + io-event (~> 1.6, >= 1.6.5) + async-http (0.69.0) + async (>= 2.10.2) + async-pool (~> 0.7) + io-endpoint (~> 0.11) + io-stream (~> 0.4) + protocol-http (~> 0.26) + protocol-http1 (~> 0.19) + protocol-http2 (~> 0.18) + traces (>= 0.10) + async-http-faraday (0.14.0) async-http (~> 0.42) faraday - async-io (1.36.1) - async - async-pool (0.4.0) + async-pool (0.7.0) async (>= 1.25) base64 (0.2.0) benchmark-ips (2.13.0) - better_html (2.0.2) + better_html (2.1.1) actionview (>= 6.0) activesupport (>= 6.0) ast (~> 2.0) erubi (~> 1.4) parser (>= 2.4) smart_properties - bigdecimal (3.1.6) - bigdecimal (3.1.6-java) + bigdecimal (3.1.8) + bigdecimal (3.1.8-java) bootsnap (1.18.3) msgpack (~> 1.2) brakeman (6.1.2) racc - builder (3.2.4) + builder (3.3.0) capybara (3.40.0) addressable matrix @@ -146,26 +144,26 @@ GEM rack-test (>= 0.6.3) regexp_parser (>= 1.5, < 3.0) xpath (~> 3.2) - chef-utils (18.3.0) + chef-utils (18.5.0) concurrent-ruby concurrent-ruby (1.3.3) connection_pool (2.4.1) - console (1.23.2) + console (1.26.0) fiber-annotation - fiber-local + fiber-local (~> 1.1) + json crass (1.0.6) date (3.3.4) date (3.3.4-java) debug (1.9.2) irb (~> 1.10) reline (>= 0.3.8) - diff-lcs (1.5.0) - dotenv (3.0.0) - dotenv-rails (3.0.0) - dotenv (= 3.0.0) + diff-lcs (1.5.1) + dotenv (3.1.2) + dotenv-rails (3.1.2) + dotenv (= 3.1.2) railties (>= 6.1) - drb (2.2.0) - ruby2_keywords + drb (2.2.1) easy_translate (0.5.1) thread thread_safe @@ -176,21 +174,25 @@ GEM rainbow rubocop smart_properties - erubi (1.12.0) + erubi (1.13.0) et-orbi (1.2.11) tzinfo - faraday (2.7.11) - base64 - faraday-net_http (>= 2.0, < 3.1) - ruby2_keywords (>= 0.0.4) - faraday-http-cache (2.5.0) + faraday (2.10.0) + faraday-net_http (>= 2.0, < 3.2) + logger + faraday-http-cache (2.5.1) faraday (>= 0.8) - faraday-net_http (3.0.2) - ffi (1.16.3) - ffi (1.16.3-java) + faraday-net_http (3.1.0) + net-http + ffi (1.17.0-arm64-darwin) + ffi (1.17.0-java) + ffi (1.17.0-x86_64-darwin) + ffi (1.17.0-x86_64-linux-gnu) fiber-annotation (0.2.0) - fiber-local (1.0.0) - foreman (0.87.2) + fiber-local (1.1.0) + fiber-storage + fiber-storage (0.1.2) + foreman (0.88.1) fugit (1.11.0) et-orbi (~> 1, >= 1.2.11) raabro (~> 1.4) @@ -206,13 +208,13 @@ GEM rake (>= 10.0) globalid (1.2.1) activesupport (>= 6.1) - highline (2.1.0) - i18n (1.14.1) + highline (3.1.0) + reline + i18n (1.14.5) concurrent-ruby (~> 1.0) - i18n-tasks (1.0.13) + i18n-tasks (1.0.14) activesupport (>= 4.0.2) ast (>= 2.1.0) - better_html (>= 1.0, < 3.0) erubi highline (>= 2.0.0) i18n @@ -222,19 +224,22 @@ GEM terminal-table (>= 1.5.1) io-console (0.7.2) io-console (0.7.2-java) - io-event (1.3.3) - irb (1.11.2) - rdoc + io-endpoint (0.13.0) + io-event (1.6.5) + io-stream (0.4.0) + irb (1.14.0) + rdoc (>= 4.0.0) reline (>= 0.4.2) jar-dependencies (0.4.1) jdbc-postgres (42.6.0) - json (2.6.3) - json (2.6.3-java) + json (2.7.2) + json (2.7.2-java) kramdown (2.4.0) rexml kramdown-parser-gfm (1.1.0) kramdown (~> 2.0) language_server-protocol (3.17.0.3) + logger (1.6.0) loofah (2.22.0) crass (~> 1.0.2) nokogiri (>= 1.12.0) @@ -243,7 +248,7 @@ GEM net-imap net-pop net-smtp - marcel (1.0.2) + marcel (1.0.4) matrix (0.4.2) mdl (0.13.0) kramdown (~> 2.3) @@ -251,70 +256,71 @@ GEM mixlib-cli (~> 2.1, >= 2.1.1) mixlib-config (>= 2.2.1, < 4) mixlib-shellout - memory_profiler (1.0.1) + memory_profiler (1.0.2) mini_mime (1.1.5) - minitest (5.22.2) + minitest (5.24.1) mixlib-cli (2.1.8) mixlib-config (3.0.27) tomlrb - mixlib-shellout (3.2.7) + mixlib-shellout (3.2.8) chef-utils msgpack (1.7.2) msgpack (1.7.2-java) multi_json (1.15.0) mutex_m (0.2.0) - net-imap (0.4.10) + net-http (0.4.1) + uri + net-imap (0.4.14) date net-protocol net-pop (0.1.2) net-protocol net-protocol (0.2.2) timeout - net-smtp (0.4.0.1) + net-smtp (0.5.0) net-protocol netrc (0.11.0) - nio4r (2.7.0) - nio4r (2.7.0-java) - nokogiri (1.16.2-arm64-darwin) + nio4r (2.7.3) + nio4r (2.7.3-java) + nokogiri (1.16.6-arm64-darwin) racc (~> 1.4) - nokogiri (1.16.2-java) + nokogiri (1.16.6-java) racc (~> 1.4) - nokogiri (1.16.2-x86_64-darwin) + nokogiri (1.16.6-x86_64-darwin) racc (~> 1.4) - nokogiri (1.16.2-x86_64-linux) + nokogiri (1.16.6-x86_64-linux) racc (~> 1.4) octokit (4.25.1) faraday (>= 1, < 3) sawyer (~> 0.9) optimist (3.1.0) - parallel (1.24.0) - parser (3.3.0.5) + parallel (1.25.1) + parser (3.3.4.0) ast (~> 2.4.1) racc - pg (1.5.4) - prettier_print (1.2.1) + pg (1.5.6) prism (0.30.0) - protocol-hpack (1.4.2) - protocol-http (0.25.0) - protocol-http1 (0.16.0) + protocol-hpack (1.4.3) + protocol-http (0.27.0) + protocol-http1 (0.19.1) protocol-http (~> 0.22) - protocol-http2 (0.15.1) + protocol-http2 (0.18.0) protocol-hpack (~> 1.4) protocol-http (~> 0.18) psych (5.1.2) stringio psych (5.1.2-java) jar-dependencies (>= 0.1.7) - public_suffix (5.0.4) + public_suffix (6.0.0) puma (6.4.2) nio4r (~> 2.0) puma (6.4.2-java) nio4r (~> 2.0) raabro (1.4.0) - racc (1.7.3) - racc (1.7.3-java) - rack (2.2.8.1) - rack-mini-profiler (3.1.1) + racc (1.8.0) + racc (1.8.0-java) + rack (2.2.9) + rack-mini-profiler (3.3.1) rack (>= 1.2.0) rack-session (1.0.2) rack (< 3) @@ -323,20 +329,20 @@ GEM rackup (1.0.0) rack (< 3) webrick - rails (7.1.3) - actioncable (= 7.1.3) - actionmailbox (= 7.1.3) - actionmailer (= 7.1.3) - actionpack (= 7.1.3) - actiontext (= 7.1.3) - actionview (= 7.1.3) - activejob (= 7.1.3) - activemodel (= 7.1.3) - activerecord (= 7.1.3) - activestorage (= 7.1.3) - activesupport (= 7.1.3) + 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) + railties (= 7.1.3.4) rails-dom-testing (2.2.0) activesupport (>= 5.0.0) minitest @@ -344,115 +350,117 @@ GEM rails-html-sanitizer (1.6.0) loofah (~> 2.21) nokogiri (~> 1.14) - rails-i18n (7.0.8) + rails-i18n (7.0.9) i18n (>= 0.7, < 2) railties (>= 6.0.0, < 8) - railties (7.1.3) - actionpack (= 7.1.3) - activesupport (= 7.1.3) + 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.1.0) - rbi (0.1.13) + rake (13.2.1) + rbi (0.1.14) prism (>= 0.18.0, < 1.0.0) sorbet-runtime (>= 0.5.9204) rbtrace (0.5.1) ffi (>= 1.0.6) msgpack (>= 0.4.3) optimist (>= 3.0.0) - rdoc (6.6.2) + rdoc (6.7.0) psych (>= 4.0.0) - regexp_parser (2.9.0) - reline (0.4.2) + regexp_parser (2.9.2) + reline (0.5.9) io-console (~> 0.5) - rexml (3.2.6) - rspec-core (3.12.2) - rspec-support (~> 3.12.0) - rspec-expectations (3.12.3) + rexml (3.3.2) + strscan + rspec-core (3.13.0) + rspec-support (~> 3.13.0) + rspec-expectations (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-mocks (3.12.6) + rspec-support (~> 3.13.0) + rspec-mocks (3.13.1) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.12.0) - rspec-rails (6.1.0) + rspec-support (~> 3.13.0) + rspec-rails (6.1.3) actionpack (>= 6.1) activesupport (>= 6.1) railties (>= 6.1) - rspec-core (~> 3.12) - rspec-expectations (~> 3.12) - rspec-mocks (~> 3.12) - rspec-support (~> 3.12) - rspec-support (3.12.1) - rubocop (1.57.2) + rspec-core (~> 3.13) + rspec-expectations (~> 3.13) + rspec-mocks (~> 3.13) + rspec-support (~> 3.13) + rspec-support (3.13.1) + rubocop (1.65.0) json (~> 2.3) language_server-protocol (>= 3.17.0) parallel (~> 1.10) - parser (>= 3.2.2.4) + parser (>= 3.3.0.2) rainbow (>= 2.2.2, < 4.0) - regexp_parser (>= 1.8, < 3.0) + regexp_parser (>= 2.4, < 3.0) rexml (>= 3.2.5, < 4.0) - rubocop-ast (>= 1.28.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 2.4.0, < 3.0) - rubocop-ast (1.30.0) - parser (>= 3.2.1.0) - rubocop-capybara (2.19.0) + rubocop-ast (1.31.3) + parser (>= 3.3.1.0) + rubocop-capybara (2.21.0) rubocop (~> 1.41) - rubocop-factory_bot (2.24.0) - rubocop (~> 1.33) - rubocop-performance (1.19.1) - rubocop (>= 1.7.0, < 2.0) - rubocop-ast (>= 0.4.0) - rubocop-rails (2.22.1) + rubocop-performance (1.21.1) + rubocop (>= 1.48.1, < 2.0) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rails (2.25.1) activesupport (>= 4.2.0) rack (>= 1.1) rubocop (>= 1.33.0, < 2.0) - rubocop-rspec (2.25.0) - rubocop (~> 1.40) - rubocop-capybara (~> 2.17) - rubocop-factory_bot (~> 2.22) + rubocop-ast (>= 1.31.1, < 2.0) + rubocop-rspec (3.0.3) + rubocop (~> 1.61) + rubocop-rspec_rails (2.30.0) + rubocop (~> 1.61) + rubocop-rspec (~> 3, >= 3.0.1) ruby-progressbar (1.13.0) - ruby2_keywords (0.0.5) rubyzip (2.3.2) sawyer (0.9.2) addressable (>= 2.3.5) faraday (>= 0.17.3, < 3) - selenium-webdriver (4.15.0) + selenium-webdriver (4.22.0) + base64 (~> 0.2) + logger (~> 1.4) rexml (~> 3.2, >= 3.2.5) rubyzip (>= 1.2.2, < 3.0) websocket (~> 1.0) - skylight (6.0.1) + skylight (6.0.4) activesupport (>= 5.2.0) smart_properties (1.17.0) - sorbet (0.5.11288) - sorbet-static (= 0.5.11288) - sorbet-runtime (0.5.11288) - sorbet-static (0.5.11288-java) - sorbet-static (0.5.11288-universal-darwin) - sorbet-static (0.5.11288-x86_64-linux) - sorbet-static-and-runtime (0.5.11288) - sorbet (= 0.5.11288) - sorbet-runtime (= 0.5.11288) - spoom (1.2.4) + sorbet (0.5.11485) + sorbet-static (= 0.5.11485) + sorbet-runtime (0.5.11485) + sorbet-static (0.5.11485-java) + sorbet-static (0.5.11485-universal-darwin) + sorbet-static (0.5.11485-x86_64-linux) + sorbet-static-and-runtime (0.5.11485) + sorbet (= 0.5.11485) + sorbet-runtime (= 0.5.11485) + spoom (1.3.3) erubi (>= 1.10.0) + prism (>= 0.28.0) sorbet-static-and-runtime (>= 0.5.10187) - syntax_tree (>= 6.1.1) thor (>= 0.19.2) - stackprof (0.2.25) - stringio (3.1.0) - syntax_tree (6.2.0) - prettier_print (>= 1.2.0) - tapioca (0.12.0) + stackprof (0.2.26) + stringio (3.1.1) + strscan (3.1.0) + strscan (3.1.0-java) + tapioca (0.15.1) bundler (>= 2.2.25) netrc (>= 0.11.0) parallel (>= 1.21.0) rbi (>= 0.1.4, < 0.2) - sorbet-static-and-runtime (>= 0.5.10820) - spoom (~> 1.2.0, >= 1.2.0) + sorbet-static-and-runtime (>= 0.5.11087) + spoom (>= 1.2.0) thor (>= 1.2.0) yard-sorbet terminal-table (3.0.2) @@ -461,16 +469,16 @@ GEM thread (0.2.2) thread_safe (0.3.6) thread_safe (0.3.6-java) - timecop (0.9.8) + timecop (0.9.10) timeout (0.4.1) - timers (4.3.5) tomlrb (2.0.3) traces (0.11.1) tzinfo (2.0.6) concurrent-ruby (~> 1.0) unicode-display_width (2.5.0) + uri (0.13.0) webrick (1.8.1) - websocket (1.2.10) + websocket (1.2.11) websocket-driver (0.7.6) websocket-extensions (>= 0.1.0) websocket-driver (0.7.6-java) @@ -481,10 +489,10 @@ GEM yard (0.9.36) yard-activesupport-concern (0.0.1) yard (>= 0.8) - yard-sorbet (0.8.1) - sorbet-runtime (>= 0.5) - yard (>= 0.9) - zeitwerk (2.6.13) + yard-sorbet (0.9.0) + sorbet-runtime + yard + zeitwerk (2.6.16) PLATFORMS arm64-darwin-22 @@ -528,9 +536,11 @@ DEPENDENCIES rbtrace rspec-rails rubocop + rubocop-capybara rubocop-performance rubocop-rails rubocop-rspec + rubocop-rspec_rails selenium-webdriver skylight sorbet @@ -544,7 +554,7 @@ DEPENDENCIES yard-activesupport-concern RUBY VERSION - ruby 3.3.3p89 + ruby 3.3.4p94 BUNDLED WITH - 2.5.9 + 2.5.11 diff --git a/app/models/good_job/job.rb b/app/models/good_job/job.rb index a903b55e..0167183f 100644 --- a/app/models/good_job/job.rb +++ b/app/models/good_job/job.rb @@ -604,7 +604,7 @@ def perform(lock_id:) job_class: job_class, queue_name: queue_name, serialized_params: serialized_params, - scheduled_at: (scheduled_at || created_at), + scheduled_at: scheduled_at || created_at, created_at: job_performed_at, process_id: lock_id, } @@ -691,7 +691,7 @@ def perform(lock_id:) end assign_attributes(job_attributes) - preserve_unhandled = (result.unhandled_error && (GoodJob.retry_on_unhandled_error || GoodJob.preserve_job_records == :on_unhandled_error)) + preserve_unhandled = result.unhandled_error && (GoodJob.retry_on_unhandled_error || GoodJob.preserve_job_records == :on_unhandled_error) if finished_at.blank? || GoodJob.preserve_job_records == true || reenqueued || preserve_unhandled || cron_key.present? transaction do execution.save! diff --git a/app/views/good_job/jobs/index.html.erb b/app/views/good_job/jobs/index.html.erb index a2fb9154..157e255a 100644 --- a/app/views/good_job/jobs/index.html.erb +++ b/app/views/good_job/jobs/index.html.erb @@ -7,7 +7,7 @@