Skip to content

Modernize dependencies, fix CI, and add rubocop-gusto#178

Merged
dduugg merged 13 commits intomainfrom
modernize-dependencies
Mar 7, 2026
Merged

Modernize dependencies, fix CI, and add rubocop-gusto#178
dduugg merged 13 commits intomainfrom
modernize-dependencies

Conversation

@dduugg
Copy link
Contributor

@dduugg dduugg commented Mar 5, 2026

Summary

CI tests against Ruby 3.2, 3.3, and 4.0 via `rubyatscale/shared-config`. Several gems were incompatible with Ruby 4.0, causing `bundle install` to fail with `minitest-5.19.0 requires ruby version < 4.0`. Also fixes a nokogiri platform lockfile issue.

Follows the same approach as rubyatscale/packwerk-extensions#62.

Dependency updates:

  • Remove git-sourced packwerk override from Gemfile — packwerk 3 is on RubyGems
  • Update bundler to 4.0.7 (was 2.7.2)
  • Update all outdated gems: activesupport 7→8.1, rubocop 1.56→1.85, sorbet/tapioca 0.5/0.11→0.6/0.17, minitest 5.19→6.0 (Ruby 4.0 compatible), code_ownership 1.34→2.1.1 (native Rust gem), tapioca 0.11→0.17.10, spoom 1.2→1.7.11, rbs 3.10→4.0.0.dev.5, parse_packwerk 0.25→0.27, packs-specification 0.0.10→0.0.11, and many more
  • Run bundle lock --normalize-platforms to fix nokogiri platform lockfile warning
  • Bump required_ruby_version in gemspec from >= 2.6.0 to >= 3.2
  • Remove bundler ~> 2.2 and spoom 1.2.1 version pins (spoom was pinned for Ruby 2.7 compatibility)

Sorbet/Tapioca:

  • Add require 'packwerk' to sorbet/tapioca/require.rb so tapioca generates a populated packwerk RBI
  • Update tapioca config to exclude gems with sorbet built-in stdlib shims (base64, benchmark, bigdecimal, drb, json, logger, racc, reline, rexml, securerandom, tsort, uri)
  • Regenerate all tapioca RBI files via tapioca gems --all for updated gem versions
  • Regenerate rubocop and tapioca binstubs

Linting:

  • Add rubocop-gusto as a development dependency and plugin in .rubocop.yml
  • Add inherit_mode (merge Exclude/Include) and inherit_gem: rubocop-gusto: config/default.yml
  • Autocorrect 490 offenses from rubocop-gusto; generate .rubocop_todo.yml for remaining violations
  • Remove disabled Layout cops from .rubocop.yml; autocorrect 113 resulting violations
  • Update TargetRubyVersion from 2.6.0 to 3.2
  • Fix Sorbet type check failures caused by Sorbet/BlockMethodDefinition autocorrect converting def to define_method inside Thor no_commands and RSpec blocks; exclude those files from the cop and revert to plain def
  • Resolve Sorbet/BlockMethodDefinition in cli.rb by removing the redundant no_commands do wrapper (Thor 1.x excludes private methods from CLI commands automatically)

Test fixes for updated gem APIs:

  • code_ownership 2.1.1 (Rust-based): for_file now defaults to from_codeowners: true; pass from_codeowners: false in CodeOwnershipPostProcessor to use pack-based ownership lookup
  • code_ownership 2.1.1: team YAML files require a github.team field to be parsed by the Rust engine
  • code_ownership 2.1.1: only recognizes top-level owner: key in package.yml, not metadata.owner; update write_package_yml spec helper to write owner at top level via config hash
  • code_ownership 2.1.1: remove_file_annotation! regex requires a trailing newline; fix test fixture accordingly
  • Psych 5: YAML array items are no longer indented under parent key; update test expectations

Test plan

  • All 115 RSpec examples pass locally
  • bundle exec rubocop passes with no offenses
  • bundle exec srb tc passes with no errors
  • CI passes on Ruby 3.2, 3.3, and 4.0

Fixes https://github.com/rubyatscale/packs/actions/runs/22733988234

🤖 Generated with Claude Code

CI tests against Ruby 3.2, 3.3, and 4.0. Several gems were
incompatible with Ruby 4.0, causing bundle install to fail.

Dependency updates:
- Remove git-sourced packwerk override from Gemfile (packwerk 3 is
  on RubyGems)
- Update all outdated gems: activesupport 7 → 8.1, rubocop 1.56 →
  1.85, sorbet/tapioca 0.5/0.11 → 0.6/0.16, minitest 5.19 → 6.0,
  code_ownership 1.34 → 2.1.1 (native Rust gem), and many more
- Bump required_ruby_version in gemspec from >= 2.6.0 to >= 3.2
- Remove bundler version pin and spoom version pin

Linting:
- Autocorrect rubocop offenses (block forwarding, collection querying)
- Add .rubocop_todo.yml for Naming/BlockForwarding (Sorbet incompatible
  with anonymous block forwarding) and Naming/PredicateMethod
- Update TargetRubyVersion from 2.6.0 to 3.2

Test fixes for updated gem APIs:
- code_ownership 2.1.1 (Rust-based): for_file now defaults to
  from_codeowners: true; pass from_codeowners: false in
  CodeOwnershipPostProcessor to use pack-based ownership lookup
- code_ownership 2.1.1: team YAML files require github.team field
- code_ownership 2.1.1: only recognizes top-level owner: key in
  package.yml, not metadata.owner; update spec_helper write_package_yml
  to write owner at top level via config hash
- code_ownership 2.1.1: remove_file_annotation! regex requires trailing
  newline; fix test file to include newline
