Skip to content
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

Remove support for Rails 6.1 #1151

Merged
merged 1 commit into from
Jan 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ jobs:
fail-fast: false
matrix:
gemfile:
- gemfiles/rails_6_1.gemfile
- gemfiles/rails_7_0.gemfile
- gemfiles/rails_7_1.gemfile
- gemfiles/rails_7_2.gemfile
Expand Down
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ gem "debug"
gem "mocha"
gem "puma"
if !@rails_gem_requirement
gem "rails", ">= 6.1"
gem "rails", ">= 7.0"
Copy link
Member

Choose a reason for hiding this comment

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

We might not need that version requirement since have a requirement for the Rails frameworks we use in the gemspec. To be checked, but no big deal.

ruby ">= 3.2.0"
else
# causes Dependabot to ignore the next line and update the previous gem "rails"
Expand Down
10 changes: 5 additions & 5 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ PATH
remote: .
specs:
maintenance_tasks (2.10.1)
actionpack (>= 6.1)
activejob (>= 6.1)
activerecord (>= 6.1)
actionpack (>= 7.0)
activejob (>= 7.0)
activerecord (>= 7.0)
csv
job-iteration (>= 1.3.6)
railties (>= 6.1)
railties (>= 7.0)
zeitwerk (>= 2.6.2)

GEM
Expand Down Expand Up @@ -287,7 +287,7 @@ DEPENDENCIES
maintenance_tasks!
mocha
puma
rails (>= 6.1)
rails (>= 7.0)
rubocop
rubocop-shopify
selenium-webdriver
Expand Down
6 changes: 1 addition & 5 deletions app/models/maintenance_tasks/run.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ class Run < ApplicationRecord
]
COMPLETED_STATUSES = [:succeeded, :errored, :cancelled]

if Rails.gem_version >= Gem::Version.new("7.0.alpha")
enum :status, STATUSES.to_h { |status| [status, status.to_s] }
else
enum status: STATUSES.to_h { |status| [status, status.to_s] }
end
enum :status, STATUSES.to_h { |status| [status, status.to_s] }

after_save :instrument_status_change

Expand Down
6 changes: 0 additions & 6 deletions gemfiles/rails_6_1.gemfile

This file was deleted.

2 changes: 0 additions & 2 deletions lib/maintenance_tasks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
require "job-iteration"
require "maintenance_tasks/engine"

require "patches/active_record_batch_enumerator"

# The engine's namespace module. It provides isolation between the host
# application's code and the engine-specific code. Top-level engine constants
# and variables are defined under this module.
Expand Down
24 changes: 0 additions & 24 deletions lib/patches/active_record_batch_enumerator.rb

This file was deleted.

2 changes: 1 addition & 1 deletion maintenance_tasks.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Gem::Specification.new do |spec|
spec.bindir = "exe"
spec.executables = ["maintenance_tasks"]

minimum_rails_version = "6.1"
minimum_rails_version = "7.0"
spec.add_dependency("actionpack", ">= #{minimum_rails_version}")
spec.add_dependency("activejob", ">= #{minimum_rails_version}")
spec.add_dependency("activerecord", ">= #{minimum_rails_version}")
Expand Down
9 changes: 1 addition & 8 deletions test/application_system_test_case.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@
# warning in Ruby 2.7.
Capybara::Selenium::Driver.load_selenium

if Rails::VERSION::MAJOR < 7
Selenium::WebDriver.logger.ignore(:browser_options)
if Rails::VERSION::MINOR < 1
require "action_dispatch/system_testing/browser"
# prevent Rails from adding --headless at the end of the arguments, overriding --headless=new
ActionDispatch::SystemTesting::Browser.redefine_method(:options) { capabilities }
end
elsif Rails.gem_version < Gem::Version.new("7.1")
if Rails.gem_version < Gem::Version.new("7.1")
Selenium::WebDriver.logger.ignore(:capabilities)
end

Expand Down
Loading