Skip to content

Commit

Permalink
Merge pull request #1704 from alphagov/dependabot/bundler/govuk_sidek…
Browse files Browse the repository at this point in the history
…iq-9.0.0

Bump govuk_sidekiq from 8.0.1 to 9.0.0
  • Loading branch information
brucebolt authored Sep 26, 2024
2 parents 83d0b39 + 6dca7cc commit d51453d
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 24 deletions.
26 changes: 14 additions & 12 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,11 @@ GEM
rouge
sprockets (>= 3)
sprockets-rails
govuk_sidekiq (8.0.1)
govuk_sidekiq (9.0.0)
gds-api-adapters (>= 19.1.0)
govuk_app_config (>= 1.1)
redis (< 5)
redis-namespace (~> 1.6)
sidekiq (~> 6.5, >= 6.5.12)
redis-client (>= 0.22.2)
sidekiq (~> 7.0, < 8)
govuk_test (4.1.0)
brakeman (>= 5.0.2)
capybara (>= 3.36)
Expand Down Expand Up @@ -348,7 +347,7 @@ GEM
method_source (1.0.0)
mime-types (3.5.2)
mime-types-data (~> 3.2015)
mime-types-data (3.2024.0820)
mime-types-data (3.2024.0903)
mini_mime (1.1.5)
mini_portile2 (2.8.7)
minitest (5.25.1)
Expand Down Expand Up @@ -674,9 +673,10 @@ GEM
ffi (~> 1.0)
rdoc (6.7.0)
psych (>= 4.0.0)
redis (4.8.1)
redis-namespace (1.11.0)
redis (>= 4)
redis (5.3.0)
redis-client (>= 0.22.0)
redis-client (0.22.2)
connection_pool
regexp_parser (2.9.2)
reline (0.5.10)
io-console (~> 0.5)
Expand Down Expand Up @@ -780,10 +780,12 @@ GEM
sidekiq (>= 3.0)
shoulda-matchers (6.4.0)
activesupport (>= 5.2.0)
sidekiq (6.5.12)
connection_pool (>= 2.2.5, < 3)
rack (~> 2.0)
redis (>= 4.5.0, < 5)
sidekiq (7.3.2)
concurrent-ruby (< 2)
connection_pool (>= 2.3.0)
logger
rack (>= 2.2.4)
redis-client (>= 0.22.2)
signet (0.18.0)
addressable (~> 2.8)
faraday (>= 0.17.5, < 3.a)
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/bulk_add_batches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def import
@batch.update!(batch_params.merge(state: "queued"))

if @batch.entries_to_process.count > 20
MappingsBatchWorker.perform_async(@batch.id)
MappingsBatchJob.perform_async(@batch.id)
flash[:show_background_batch_progress_modal] = true
else
@batch.process
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/import_batches_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def import
@batch.update!(batch_params.merge(state: "queued"))

if @batch.entries_to_process.count > 20
MappingsBatchWorker.perform_async(@batch.id)
MappingsBatchJob.perform_async(@batch.id)
flash[:show_background_batch_progress_modal] = true
else
@batch.process
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
class MappingsBatchWorker
include Sidekiq::Worker
class MappingsBatchJob
include Sidekiq::Job
sidekiq_options retry: false

def perform(mappings_batch_id)
Expand All @@ -11,3 +11,5 @@ def perform(mappings_batch_id)
end
end
end

MappingsBatchWorker = MappingsBatchJob
2 changes: 0 additions & 2 deletions config/initializers/sidekiq.rb

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
require "spec_helper"

describe MappingsBatchWorker do
describe MappingsBatchJob do
describe "perform" do
describe "recording history", versioning: true do
let(:user) { create(:user, name: "Bob") }
let(:mappings_batch) { create(:bulk_add_batch, user:) }

before { MappingsBatchWorker.new.perform(mappings_batch.id) }
before { MappingsBatchJob.new.perform(mappings_batch.id) }

subject { Mapping.first.versions.last }

Expand All @@ -23,7 +23,7 @@

context "batch being deleted before processing" do
it "should not raise an error" do
expect { MappingsBatchWorker.new.perform(1234) }.to_not raise_error
expect { MappingsBatchJob.new.perform(1234) }.to_not raise_error
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/support/shared_examples/mappings_batch_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
end

it "queues a job" do
expect(MappingsBatchWorker.jobs.size).to eql(1)
expect(MappingsBatchJob.jobs.size).to eql(1)
end

it "updates the batch state" do
Expand All @@ -41,7 +41,7 @@
end

it "doesn't queue it (again)" do
expect(MappingsBatchWorker.jobs.size).to eql(0)
expect(MappingsBatchJob.jobs.size).to eql(0)
end

it "redirects to the site return URL" do
Expand Down
2 changes: 1 addition & 1 deletion spec/support/sidekiq.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@

RSpec.configure do |config|
config.before(:each) do
Sidekiq::Worker.clear_all
Sidekiq::Job.clear_all
end
end

0 comments on commit d51453d

Please sign in to comment.