- Psych 5: YAML array items no longer indented under parent key; update
  test expectations

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@dduugg dduugg requested a review from a team as a code owner March 5, 2026 20:27
@github-project-automation github-project-automation bot moved this to Triage in Modularity Mar 5, 2026
dduugg and others added 2 commits March 5, 2026 12:49
- Update bundler to 4.0.7 (was 2.7.2) and tapioca to 0.17.10 (was
  0.16.11), spoom to 1.7.11 (was 1.6.3), rbs to 4.0.0.dev.5 (was
  3.10.3) to match updated dependencies
- Add require 'packwerk' to sorbet/tapioca/require.rb so tapioca can
  generate a populated packwerk RBI
- Regenerate all gem RBIs via `tapioca gems --all` for updated versions:
  - Remove stale RBIs for gems no longer in the lockfile (rubocop-rspec,
    rubocop-sorbet, ruby-graphviz)
  - Add new RBIs for new gems (addressable, benchmark, better_html,
    bigdecimal, byebug, coderay, connection_pool, diff-lcs, drb, erubi,
    i18n, io-console, json, json-schema, language_server-protocol,
    lint_roller, logger, loofah, mcp, method_source, netrc, nokogiri,
    parallel, pastel, prism, pry, pry-byebug, public_suffix, racc,
    rails-dom-testing, rails-html-sanitizer, rake, rbi, rbs, reline,
    rexml, require-hooks, securerandom, smart_properties, spoom,
    tapioca, thor, tsort, tty-color, tty-cursor, tty-reader, tty-screen,
    tzinfo, unicode-display_width, unicode-emoji, uri, wisper, yard,
    yard-sorbet, zeitwerk) and versioned renames of existing ones
  - Fix activesupport, packwerk, rainbow, tty-prompt RBIs with correct
    content for new gem versions
- Verify `bundle exec srb tc` passes with no errors

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Gems in https://github.com/sorbet/sorbet/tree/master/rbi/stdlib already
have type definitions shipped with sorbet itself, so generating tapioca
RBIs for them is redundant. Configure tapioca to exclude these and
remove the now-redundant generated RBI files.

Excluded: base64, benchmark, bigdecimal, drb, json, logger, racc,
reline, rexml, securerandom, tsort, uri

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@@ -1801,9 +1801,9 @@ def write_codeownership_config
enforce_privacy: true
owner: Bar
dependencies:
- packs/apack
Copy link
Contributor Author

Choose a reason for hiding this comment

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

These indentation changes are needed due to rubyatscale/parse_packwerk#47

(It would be nice to fix the indentation logic so that it remained yamllint-compatible, I'll look into that separately)

dduugg and others added 8 commits March 5, 2026 13:20
- Add rubocop-gusto to gemspec as a development dependency
- Add `plugins: - rubocop-gusto` to .rubocop.yml
- Run `rubocop -A` to autocorrect 490 offenses
- Regenerate .rubocop_todo.yml for remaining 91 violations that
  cannot be autocorrected (RSpec/ContextWording, Gusto/NoMetaprogramming,
  Sorbet/StrictSigil, Sorbet/ConstantsFromStrings, and others)

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
- Add inherit_mode with merge for Exclude and Include arrays so that
  exclusions from .rubocop_todo.yml and inherit_gem are merged rather
  than overridden
- Add inherit_gem to pull in rubocop-gusto's default.yml configuration
- Regenerate .rubocop_todo.yml from scratch

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
rubocop-gusto's Sorbet/BlockMethodDefinition cop autocorrected `def`
to `define_method` inside the `no_commands` block in cli.rb, which
caused Sorbet to be unable to resolve `exit_successfully` and
`parse_pack_names` as methods on Packs::CLI.

Revert to plain `def` inside the block (keeping the other good changes:
filter_map and delete_suffix) and add cli.rb to the
Sorbet/BlockMethodDefinition exclude list in .rubocop_todo.yml.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Remove Layout/LineLength, Layout/MultilineMethodCallIndentation,
Layout/FirstArgumentIndentation, Layout/ArgumentAlignment, and
Layout/BlockEndNewline from .rubocop.yml, then autocorrect the
113 resulting violations.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…efinition autocorrect

Same issue as lib/packs/cli.rb: the Sorbet/BlockMethodDefinition cop
converted plain helper defs to define_method inside the RSpec.describe
block. Revert to def and add the file to the cop's exclude list.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…s wrapper

Thor 1.x treats private methods as non-commands, making the no_commands
wrapper redundant. Replacing it with plain private defs satisfies
Sorbet/BlockMethodDefinition without resorting to define_method.

Naming/BlockForwarding remains excluded for logging.rb and configuration.rb
since anonymous & is incompatible with typed Sorbet block parameter sigs.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
The rubocop-gusto Sorbet/BlockMethodDefinition autocorrect had converted
plain helper defs to define_method inside the RSpec.describe block.
Revert to def, move packs_spec.rb from Gusto/NoMetaprogramming to
Sorbet/BlockMethodDefinition in .rubocop_todo.yml, and remove its now-
unnecessary entry from Gusto/NoMetaprogramming.

Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@dduugg dduugg changed the title Modernize dependencies and fix CI Modernize dependencies, fix CI, and add rubocop-gusto Mar 5, 2026
@dduugg dduugg enabled auto-merge (squash) March 6, 2026 00:37
@dduugg dduugg requested review from dkisselev and joemsak March 6, 2026 00:37
@dduugg dduugg merged commit bf737c6 into main Mar 7, 2026
7 checks passed
@dduugg dduugg deleted the modernize-dependencies branch March 7, 2026 00:04
@github-project-automation github-project-automation bot moved this from Triage to Done in Modularity Mar 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants