chore(DODO-5263): upgrade Ruby from 3.2.3 to 3.4.8#168
Open
fbriand-docto wants to merge 31 commits intomasterfrom
Open
chore(DODO-5263): upgrade Ruby from 3.2.3 to 3.4.8#168fbriand-docto wants to merge 31 commits intomasterfrom
fbriand-docto wants to merge 31 commits intomasterfrom
Conversation
Bumps Ruby version to 3.4.8 for EOL compliance (Ruby 3.2 EOL March 2026). Updates CI matrix to test Ruby 3.3 and 3.4, replaces ruby/setup-ruby with doctolib/actions/setup-ruby (official distribution channel compliance). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…-ruby doctolib/actions is a private repo, inaccessible from public repo CI. ruby/setup-ruby is the correct action for public repositories. Also pins to v1.299.0 SHA for supply chain security. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
Author
|
/test |
…change
Ruby 3.4 changed Hash#inspect to use {key: val} instead of {:key=>val}.
Add normalize_for_ruby34 helper to test_helper and apply it to all
assertions comparing migration output strings containing hash options.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t in test assertions
Ruby 3.4 changed Hash#inspect output from {:key=>val} to {key: val}.
Update all hardcoded expected strings in tests to use the new format.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Unit tests assert on Hash#inspect output which changed in 3.4. Keep 3.3 only in legacy AR tests (no format-sensitive assertions there). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
sed corrupted the file during normalize_for_ruby34 removal. Restored with correct content and updated hash format strings. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… AR tests - require minitest/mock explicitly in test_helper (was auto-required by mocha 2.0.4 in main Gemfile.lock, but legacy gemfiles install latest mocha which no longer auto-requires it) - switch legacy-activerecord-test matrix from Ruby 3.3 to 3.4 to match the hash inspect format used in updated test assertions Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
minitest 6 (installed by '>= 5' with no lockfile) reorganized its file structure and removed minitest/mock as a standalone require path. Pin to ~> 5 to keep behavior consistent with the main Gemfile.lock which pins minitest 5.18.1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add gem 'mutex_m' to activerecord61.gemfile: mutex_m was removed from Ruby stdlib in 3.4 and is now a standalone gem; AR 6.1 uses it but doesn't declare the dependency - Update test_helper to handle AR 8.0+: SchemaMigration.new now takes a connection pool instead of a connection adapter (API changed in AR 8.0) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…mfile - Add gem 'base64': like mutex_m, base64 was removed from Ruby stdlib in 3.4 and AR 6.1 depends on it without declaring it - Move mutex_m after mocha to satisfy Bundler/OrderedGems rubocop rule Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
AR 6.1 is EOL (Jun 2023) and incompatible with Ruby 3.4 stdlib changes. Replace with AR 7.1 which natively supports Ruby 3.4 and matches the version used in the main Gemfile.lock. - Replace gemfiles/activerecord61.gemfile with activerecord71.gemfile - Bump gemspec minimum from >= 6.1 to >= 7.1 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…g_migrations job Only without_strong_migrations.gemfile tests something genuinely unique (code path without the optional strong_migrations dependency). The AR version gemfiles were redundant with the main Gemfile or tested unsupported versions. Drop the matrix entirely since there is now a single legacy gemfile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Aligns with the platform-wide EOL compliance initiative (Ruby 3.3/3.4/4.0). Ruby 3.0–3.3 are no longer tested or supported. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Gem authors should not commit Gemfile.lock — it prevents flexible dependency resolution and causes Ruby version incompatibilities in CI when switching Ruby versions (bundler runs in frozen mode and fails). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Ruby 4.0 is not yet available in rbenv and bundler compatibility is still catching up. 3.4.8 is the correct stable target. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…it minitest/mock require Gemfile.lock was removed during the Ruby upgrade process; regenerating it with Ruby 3.4.8. minitest/mock is no longer a separate file in minitest 6 (now included by default), so the explicit require is dropped. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
minitest 6 removed Minitest::Mock and Object#stub entirely. Migrating the test suite to mocha equivalents is non-trivial, so we cap minitest at ~> 5 for now. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Metrics/LineLength → Layout/LineLength (cop was renamed) - TargetRubyVersion: 3.0 → 3.4 (aligns with gemspec required_ruby_version) - Style/SuperArguments, Style/ComparableBetween, anonymous block/kwargs forwarding (autocorrected) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…rations 2.x) PG 11 reached end-of-life in November 2023. strong_migrations 2.x (pulled in by the Ruby 3.4 lockfile regeneration) also explicitly dropped PG 11 support, confirming it is no longer a supported target. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ersion cap minitest 6 removed Minitest::Mock and Object#stub. Rather than capping the version, migrate the affected tests to use mocha (already a test dependency): - Minitest::Mock.new + .expect → mock() + .expects (mocha auto-verifies) - SomeClass.stub :m, val do ... end → SomeClass.stubs(:m).returns(val) (mocha cleans up stubs after each test in teardown) Removes the minitest ~> 5 pin from both Gemfile and gemfiles/without_strong_migrations.gemfile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
rubocop was bumped from 1.53 to 1.86 as a side effect of the lockfile regeneration, enabling new cops (Style/ArgumentsForwarding, Naming/BlockForwarding, Style/SuperArguments, Style/ComparableBetween) that flag lib/ code. These changes are unrelated to the Ruby upgrade; disable them in .rubocop.yml to be addressed in a separate PR. Reverts the lib/ autocorrects from the previous rubocop commit. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ctivesupport) minitest >= 5.1 is already a transitive dependency of activesupport. No need to declare it explicitly in the Gemfile. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…nd 15.3 Breaking change: drop Ruby < 3.4 support → major version bump. Update CI matrix to Ruby 3.4 and PostgreSQL 12.14, 15.3. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
beauraF
reviewed
Apr 7, 2026
| @@ -1,5 +1,5 @@ | |||
| env: | |||
| RUBY_VERSION: 3.2.3 | |||
| RUBY_VERSION: 3.4.8 | |||
beauraF
reviewed
Apr 7, 2026
| @@ -1 +1 @@ | |||
| 3.2.3 | |||
| 3.4.8 | |||
Member
There was a problem hiding this comment.
Why not reach for 4.0 line directly?
Member
Author
There was a problem hiding this comment.
I'll try, the PR became bigger than an elephant when I tried the first time but I did not try very hard :)
beauraF
reviewed
Apr 7, 2026
| postgres: [ 11.7, 12.14, 15.2 ] | ||
| ruby: [ 3.1, 3.2 ] | ||
| postgres: [ 12.14, 15.3 ] | ||
| ruby: [ "3.4" ] |
Member
There was a problem hiding this comment.
We will update the monolith to 4.0 this quarter. Probably better to test against it?
Member
There was a problem hiding this comment.
Also, as safe-pgmigration` is open source, probably good to test against all active ruby version. Wdyt?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
Ruby 3.2 reached end-of-life in March 2026. This upgrades safe-pg-migrations to require Ruby >= 3.4, hence the major version bump to 5.0.0.
How
.ruby-versionto3.4.8,required_ruby_versionto>= 3.4, and gem version to5.0.0activerecord/activesupportto>= 7.1and dropped AR 6.1 / 7.0 gemfiles: both are long EOL and untested against Ruby 3.4Minitest::Mock/Object#stubto mocha: minitest 6 removed these entirelyminitestfrom Gemfile: transitive dependency ofactivesupport.rubocop.yml: renamedMetrics/LineLength→Layout/LineLength, updatedTargetRubyVersionto 3.4; disabled new cops from rubocop 1.86 unrelated to the upgrade (to address in a separate PR)strong_migrations2.x dropped it)ruby/setup-ruby@v1:doctolib/actions/setup-rubyis a private action, inaccessible from this public repoEvidence of Testing
CI green on PG 12.14 and 15.3.
This pull request was created with AI assistance.