From d374811dbf6d777f750572f1b34f33cd72147d9d Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Mon, 3 Feb 2025 10:26:12 -0700 Subject: [PATCH 1/8] Bump Ruby 3.4 --- .tool-versions | 2 +- Gemfile | 2 +- Gemfile.lock | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.tool-versions b/.tool-versions index 2cdace767..24723d62a 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ yarn 1.22.19 -ruby 3.1.4 +ruby 3.4.1 nodejs 18.15.0 diff --git a/Gemfile b/Gemfile index c45a1e6c0..3e1f90f01 100644 --- a/Gemfile +++ b/Gemfile @@ -1,7 +1,7 @@ source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } -ruby '>= 3.1.4', '< 3.2' +ruby '>= 3.1.4', '< 3.5' # Core Rails stuff gem 'image_processing' # for ActiveStorage Variants diff --git a/Gemfile.lock b/Gemfile.lock index 3b48d5bb9..8bf14d7be 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -726,7 +726,7 @@ DEPENDENCIES wicked RUBY VERSION - ruby 3.1.4p223 + ruby 3.4.1p0 BUNDLED WITH 2.6.3 From 5b4f1a3dd895ce676e81bd6ab431063119d66eba Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Mon, 3 Feb 2025 10:26:33 -0700 Subject: [PATCH 2/8] Add csv to Gemfile csv was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0. You can add csv to your Gemfile or gemspec to silence this warning. --- Gemfile | 1 + Gemfile.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index 3e1f90f01..89a6e1533 100644 --- a/Gemfile +++ b/Gemfile @@ -50,6 +50,7 @@ gem 'sidekiq-unique-jobs', '~> 8.0' # Misc Utilities gem 'aasm' # state-machine management gem 'addressable', '~> 2.8.7' # Replacement for the standard URI implementation +gem 'csv', '~> 3.3', '>= 3.3.2' # CSV parsing gem 'datacite-client', github: 'ualbertalib/datacite-client', tag: 'v0.1.0', require: 'datacite' gem 'differ' # Used to diff two strings gem 'draper' diff --git a/Gemfile.lock b/Gemfile.lock index 8bf14d7be..bd23e6072 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -185,6 +185,7 @@ GEM unicode (>= 0.4.4.5) cssbundling-rails (1.4.1) railties (>= 6.0.0) + csv (3.3.2) danger (9.5.1) base64 (~> 0.2) claide (~> 1.0) @@ -665,6 +666,7 @@ DEPENDENCIES clamby connection_pool cssbundling-rails + csv (~> 3.3, >= 3.3.2) danger (~> 9.5) datacite-client! debug From 0ac8c06831d9d6d407b25aaf789a4f57f0f54dfe Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Mon, 3 Feb 2025 11:30:25 -0700 Subject: [PATCH 3/8] Add ruby 3.4 to GitHub Actions --- .github/workflows/push.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 567469cf0..591afb428 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: - ruby: [3.1] + ruby: [3.1, 3.4] steps: - uses: actions/checkout@v4 From 5aa77542c973d32718684015e4b481c80b663ba1 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Mon, 3 Feb 2025 12:43:53 -0700 Subject: [PATCH 4/8] Add ostruct to Gemfile ostruct.rb was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0. --- Gemfile | 1 + Gemfile.lock | 2 ++ 2 files changed, 3 insertions(+) diff --git a/Gemfile b/Gemfile index 89a6e1533..a716d8ef6 100644 --- a/Gemfile +++ b/Gemfile @@ -60,6 +60,7 @@ gem 'flipper-active_record', '~> 1.3.2' # Store feature flags in ActiveRecord gem 'flipper-ui', '~> 1.3.2' # UI for feature flags gem 'jbuilder' # generate JSON objects gem 'kaminari' # Pagination +gem 'ostruct', '~> 0.6.1' # similar to hash gem 'paper_trail', '~> 15.2.0' # Track object changes gem 'ransack', '4.3.0' # ActiveRecord search/filter gem 'redcarpet', '~> 3.6', require: ['redcarpet', 'redcarpet/render_strip'] # Markdown to (X)HTML parser diff --git a/Gemfile.lock b/Gemfile.lock index bd23e6072..98e640325 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -395,6 +395,7 @@ GEM ruby-saml (~> 1.17) open4 (1.3.4) os (1.1.4) + ostruct (0.6.1) paper_trail (15.2.0) activerecord (>= 6.1) request_store (~> 1.4) @@ -692,6 +693,7 @@ DEPENDENCIES omniauth (~> 2.1) omniauth-rails_csrf_protection (~> 1.0) omniauth-saml (~> 2.2) + ostruct (~> 0.6.1) paper_trail (~> 15.2.0) pg (~> 1.5.9) puma (~> 6.6) From 56976f9e39e48d1b9c8fb09f6ffa81e22b2c32f1 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Mon, 3 Feb 2025 12:45:37 -0700 Subject: [PATCH 5/8] needs changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index a2ca2c231..ee544a860 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ New entries in this file should aim to provide a meaningful amount of informatio ### Changed * skip brakeman Remove brakeman's ruby EOL check +* bump Ruby 3.4 [ualbertalib/library_applications_development#163](https://github.com/ualbertalib/library_applications_development/issues/163) ### Chores * Bump bundler in Gemfile.lock to match production and build environments From ca35f9695d52aa8ee392a4edea7b39a5bce14463 Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Thu, 20 Feb 2025 17:17:37 -0700 Subject: [PATCH 6/8] target ruby 3.3 More easily available in RHEL/centos ecosystem. Can revisit 3.4 when it's more mature. --- .github/workflows/push.yml | 4 ++-- .tool-versions | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 591afb428..1f466d72f 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -7,7 +7,7 @@ jobs: strategy: matrix: - ruby: [3.1, 3.4] + ruby: [3.1, 3.3, 3.4] steps: - uses: actions/checkout@v4 @@ -16,7 +16,7 @@ jobs: - uses: actions/setup-node@v4 with: - node-version: 18 + node-version: 22 - name: Build the docker-compose stack run: docker compose up -d diff --git a/.tool-versions b/.tool-versions index 24723d62a..27ea5b5c8 100644 --- a/.tool-versions +++ b/.tool-versions @@ -1,3 +1,3 @@ -yarn 1.22.19 -ruby 3.4.1 -nodejs 18.15.0 +yarn 1.22.22 +ruby 3.3.5 +nodejs 22.14.0 From ec402c9e4b5d3f04def8ce32f11ef3844773766e Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Fri, 21 Feb 2025 16:18:36 -0700 Subject: [PATCH 7/8] TargetRubyVersion for rubocop Layout/LineLength: Line is too long. [153/120] (https://rubystyle.guide#max-line-length) --- .rubocop.yml | 2 +- lib/tasks/digitization_batch_ingest.rake | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.rubocop.yml b/.rubocop.yml index 323fc773d..b3c2c864b 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -22,7 +22,7 @@ AllCops: - "node_modules/**/*" ExtraDetails: true NewCops: enable - TargetRubyVersion: 3.1 + TargetRubyVersion: 3.4 # readability is Actually Good Layout/EmptyLinesAroundClassBody: diff --git a/lib/tasks/digitization_batch_ingest.rake b/lib/tasks/digitization_batch_ingest.rake index b5e94ccf8..dc1135bdb 100644 --- a/lib/tasks/digitization_batch_ingest.rake +++ b/lib/tasks/digitization_batch_ingest.rake @@ -41,7 +41,7 @@ namespace :digitization do # - Give `title` 80 characters of space. # - `processing` should be the longest `status` # - batch `size` should be pretty small to ensure that the jobs can finish in a timely manner - puts format '%38s,%80s,%12s,%7s', 'id', 'title', 'status', 'size' + puts format '%38s,%80s,%12s,%7d', 'id', 'title', 'status', 'size' Digitization::BatchMetadataIngest.order(created_at: :desc).limit(limit).each do |batch_ingest| puts format '%38s,%80s,%12s,%7d', batch_ingest.id, batch_ingest.title, batch_ingest.status, batch_ingest.books.count From 6f0911e87aca6c71fca6733c70d628c7d2c3518b Mon Sep 17 00:00:00 2001 From: Tricia Jenkins Date: Fri, 21 Feb 2025 16:23:20 -0700 Subject: [PATCH 8/8] restore brakeman's CheckEOLRuby --- config/brakeman.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/config/brakeman.yml b/config/brakeman.yml index 322269f6f..7c1265539 100644 --- a/config/brakeman.yml +++ b/config/brakeman.yml @@ -2,5 +2,4 @@ :run_all_checks: true :skip_checks: - CheckUnscopedFind - - CheckEOLRuby :github_repo: ualbertalib/jupiter