From 1250f04a9fa41a09fa00111dd1668c91be434b2d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 6 Jan 2024 11:36:54 +0100 Subject: [PATCH] Bump good_job from 3.21.5 to 3.22.0 (#523) * Bump good_job from 3.21.5 to 3.22.0 Bumps [good_job](https://github.com/bensheldon/good_job) from 3.21.5 to 3.22.0. - [Release notes](https://github.com/bensheldon/good_job/releases) - [Changelog](https://github.com/bensheldon/good_job/blob/main/CHANGELOG.md) - [Commits](https://github.com/bensheldon/good_job/compare/v3.21.5...v3.22.0) --- updated-dependencies: - dependency-name: good_job dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] * Update gemset.nix * add and run good_job migrations --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: dependabot[bot] Co-authored-by: Charlotte Van Petegem --- Gemfile | 2 +- Gemfile.lock | 6 ++--- .../20240106103259_create_good_job_labels.rb | 15 +++++++++++++ ...0106103260_create_good_job_labels_index.rb | 22 +++++++++++++++++++ ...6103261_remove_good_job_active_id_index.rb | 21 ++++++++++++++++++ db/schema.rb | 5 +++-- gemset.nix | 8 +++---- 7 files changed, 69 insertions(+), 10 deletions(-) create mode 100644 db/migrate/20240106103259_create_good_job_labels.rb create mode 100644 db/migrate/20240106103260_create_good_job_labels_index.rb create mode 100644 db/migrate/20240106103261_remove_good_job_active_id_index.rb diff --git a/Gemfile b/Gemfile index 61212359..cb5dd428 100644 --- a/Gemfile +++ b/Gemfile @@ -15,7 +15,7 @@ gem 'active_model_serializers', '~> 0.10' gem 'bcrypt', '~> 3.1' # Use GoodJob as our Active Job queue adapter -gem 'good_job', '~> 3.21' +gem 'good_job', '~> 3.22' gem 'wahwah', '~> 1.5.1' diff --git a/Gemfile.lock b/Gemfile.lock index 93e5cfc3..27937561 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -120,7 +120,7 @@ GEM raabro (~> 1.4) globalid (1.2.1) activesupport (>= 6.1) - good_job (3.21.5) + good_job (3.22.0) activejob (>= 6.0.0) activerecord (>= 6.0.0) concurrent-ruby (>= 1.0.2) @@ -229,7 +229,7 @@ GEM rdoc (6.6.2) psych (>= 4.0.0) regexp_parser (2.8.3) - reline (0.4.1) + reline (0.4.2) io-console (~> 0.5) rexml (3.2.6) rubocop (1.59.0) @@ -291,7 +291,7 @@ DEPENDENCIES debug (~> 1.9) factory_bot_rails (~> 6.4) faker (~> 3.2) - good_job (~> 3.21) + good_job (~> 3.22) has_scope (~> 0.8) image_processing (~> 1.12.2) mocha (~> 2.1.0) diff --git a/db/migrate/20240106103259_create_good_job_labels.rb b/db/migrate/20240106103259_create_good_job_labels.rb new file mode 100644 index 00000000..1ba514e8 --- /dev/null +++ b/db/migrate/20240106103259_create_good_job_labels.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +class CreateGoodJobLabels < ActiveRecord::Migration[7.1] + def change + reversible do |dir| + dir.up do + # Ensure this incremental update migration is idempotent + # with monolithic install migration. + return if connection.column_exists?(:good_jobs, :labels) + end + end + + add_column :good_jobs, :labels, :text, array: true + end +end diff --git a/db/migrate/20240106103260_create_good_job_labels_index.rb b/db/migrate/20240106103260_create_good_job_labels_index.rb new file mode 100644 index 00000000..65dedd47 --- /dev/null +++ b/db/migrate/20240106103260_create_good_job_labels_index.rb @@ -0,0 +1,22 @@ +# frozen_string_literal: true + +class CreateGoodJobLabelsIndex < ActiveRecord::Migration[7.1] + disable_ddl_transaction! + + def change + reversible do |dir| + dir.up do + unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels) + add_index :good_jobs, :labels, using: :gin, where: "(labels IS NOT NULL)", + name: :index_good_jobs_on_labels, algorithm: :concurrently + end + end + + dir.down do + if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_labels) + remove_index :good_jobs, name: :index_good_jobs_on_labels + end + end + end + end +end diff --git a/db/migrate/20240106103261_remove_good_job_active_id_index.rb b/db/migrate/20240106103261_remove_good_job_active_id_index.rb new file mode 100644 index 00000000..8601f071 --- /dev/null +++ b/db/migrate/20240106103261_remove_good_job_active_id_index.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +class RemoveGoodJobActiveIdIndex < ActiveRecord::Migration[7.1] + disable_ddl_transaction! + + def change + reversible do |dir| + dir.up do + if connection.index_name_exists?(:good_jobs, :index_good_jobs_on_active_job_id) + remove_index :good_jobs, name: :index_good_jobs_on_active_job_id + end + end + + dir.down do + unless connection.index_name_exists?(:good_jobs, :index_good_jobs_on_active_job_id) + add_index :good_jobs, :active_job_id, name: :index_good_jobs_on_active_job_id + end + end + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 4d40d3f6..b7b98b33 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[7.1].define(version: 2023_12_17_094205) do +ActiveRecord::Schema[7.1].define(version: 2024_01_06_103261) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -218,14 +218,15 @@ t.integer "executions_count" t.text "job_class" t.integer "error_event", limit: 2 + t.text "labels", array: true t.index ["active_job_id", "created_at"], name: "index_good_jobs_on_active_job_id_and_created_at" - t.index ["active_job_id"], name: "index_good_jobs_on_active_job_id" t.index ["batch_callback_id"], name: "index_good_jobs_on_batch_callback_id", where: "(batch_callback_id IS NOT NULL)" t.index ["batch_id"], name: "index_good_jobs_on_batch_id", where: "(batch_id IS NOT NULL)" t.index ["concurrency_key"], name: "index_good_jobs_on_concurrency_key_when_unfinished", where: "(finished_at IS NULL)" t.index ["cron_key", "created_at"], name: "index_good_jobs_on_cron_key_and_created_at_cond", where: "(cron_key IS NOT NULL)" t.index ["cron_key", "cron_at"], name: "index_good_jobs_on_cron_key_and_cron_at_cond", unique: true, where: "(cron_key IS NOT NULL)" t.index ["finished_at"], name: "index_good_jobs_jobs_on_finished_at", where: "((retried_good_job_id IS NULL) AND (finished_at IS NOT NULL))" + t.index ["labels"], name: "index_good_jobs_on_labels", where: "(labels IS NOT NULL)", using: :gin t.index ["priority", "created_at"], name: "index_good_jobs_jobs_on_priority_created_at_when_unfinished", order: { priority: "DESC NULLS LAST" }, where: "(finished_at IS NULL)" t.index ["queue_name", "scheduled_at"], name: "index_good_jobs_on_queue_name_and_scheduled_at", where: "(finished_at IS NULL)" t.index ["scheduled_at"], name: "index_good_jobs_on_scheduled_at", where: "(finished_at IS NULL)" diff --git a/gemset.nix b/gemset.nix index dc3be770..d1f696d8 100644 --- a/gemset.nix +++ b/gemset.nix @@ -389,10 +389,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1lqj6mpf14qia3np44y3bp9266ijlyly7zk8p6s0cqq3ngn5vjm1"; + sha256 = "1f99c8xy3ljjg4zk1vsvlxxh5in0hwl7zbhgknhlfghf23cgnsj9"; type = "gem"; }; - version = "3.21.5"; + version = "3.22.0"; }; has_scope = { dependencies = ["actionpack" "activesupport"]; @@ -875,10 +875,10 @@ platforms = []; source = { remotes = ["https://rubygems.org"]; - sha256 = "1hi6zfj6zqzxcbamhjm9w9cswv62f76l8gsdfcnmhpw35cyxphh8"; + sha256 = "0fhwdmw89zqb1fdxcd6lr57zabbfi08z8j6kqwngak0xnxi2j10l"; type = "gem"; }; - version = "0.4.1"; + version = "0.4.2"; }; rexml = { groups = ["default" "development"];