Skip to content

Upgrade to Ruby 3.2 and replace unmaintained dependencies - #18

Open
benrfairless wants to merge 3 commits into
mainfrom
chore/upgrade-ruby
Open

Upgrade to Ruby 3.2 and replace unmaintained dependencies#18
benrfairless wants to merge 3 commits into
mainfrom
chore/upgrade-ruby

Conversation

@benrfairless

@benrfairless benrfairless commented Aug 12, 2026

Copy link
Copy Markdown
Member

Description

Upgrades the gem from Ruby 2.7 (EOL March 2023) to currently supported Rubies and replaces its unmaintained dependencies:

  • .ruby-version pinned to 3.2.2 (the newest Ruby Morph.io supports); required_ruby_version >= 3.2 in the gemspec
  • rest-client (unmaintained) replaced with faraday + faraday-multipart, keeping the streaming of run output via Faraday's on_data callback
  • archive-tar-minitar (ancient) replaced with maintained minitar 1.x
  • Upload tarball now written to a Tempfile instead of the shared, predictable /tmp/out path (fixes a multi-user clobbering/symlink hazard)
  • ~/.morph config loaded with YAML.safe_load_file(..., permitted_classes: [Symbol]) — plain YAML.load_file no longer round-trips symbol keys on modern Psych
  • Runtime dependencies given pessimistic version constraints; rake/bundler dev deps moved from gemspec to Gemfile
  • CI matrix covers Ruby 3.2/3.3/3.4, with build/lint/audit jobs on 3.2; RuboCop TargetRubyVersion set to 3.2 and the todo baseline regenerated (the rewrite fixed many baseline offenses)

Motivation and Context

Ruby 2.7 and the pinned dependencies are unsupported and increasingly fail to install on modern systems. Ruby 3.2 is the baseline because it is the newest version Morph.io itself supports, while CI also tests 3.3 and 3.4. This is part 2 of the modernisation series and unblocks the coverage, metadata, and release-automation PRs that follow.

How Has This Been Tested?

  • Checked affected area manually on my own / staging system
  • Ran automated tests on my own system
  • Confirmed it passed the GitHub actions tests

On Ruby 3.2.2 (mise): bundle exec rspec (0 failures), bundle exec rubocop (no offenses), bundle exec bundler-audit check --update (no vulnerabilities), bundle exec rake build, plus a manual smoke test of morph version, morph help, and tar creation/read-back via Minitar::Input. All runtime dependencies (faraday 2.x, faraday-multipart, minitar 1.x, thor, filesize) resolve and pass on 3.2.

Screenshots (if appropriate):

N/A

Types of Changes

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation

Breaking only in the sense that the gem now requires Ruby >= 3.2.

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

README updates (supported Ruby, install instructions) land in part 4 of this series.


Part 2 of the 5-PR modernisation series. Stacked on #17 (base branch bugfix/fix-ci-trigger); GitHub will retarget to main when #17 merges.

Assisted-by: opencode/anthropic.claude-fable-5

@benrfairless benrfairless self-assigned this Aug 12, 2026
@benrfairless
benrfairless marked this pull request as ready for review August 12, 2026 01:51
@benrfairless
benrfairless requested a review from a team as a code owner August 12, 2026 03:00

@ianheggie-oaf ianheggie-oaf left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved - LGTM at a glance

@benrfairless benrfairless changed the title Upgrade to Ruby 3.4 and replace unmaintained dependencies Upgrade to Ruby 3.2 and replace unmaintained dependencies Aug 12, 2026
Comment thread lib/morph-cli.rb Outdated
Base automatically changed from bugfix/fix-ci-trigger to main August 13, 2026 06:03
Ruby 2.7 has been end-of-life since March 2023 and the gem depended on
rest-client and archive-tar-minitar, both long unmaintained. This
brings the gem up to currently supported Rubies:

- Pin .ruby-version to 3.4.10 and set required_ruby_version >= 3.3
  (the currently supported Ruby series as of August 2026)
- Replace rest-client with faraday + faraday-multipart, streaming the
  run output via Faraday's on_data callback
- Replace archive-tar-minitar with the maintained minitar 1.x and its
  Minitar namespace
- Write the upload tarball to a Tempfile instead of the shared,
  predictable /tmp/out path
- Use YAML.safe_load_file with permitted Symbol class when loading
  ~/.morph (YAML.load_file no longer round-trips symbol keys safely
  on modern Psych)
- Constrain thor, filesize and declare all runtime deps with
  pessimistic version bounds; move rake/bundler dev deps to Gemfile
- Refresh CI matrix to Ruby 3.3/3.4 and bump lint/build/audit jobs to
  Ruby 3.4; raise RuboCop TargetRubyVersion to 3.3 and regenerate the
  todo baseline (many entries fixed by the rewrite)

Tests, RuboCop, bundler-audit and gem build all pass locally on
Ruby 3.4.10.

Assisted-by: opencode/anthropic.claude-fable-5
Signed-off-by: Ben Fairless <ben@oaf.org.au>
Morph.io's newest supported Ruby is 3.2, so target that as the
baseline instead of 3.3:

- Set .ruby-version to 3.2.2 and lower required_ruby_version to >= 3.2
- Add 3.2 to the CI test matrix and run build/lint/audit jobs on 3.2
- Lower RuboCop TargetRubyVersion to 3.2

All runtime dependencies (faraday 2.x, faraday-multipart, minitar 1.x,
thor, filesize) resolve on Ruby 3.2; tests, RuboCop and gem build all
pass locally on 3.2.2.

Assisted-by: Claude Code:anthropic.claude-fable-5
If Minitar::Output.new raises, the ensure block previously called
output.tar.close on nil, raising NoMethodError and masking the
original exception. Skip cleanup when output was never assigned.

Addresses PR #18 review feedback.

Assisted-by: Claude Code:amazon-bedrock/anthropic.claude-fable-5
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.

2 participants