Skip to content

Conversation

@salbertson
Copy link
Member

@salbertson salbertson commented Dec 4, 2025

This will also use a dedicated queue for Rubocop v1.81.7.

@salbertson salbertson force-pushed the upgrade-rails-and-ruby branch from 5818df6 to c9e71d6 Compare December 4, 2025 18:53
@salbertson salbertson force-pushed the upgrade-rails-and-ruby branch from c9e71d6 to 16c7708 Compare December 4, 2025 19:01
@salbertson salbertson requested a review from Copilot December 4, 2025 19:23
@salbertson salbertson self-assigned this Dec 4, 2025
@salbertson salbertson requested a review from gylaz December 4, 2025 19:23
Copilot finished reviewing on behalf of salbertson December 4, 2025 19:26
Copy link

Copilot AI left a 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_facade from 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"
Copy link

Copilot AI Dec 4, 2025

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.

Suggested change
gem "rspec-rails", "~> 4.0.0.beta4"
gem "rspec-rails", "~> 4.0.0"

Copilot uses AI. Check for mistakes.
Copy link
Member

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"
Copy link
Member

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:)
Copy link
Member

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?

Copy link
Member Author

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])
Copy link
Member

Choose a reason for hiding this comment

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

What does the ** do?

Copy link
Member Author

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
Copy link
Member

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?

Copy link
Member Author

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)
Copy link

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
Copy link
Member Author

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.

@salbertson salbertson force-pushed the upgrade-rails-and-ruby branch from 88c0abc to 32e909b Compare December 6, 2025 18:27
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.

3 participants