Skip to content

Support Ruby 3.4 and 4.0 for incremental EB upgrade; enable deprecation warnings - #562

Draft
superconductor-for-github[bot] wants to merge 1 commit into
mainfrom
cycomachead/189-upgrade-ruby-4-0/3
Draft

Support Ruby 3.4 and 4.0 for incremental EB upgrade; enable deprecation warnings#562
superconductor-for-github[bot] wants to merge 1 commit into
mainfrom
cycomachead/189-upgrade-ruby-4-0/3

Conversation

@superconductor-for-github

Copy link
Copy Markdown

Closes #189.

What this does

Makes the app run on Ruby 3.4.x or 4.0.x (Gemfile: >= 3.4, < 4.1) so the Elastic Beanstalk environments can be bumped incrementally — first to the Ruby 3.4 on AL2023 platform branch (ruby 3.4.10, exactly what the lockfile was already on), then to Ruby 4.0 on AL2023 (ruby 4.0.6, the latest 4.0.x) — and enables deprecation warnings everywhere so anything the upgrade shakes loose is visible.

Local

  • .tool-versionsruby 4.0 (currently resolves to 4.0.6); mise docs updated
  • Dockerfile and .devcontainer/Dockerfile4.0.6 (both image tags verified to exist)
  • RuboCop TargetRubyVersion → 3.4 (the new floor)

CI

  • The RSpec workflow now runs a matrix on Ruby 3.4 and 4.0 so both supported rubies stay tested during the rollout (QLTY coverage submits only from the 4.0 job to avoid double-reporting); other workflows follow .tool-versions → 4.0
  • Docs workflow's hardcoded 3.44.0 (Jekyll build verified under 4.0.6)
  • buildspec.ymlruby: 3.4, staying in lockstep with the EB platform; CodeBuild AL2023 images support ruby: 4.0 for the next hop

Elastic Beanstalk

  • Not in this repo: the environments (currently on the Ruby 3.3 branch) need their platform moved to Ruby 3.4 AL2023 together with this deploy, since the new Gemfile floor is 3.4. Later, move to Ruby 4.0 AL2023 and flip buildspec.yml to ruby: 4.0 in the same change (comments in buildspec.yml document this).
  • The prebuild hook now installs Bundler 4.0.19 (matching the lockfile's BUNDLED WITH). Bundler 2.5.6 works on Ruby 4.0 but spews constant-redefinition warnings against its RubyGems 4.x; 4.0.19 is clean on both rubies.

Deprecation warnings

  • Warning[:deprecated] = true moved from the dev/test env files to config/boot.rb, so Ruby-level deprecations surface in every environment and process (server, console, rake, EB)
  • Production now logs Rails deprecations (report_deprecations = true, deprecation = :log) instead of silencing them

Verification

Full suite run locally on both rubies:

Check Ruby 3.4.10 Ruby 4.0.6
RSpec 712 examples, 0 failures 712 examples, 0 failures
RuboCop 166 files, no offenses 166 files, no offenses
Cucumber (rack_test) 24/24 scenarios 24/24 scenarios

(JavaScript cucumber scenarios couldn't run in the sandbox — chromedriver can't start there; they're exercised in CI.)

App boots warning-free on both rubies, and Warning[:deprecated] is confirmed true at runtime with Rails deprecation behavior :log.

🤖 Generated with Claude Code

Allows an incremental Elastic Beanstalk rollout: the Gemfile now accepts
>= 3.4, < 4.1 so the app runs on both the EB "Ruby 3.4 on AL2023"
platform (ruby 3.4.10, matching the previous lockfile) and Ruby 4.0.6,
the latest 4.0.x and what the "Ruby 4.0 on AL2023" platform ships.

- Local tooling (mise, Dockerfile, devcontainer) moves to Ruby 4.0.6
- RSpec CI runs a 3.4 + 4.0 matrix; other workflows follow .tool-versions
- buildspec stays on ruby 3.4 in lockstep with the EB platform; bump to
  4.0 together with the platform upgrade
- Bundler pinned at 4.0.19 (lockfile + EB prebuild hook) — Bundler 2.5.6
  emits constant-redefinition warnings under Ruby 4.0's RubyGems
- Ruby-level deprecation warnings (Warning[:deprecated]) are enabled
  globally in boot.rb instead of only dev/test, and production now logs
  Rails deprecations instead of silencing them

Verified on both 3.4.10 and 4.0.6: RSpec 712/712, RuboCop clean,
Cucumber rack_test 24/24, Jekyll docs build.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@superconductor-for-github

Copy link
Copy Markdown
Author

🔗 This pull request is linked to Superconductor implementation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant