-
Notifications
You must be signed in to change notification settings - Fork 394
Upgrade Ruby to 3.1.0 #1881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Upgrade Ruby to 3.1.0 #1881
Conversation
5818df6 to
c9e71d6
Compare
c9e71d6 to
16c7708
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR upgrades Ruby from version 2.7.1 to 3.1.0, updating dependencies and modifying code to ensure compatibility with Ruby 3.1.0's stricter requirements around keyword arguments and standard library changes.
Key changes:
- Ruby version upgraded from 2.7.1 to 3.1.0 across all configuration files
- Dependency versions updated in Gemfile and Gemfile.lock to Ruby 3.1.0-compatible versions
- Code updated to handle Ruby 3.1.0's stricter keyword argument passing requirements and removal of
static_facadefrom attr_extras 7.x
Reviewed changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| .ruby-version | Updated Ruby version from 2.7.1 to 3.1.0 |
| Gemfile | Updated Ruby version and pinned gem versions with pessimistic version constraints for Ruby 3.1.0 compatibility |
| Gemfile.lock | Updated all gem versions to Ruby 3.1.0-compatible releases |
| circle.yml | Updated Docker images: Ruby 2.7.1 → 3.1, PostgreSQL 9.5 → 14.0, Redis 5.0.7 → 6.2 |
| config/boot.rb | Added require "logger" for Ruby 3.1.0 compatibility (Logger no longer auto-loaded) |
| bin/webpack | Added require "logger" for Ruby 3.1.0 compatibility |
| spec/spec_helper.rb | Added require "logger" for Ruby 3.1.0 compatibility |
| spec/presenters/plan_presenter_spec.rb | Added double splat operator (**) when passing hashes to keyword argument initializers |
| spec/models/plan_selector_spec.rb | Added double splat operator (**) when passing hashes to keyword argument initializers |
| app/services/report_invalid_config.rb | Replaced static_facade :call with explicit class method (attr_extras 7.x compatibility) |
| app/services/rebuild_pull_request.rb | Replaced static_facade :call with explicit class method (attr_extras 7.x compatibility) |
| app/services/deactivate_repo.rb | Replaced static_facade :call with explicit class method (attr_extras 7.x compatibility) |
| app/services/build_config.rb | Replaced static_facade :call with explicit class method (attr_extras 7.x compatibility) |
| app/queries/recent_builds_by_repo_query.rb | Replaced static_facade :call with explicit class method (attr_extras 7.x compatibility) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| gem "dotenv-rails", "~> 2.7.5" | ||
| gem "foreman", "~> 0.87.0" | ||
| gem "listen", "~> 3.9.0" | ||
| gem "rspec-rails", "~> 4.0.0.beta4" |
Copilot
AI
Dec 4, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The version constraint ~> 4.0.0.beta4 should be updated to ~> 4.0.0 to reflect the stable version 4.0.2 that's actually being used in Gemfile.lock. Using a beta version constraint when a stable release is available is misleading.
| gem "rspec-rails", "~> 4.0.0.beta4" | |
| gem "rspec-rails", "~> 4.0.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a valid comment. Is there a reason we want the beta4 or the upgrade is just not part of this PR?
| gem "dotenv-rails", "~> 2.7.5" | ||
| gem "foreman", "~> 0.87.0" | ||
| gem "listen", "~> 3.9.0" | ||
| gem "rspec-rails", "~> 4.0.0.beta4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like a valid comment. Is there a reason we want the beta4 or the upgrade is just not part of this PR?
| @@ -1,5 +1,11 @@ | |||
| class BuildConfig | |||
| static_facade :call | |||
| def self.call(hound_config:, name:, owner:) | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to add a newline between static_facade and new method def?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We removed static_facade. What am I missing?
|
|
||
| expect(plan_selector.previous_plan). | ||
| to eq StripePlan.new(StripePlan::PLANS[2]) | ||
| to eq StripePlan.new(**StripePlan::PLANS[2]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does the ** do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is converting a Stripe plan hash to keyword arguments. Ruby no longer supports passing a hash, we need to use ** to convert.
irb(main):002* def wat(one:, two:)
irb(main):003* puts one
irb(main):004* puts two
irb(main):005> end
=> :wat
irb(main):006> wat({one: 1, two: 2})
(irb):2:in `wat': wrong number of arguments (given 1, expected 0; required keywords: one, two) (ArgumentError)
from (irb):6:in `<main>'
from /Users/scott/.rbenv/versions/3.1.0/lib/ruby/gems/3.1.0/gems/irb-1.15.3/exe/irb:9:in `<top (required)>'
from /Users/scott/.rbenv/versions/3.1.0/bin/irb:25:in `load'
from /Users/scott/.rbenv/versions/3.1.0/bin/irb:25:in `<main>'
irb(main):007> wat(**{one: 1, two: 2})
1
2
=> nil
| else | ||
| super | ||
| end | ||
| end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you need to add this private method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This overrides enqueue_job and allows us to process specific versions of Rubocup with dedicated queues. It's our way of deciding which linter app processes the job.
| commit_file = build_commit_file(filename: "lib/a.rb") | ||
| allow(linter).to receive(:version).and_return("1.81.7") | ||
| job_setter = double("job_setter") | ||
| allow(LintersJob).to receive(:set).with(queue: "rubocop-1.81.7").and_return(job_setter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [95/80]
| module Linter | ||
| class Rubocop < Base | ||
| FILE_REGEXP = /.+(\.rb|\.rake|\.jbuilder)|(Gemfile|Rakefile|Podfile)\z/ | ||
| VERSIONS_WITH_DEDICATED_QUEUES = %w[1.81.7].freeze |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gylaz let's use a version that's not officially supported in case there are issues with the linter app.
88c0abc to
32e909b
Compare
This will also use a dedicated queue for Rubocop v1.81.7.