From 37eb6816fe10f5d2f46827752bf199fd4a58fa70 Mon Sep 17 00:00:00 2001 From: Jenkins Date: Mon, 15 Jan 2024 02:34:30 -0800 Subject: [PATCH 1/2] Update Ruby dependencies --- Gemfile.lock | 31 ++++++++++--------- app/services/normalized_marc_record_reader.rb | 4 +++ spec/support/marc_fixture_seed_fetcher.rb | 4 +++ 3 files changed, 25 insertions(+), 14 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 414cfc4b..a21c4ac9 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -50,7 +50,7 @@ GEM activejob (7.0.8) activesupport (= 7.0.8) globalid (>= 0.3.6) - activejob-status (1.0.0) + activejob-status (1.0.1) activejob (>= 6.0) activesupport (>= 6.0) activemodel (7.0.8) @@ -76,7 +76,7 @@ GEM activesupport (>= 6.1) device_detector (>= 1) safely_block (>= 0.4) - airbrussh (1.5.0) + airbrussh (1.5.1) sshkit (>= 1.6.1, != 1.7.0) ast (2.4.2) bcrypt (3.1.20) @@ -159,7 +159,7 @@ GEM capistrano-one_time_key capistrano-shared_configs docile (1.4.0) - domain_name (0.6.20231109) + domain_name (0.6.20240107) dry-configurable (1.1.0) dry-core (~> 1.0, < 2) zeitwerk (~> 2.6) @@ -242,9 +242,9 @@ GEM activesupport (>= 3.0) nokogiri (>= 1.6) io-console (0.7.1) - irb (1.11.0) + irb (1.11.1) rdoc - reline (>= 0.3.8) + reline (>= 0.4.2) jbuilder (2.11.5) actionview (>= 5.0.0) activesupport (>= 5.0.0) @@ -283,7 +283,7 @@ GEM matrix (0.4.2) method_source (1.0.0) mini_mime (1.1.5) - minitest (5.20.0) + minitest (5.21.1) mutex_m (0.2.0) net-imap (0.4.9.1) date @@ -294,6 +294,8 @@ GEM timeout net-scp (4.0.0) net-ssh (>= 2.6.5, < 8.0.0) + net-sftp (4.0.0) + net-ssh (>= 5.0.0, < 8.0.0) net-smtp (0.4.0.1) net-protocol net-ssh (7.2.1) @@ -308,7 +310,7 @@ GEM activerecord (>= 6.1) request_store (~> 1.4) parallel (1.24.0) - parser (3.3.0.2) + parser (3.3.0.3) ast (~> 2.4.1) racc pg (1.5.4) @@ -366,7 +368,7 @@ GEM redis-client (>= 0.17.0) redis-client (0.19.1) connection_pool - regexp_parser (2.8.3) + regexp_parser (2.9.0) reline (0.4.2) io-console (~> 0.5) request_store (1.5.1) @@ -393,11 +395,11 @@ GEM rspec-mocks (~> 3.12) rspec-support (~> 3.12) rspec-support (3.12.1) - rubocop (1.59.0) + rubocop (1.60.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) rexml (>= 3.2.5, < 4.0) @@ -408,9 +410,9 @@ GEM parser (>= 3.2.1.0) rubocop-capybara (2.20.0) rubocop (~> 1.41) - rubocop-factory_bot (2.25.0) - rubocop (~> 1.33) - rubocop-performance (1.20.1) + rubocop-factory_bot (2.25.1) + rubocop (~> 1.41) + rubocop-performance (1.20.2) rubocop (>= 1.48.1, < 2.0) rubocop-ast (>= 1.30.0, < 2.0) rubocop-rails (2.23.1) @@ -451,9 +453,10 @@ GEM sprockets (>= 3.0.0) sqlite3 (1.7.0-x86_64-darwin) sqlite3 (1.7.0-x86_64-linux) - sshkit (1.21.7) + sshkit (1.22.0) mutex_m net-scp (>= 1.1.2) + net-sftp (>= 2.1.2) net-ssh (>= 2.8.0) stringio (3.1.0) terminal-table (3.0.2) diff --git a/app/services/normalized_marc_record_reader.rb b/app/services/normalized_marc_record_reader.rb index 64cadb47..d8831e2d 100644 --- a/app/services/normalized_marc_record_reader.rb +++ b/app/services/normalized_marc_record_reader.rb @@ -14,6 +14,9 @@ def initialize(uploads, thread_pool_size: 10) @thread_pool_size = thread_pool_size end + # Disable cop until rubocop false positive is fixed: + # https://github.com/rubocop/rubocop/issues/12621 + # rubocop:disable Style/ArgumentsForwarding # @yield [MarcRecord] def each(&block) pool = Concurrent::FixedThreadPool.new(thread_pool_size) @@ -35,6 +38,7 @@ def each(&block) pool.shutdown end + # rubocop:enable Style/ArgumentsForwarding # Return the full list of MarcRecord id values to include in the dump. # Note: ideally we'd be able to iterate through that list, but e.g. #find_each diff --git a/spec/support/marc_fixture_seed_fetcher.rb b/spec/support/marc_fixture_seed_fetcher.rb index 08dbf206..7cf10d65 100644 --- a/spec/support/marc_fixture_seed_fetcher.rb +++ b/spec/support/marc_fixture_seed_fetcher.rb @@ -1,9 +1,13 @@ # frozen_string_literal: true class MarcFixtureSeedFetcher + # Disable cop until rubocop false positive is fixed: + # https://github.com/rubocop/rubocop/issues/12621 + # rubocop:disable Style/ArgumentsForwarding def self.fetch_uploads(slug, &block) new.fetch_uploads(slug, &block) end + # rubocop:enable Style/ArgumentsForwarding def fetch_uploads(slug, &_block) default_stream_url = default_stream_for(slug)['url'] From 01d96ada910488c5e5123395bd866e0c2eb72d3f Mon Sep 17 00:00:00 2001 From: Cory Lown Date: Tue, 16 Jan 2024 08:54:40 -0500 Subject: [PATCH 2/2] Run rubocop autocorrect --- app/services/normalized_marc_record_reader.rb | 8 ++------ spec/support/marc_fixture_seed_fetcher.rb | 8 ++------ 2 files changed, 4 insertions(+), 12 deletions(-) diff --git a/app/services/normalized_marc_record_reader.rb b/app/services/normalized_marc_record_reader.rb index d8831e2d..6fd4ce52 100644 --- a/app/services/normalized_marc_record_reader.rb +++ b/app/services/normalized_marc_record_reader.rb @@ -14,11 +14,8 @@ def initialize(uploads, thread_pool_size: 10) @thread_pool_size = thread_pool_size end - # Disable cop until rubocop false positive is fixed: - # https://github.com/rubocop/rubocop/issues/12621 - # rubocop:disable Style/ArgumentsForwarding # @yield [MarcRecord] - def each(&block) + def each(...) pool = Concurrent::FixedThreadPool.new(thread_pool_size) current_marc_record_ids.each_slice(200) do |slice| @@ -33,12 +30,11 @@ def each(&block) nil end - records.each(&block) + records.each(...) end pool.shutdown end - # rubocop:enable Style/ArgumentsForwarding # Return the full list of MarcRecord id values to include in the dump. # Note: ideally we'd be able to iterate through that list, but e.g. #find_each diff --git a/spec/support/marc_fixture_seed_fetcher.rb b/spec/support/marc_fixture_seed_fetcher.rb index 7cf10d65..95076585 100644 --- a/spec/support/marc_fixture_seed_fetcher.rb +++ b/spec/support/marc_fixture_seed_fetcher.rb @@ -1,13 +1,9 @@ # frozen_string_literal: true class MarcFixtureSeedFetcher - # Disable cop until rubocop false positive is fixed: - # https://github.com/rubocop/rubocop/issues/12621 - # rubocop:disable Style/ArgumentsForwarding - def self.fetch_uploads(slug, &block) - new.fetch_uploads(slug, &block) + def self.fetch_uploads(slug, ...) + new.fetch_uploads(slug, ...) end - # rubocop:enable Style/ArgumentsForwarding def fetch_uploads(slug, &_block) default_stream_url = default_stream_for(slug)['url']