From 3e331ef3ca4c3b2e119158430ed7ef0a9d3bf783 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Tue, 17 Dec 2024 09:55:26 +0000 Subject: [PATCH 1/4] Upgrade to Ruby 3.2 --- .github/workflows/ci.yml | 6 ++--- Gemfile | 4 ++++ Gemfile.lock | 23 +++++++++++++++---- docker/Dockerfile | 2 +- gemfiles/rails_7.gemfile.lock | 3 +++ gemfiles/rails_main.gemfile.lock | 3 +++ spec/services/generate_foi_suggestion_spec.rb | 4 ++-- 7 files changed, 35 insertions(+), 10 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 7e1e3041..962a3fab 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -14,9 +14,9 @@ jobs: fail-fast: false matrix: include: - - { ruby: 2.7 } - - { ruby: 2.7, gemfile: 'gemfiles/rails_7.gemfile' } - - { ruby: 2.7, gemfile: 'gemfiles/rails_main.gemfile' } + - { ruby: 3.2 } + - { ruby: 3.2, gemfile: 'gemfiles/rails_7.gemfile' } + - { ruby: 3.2, gemfile: 'gemfiles/rails_main.gemfile' } services: postgres: diff --git a/Gemfile b/Gemfile index 508d613e..ee1e6a0e 100644 --- a/Gemfile +++ b/Gemfile @@ -57,6 +57,10 @@ gem 'omniauth-rails_csrf_protection' gem 'scenic' +gem 'net-imap', require: false +gem 'net-pop', require: false +gem 'net-smtp', require: false + group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger # console diff --git a/Gemfile.lock b/Gemfile.lock index e6f570a0..8f5ddfe2 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -80,6 +80,7 @@ GEM concurrent-ruby (1.1.10) connection_pool (2.2.5) crass (1.0.6) + date (3.4.1) diff-lcs (1.5.0) domain_name (0.5.20190701) unf (>= 0.0.5, < 1.0.0) @@ -101,6 +102,10 @@ GEM ruby2_keywords (>= 0.0.4) faraday-net_http (2.0.2) ffi (1.17.0) + ffi (1.17.0-aarch64-linux-gnu) + ffi (1.17.0-arm64-darwin) + ffi (1.17.0-x86_64-darwin) + ffi (1.17.0-x86_64-linux-gnu) fugit (1.5.3) et-orbi (~> 1, >= 1.2.7) raabro (~> 1.4) @@ -138,6 +143,7 @@ GEM activesupport (>= 5.0.0) json (2.5.1) jwt (2.2.3) + libv8-node (16.10.0.0) libv8-node (16.10.0.0-aarch64-linux) libv8-node (16.10.0.0-arm64-darwin) libv8-node (16.10.0.0-x86_64-darwin) @@ -163,15 +169,20 @@ GEM msgpack (1.5.1) multi_json (1.15.0) multi_xml (0.6.0) + net-imap (0.5.2) + date + net-protocol + net-pop (0.1.2) + net-protocol + net-protocol (0.2.2) + timeout + net-smtp (0.5.0) + net-protocol netrc (0.11.0) nio4r (2.7.4) nokogiri (1.13.6) mini_portile2 (~> 2.8.0) racc (~> 1.4) - nokogiri (1.13.6-aarch64-linux) - racc (~> 1.4) - nokogiri (1.13.6-x86_64-linux) - racc (~> 1.4) oauth2 (1.4.9) faraday (>= 0.17.3, < 3.0) jwt (>= 1.0, < 3.0) @@ -333,6 +344,7 @@ GEM thwait (0.2.0) e2mmap tilt (2.0.10) + timeout (0.4.3) ttfunk (1.7.0) turbolinks (5.2.1) turbolinks-source (~> 5.2) @@ -375,6 +387,9 @@ DEPENDENCIES jbuilder (~> 2.11) listen (>= 3.0.5, < 3.8) mini_racer + net-imap + net-pop + net-smtp omniauth (~> 2.0.4) omniauth-google-oauth2 omniauth-rails_csrf_protection diff --git a/docker/Dockerfile b/docker/Dockerfile index 8e0b7454..3388471e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.7-bullseye +FROM ruby:3.2-bullseye ENV DOCKER 1 ENV DEBIAN_FRONTEND noninteractive diff --git a/gemfiles/rails_7.gemfile.lock b/gemfiles/rails_7.gemfile.lock index adb48d82..b3a1c8fd 100644 --- a/gemfiles/rails_7.gemfile.lock +++ b/gemfiles/rails_7.gemfile.lock @@ -394,6 +394,9 @@ DEPENDENCIES jbuilder (~> 2.11) listen (>= 3.0.5, < 3.8) mini_racer + net-imap + net-pop + net-smtp omniauth (~> 2.0.4) omniauth-google-oauth2 omniauth-rails_csrf_protection diff --git a/gemfiles/rails_main.gemfile.lock b/gemfiles/rails_main.gemfile.lock index de908287..9ce227f5 100644 --- a/gemfiles/rails_main.gemfile.lock +++ b/gemfiles/rails_main.gemfile.lock @@ -401,6 +401,9 @@ DEPENDENCIES jbuilder (~> 2.11) listen (>= 3.0.5, < 3.8) mini_racer + net-imap + net-pop + net-smtp omniauth (~> 2.0.4) omniauth-google-oauth2 omniauth-rails_csrf_protection diff --git a/spec/services/generate_foi_suggestion_spec.rb b/spec/services/generate_foi_suggestion_spec.rb index 5289d69e..ac0e3065 100644 --- a/spec/services/generate_foi_suggestion_spec.rb +++ b/spec/services/generate_foi_suggestion_spec.rb @@ -9,8 +9,8 @@ def suggest_all(body = nil, request: nil) described_class.from_request(request) end - def suggest(*args) - suggest_all(*args).first + def suggest(*args, **kwargs) + suggest_all(*args, **kwargs).first end context 'resources with keywords' do From 7df09ea94838acbcbe25d2916e314f593bce7dbe Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Wed, 18 Dec 2024 12:13:52 +0000 Subject: [PATCH 2/4] Fix passing keyword arguments --- app/workers/import_disclosure_log_worker.rb | 2 +- spec/workers/import_disclosure_log_worker_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/workers/import_disclosure_log_worker.rb b/app/workers/import_disclosure_log_worker.rb index ff9cf185..0066060b 100644 --- a/app/workers/import_disclosure_log_worker.rb +++ b/app/workers/import_disclosure_log_worker.rb @@ -8,7 +8,7 @@ class ImportDisclosureLogWorker def perform(duration = nil) @duration = duration - DisclosureLog.new(arguments).import! + DisclosureLog.new(**arguments).import! end private diff --git a/spec/workers/import_disclosure_log_worker_spec.rb b/spec/workers/import_disclosure_log_worker_spec.rb index ccad8ce5..589a5d0a 100644 --- a/spec/workers/import_disclosure_log_worker_spec.rb +++ b/spec/workers/import_disclosure_log_worker_spec.rb @@ -13,7 +13,7 @@ context 'no duration' do it 'calls #import! on DisclosureLog instance without duration' do - expect(DisclosureLog).to receive(:new).with({}).and_return(log) + expect(DisclosureLog).to receive(:new).with(no_args).and_return(log) expect(log).to receive(:import!) perform end From 6feb12cd4ba8d757cf4298d7c44e30c58444d2cb Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Jan 2025 10:27:54 +0000 Subject: [PATCH 3/4] Bump icasework from 0.1.2 to 0.1.4 Includes compatibility fix for Ruby 3+. --- Gemfile.lock | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Gemfile.lock b/Gemfile.lock index 8f5ddfe2..4565d64d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -7,7 +7,7 @@ PATH GEM remote: https://rubygems.org/ specs: - Ascii85 (1.1.0) + Ascii85 (1.1.1) actioncable (6.1.6) actionpack (= 6.1.6) activesupport (= 6.1.6) @@ -72,6 +72,7 @@ GEM activerecord (>= 3.2, < 8.0) rake (>= 10.4, < 14.0) ast (2.4.2) + bigdecimal (3.1.9) bindex (0.8.1) bootsnap (1.11.1) msgpack (~> 1.2) @@ -129,12 +130,13 @@ GEM domain_name (~> 0.5) i18n (1.10.0) concurrent-ruby (~> 1.0) - icasework (0.1.2) - activesupport (>= 4.0.0) + icasework (0.1.4) + activesupport (>= 4.0.0, < 6.2) jwt (~> 2.2.0) nokogiri (~> 1.0) pdf-reader (~> 2.4.0) rest-client (~> 2.1.0) + rexml (~> 3.4.0) infreemation (0.2.3) json (~> 2.5.1) rest-client (~> 2.1.0) @@ -263,7 +265,7 @@ GEM http-cookie (>= 1.0.2, < 2.0) mime-types (>= 1.16, < 4.0) netrc (~> 0.8) - rexml (3.2.5) + rexml (3.4.0) rspec-core (3.11.0) rspec-support (~> 3.11.0) rspec-expectations (3.11.0) @@ -345,7 +347,8 @@ GEM e2mmap tilt (2.0.10) timeout (0.4.3) - ttfunk (1.7.0) + ttfunk (1.8.0) + bigdecimal (~> 3.1) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) From bc892aa8e3195f6ce7f1a5470ad1d15146874103 Mon Sep 17 00:00:00 2001 From: Graeme Porteous Date: Thu, 16 Jan 2025 11:33:28 +0000 Subject: [PATCH 4/4] Bump infreemation from 0.2.3 to 0.2.4 --- Gemfile.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Gemfile.lock b/Gemfile.lock index 4565d64d..189271bd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -137,7 +137,7 @@ GEM pdf-reader (~> 2.4.0) rest-client (~> 2.1.0) rexml (~> 3.4.0) - infreemation (0.2.3) + infreemation (0.2.4) json (~> 2.5.1) rest-client (~> 2.1.0) jbuilder (2.11.5)