diff --git a/CHANGELOG.md b/CHANGELOG.md index 56e829048..803b8b4e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,29 @@ # Changelog -## [v3.12.7](https://github.com/bensheldon/good_job/tree/v3.12.7) (2023-03-01) +## [v3.12.8](https://github.com/bensheldon/good_job/tree/v3.12.8) (2023-03-06) -[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.6...v3.12.7) +[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.7...v3.12.8) **Fixed bugs:** -- Rename "assets" to "frontends" to avoid Asset Pipeline collisions [\#874](https://github.com/bensheldon/good_job/pull/874) ([bensheldon](https://github.com/bensheldon)) +- Add `raise: false` to FrontendsController after action skip [\#881](https://github.com/bensheldon/good_job/pull/881) ([simi](https://github.com/simi)) **Closed issues:** - GoodJob's JavaScript takes precedence over application's JavaScript in GoodJob 3.12.6, Rails 7 [\#873](https://github.com/bensheldon/good_job/issues/873) +**Merged pull requests:** + +- Rewrite flaky tests: don't allow nil timeout for restart [\#872](https://github.com/bensheldon/good_job/pull/872) ([bensheldon](https://github.com/bensheldon)) + +## [v3.12.7](https://github.com/bensheldon/good_job/tree/v3.12.7) (2023-03-01) + +[Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.6...v3.12.7) + +**Fixed bugs:** + +- Rename "assets" to "frontends" to avoid Asset Pipeline collisions [\#874](https://github.com/bensheldon/good_job/pull/874) ([bensheldon](https://github.com/bensheldon)) + ## [v3.12.6](https://github.com/bensheldon/good_job/tree/v3.12.6) (2023-03-01) [Full Changelog](https://github.com/bensheldon/good_job/compare/v3.12.5...v3.12.6) @@ -158,7 +170,7 @@ **Closed issues:** -- Support for Ruby 3.2 [\#785](https://github.com/bensheldon/good_job/issues/785) +- Support for Rails 6.1 / Ruby 3.2 [\#785](https://github.com/bensheldon/good_job/issues/785) - Custom table names [\#748](https://github.com/bensheldon/good_job/issues/748) - Health check issue with cron scheduler job [\#741](https://github.com/bensheldon/good_job/issues/741) diff --git a/Gemfile.lock b/Gemfile.lock index f1a301c4d..cf10c67ec 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -11,7 +11,7 @@ GIT PATH remote: . specs: - good_job (3.12.7) + good_job (3.12.8) activejob (>= 6.0.0) activerecord (>= 6.0.0) concurrent-ruby (>= 1.0.2) diff --git a/app/controllers/good_job/frontends_controller.rb b/app/controllers/good_job/frontends_controller.rb index 97c1a8e6c..dc1eecabc 100644 --- a/app/controllers/good_job/frontends_controller.rb +++ b/app/controllers/good_job/frontends_controller.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module GoodJob class FrontendsController < ActionController::Base # rubocop:disable Rails/ApplicationController - skip_after_action :verify_same_origin_request + skip_after_action :verify_same_origin_request, raise: false STATIC_ASSETS = { css: { diff --git a/app/filters/good_job/jobs_filter.rb b/app/filters/good_job/jobs_filter.rb index d8985943a..788a861df 100644 --- a/app/filters/good_job/jobs_filter.rb +++ b/app/filters/good_job/jobs_filter.rb @@ -2,15 +2,17 @@ module GoodJob class JobsFilter < BaseFilter def states - query = filtered_query(params.except(:state)) - { - 'scheduled' => query.scheduled.count, - 'retried' => query.retried.count, - 'queued' => query.queued.count, - 'running' => query.running.count, - 'succeeded' => query.succeeded.count, - 'discarded' => query.discarded.count, - } + @_states ||= begin + query = filtered_query(params.except(:state)) + { + 'scheduled' => query.scheduled.count, + 'retried' => query.retried.count, + 'queued' => query.queued.count, + 'running' => query.running.count, + 'succeeded' => query.succeeded.count, + 'discarded' => query.discarded.count, + } + end end def filtered_query(filter_params = params) @@ -42,13 +44,13 @@ def filtered_query(filter_params = params) end def filtered_count - filtered_query.unscope(:select).count + @_filtered_count ||= filtered_query.unscope(:select).count end private def query_for_records - filtered_query.includes(:executions).includes_advisory_locks + filtered_query.includes_advisory_locks end def default_base_query diff --git a/app/models/good_job/job.rb b/app/models/good_job/job.rb index e8b27619b..53b3e17eb 100644 --- a/app/models/good_job/job.rb +++ b/app/models/good_job/job.rb @@ -136,6 +136,16 @@ def recent_error error || executions[-2]&.error end + # Errors for the job to be displayed in the Dashboard. + # @return [String] + def display_error + return error if error.present? + + serialized_params.fetch('exception_executions', {}).map do |exception, count| + "#{exception}: #{count}" + end.join(', ') + end + # Return formatted serialized_params for display in the dashboard # @return [Hash] def display_serialized_params diff --git a/app/views/good_job/jobs/_table.erb b/app/views/good_job/jobs/_table.erb index 2f88ab8ed..a85115df6 100644 --- a/app/views/good_job/jobs/_table.erb +++ b/app/views/good_job/jobs/_table.erb @@ -82,7 +82,7 @@ bs_toggle: "popover", bs_trigger: "hover focus click", bs_placement: "bottom", - bs_content: job.recent_error + bs_content: job.display_error, } %> <% else %> <%= job.executions_count %> diff --git a/checksums/good_job-3.12.8.gem.sha256 b/checksums/good_job-3.12.8.gem.sha256 new file mode 100644 index 000000000..c00e4c29a --- /dev/null +++ b/checksums/good_job-3.12.8.gem.sha256 @@ -0,0 +1 @@ +377a14263d4267188b0850ee7dcbb206554ef76aac0da8a97f69a2df9072cc9e diff --git a/checksums/good_job-3.12.8.gem.sha512 b/checksums/good_job-3.12.8.gem.sha512 new file mode 100644 index 000000000..346b9ae96 --- /dev/null +++ b/checksums/good_job-3.12.8.gem.sha512 @@ -0,0 +1 @@ +86c678d673443e2aaf1d4966bc4c11f8f06f35c37f3c797584265f7c2e37399e12fff816713e98a4e75efca9da43beca9a4b3b500ee2507be937f0bcc6615821 diff --git a/lib/good_job/version.rb b/lib/good_job/version.rb index a8d249a20..397380ba2 100644 --- a/lib/good_job/version.rb +++ b/lib/good_job/version.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true module GoodJob # GoodJob gem version. - VERSION = '3.12.7' + VERSION = '3.12.8' end diff --git a/spec/test_app/config/initializers/rack_mini_profiler.rb b/spec/test_app/config/initializers/rack_mini_profiler.rb index 73df60f39..fc75d7eae 100644 --- a/spec/test_app/config/initializers/rack_mini_profiler.rb +++ b/spec/test_app/config/initializers/rack_mini_profiler.rb @@ -1,6 +1,6 @@ if defined?(Rack::MiniProfiler) Rack::MiniProfiler.config.skip_paths.push( "/favicon.ico", - "/good_job/assets/" + "/good_job/frontend/" ) end