Skip to content

MONGOID-5818 Rails 8 support #5873

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

Closed
wants to merge 5 commits into from
Closed
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
17 changes: 17 additions & 0 deletions .evergreen/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -586,6 +586,10 @@ axes:
display_name: "Rails 7.2"
variables:
RAILS: "7.2"
- id: "8.0"
display_name: "Rails 8.0"
variables:
RAILS: "8.0"

- id: "test-i18n-fallbacks"
display_name: Test i18n fallbacks
Expand Down Expand Up @@ -727,6 +731,19 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: "rails-8"
matrix_spec:
ruby: ["ruby-3.2"]
driver: ["current"]
mongodb-version: "7.0"
topology: "standalone"
rails: ['8.0']
os: ubuntu-22.04
fle: helper
display_name: "${rails}, ${driver}, ${mongodb-version} (FLE ${fle})"
tasks:
- name: "test"

- matrix_name: "bson-min"
matrix_spec:
driver: [bson-min]
Expand Down
4 changes: 4 additions & 0 deletions .evergreen/config/axes.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,10 @@ axes:
display_name: "Rails 7.2"
variables:
RAILS: "7.2"
- id: "8.0"
display_name: "Rails 8.0"
variables:
RAILS: "8.0"

- id: "test-i18n-fallbacks"
display_name: Test i18n fallbacks
Expand Down
47 changes: 43 additions & 4 deletions .evergreen/config/variants.yml.erb
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: "rails-8"
matrix_spec:
ruby: ["ruby-3.2"]
driver: ["current"]
mongodb-version: "7.0"
topology: "standalone"
rails: ['8.0']
os: ubuntu-22.04
fle: helper
display_name: "${rails}, ${driver}, ${mongodb-version} (FLE ${fle})"
tasks:
- name: "test"

- matrix_name: "bson-min"
matrix_spec:
driver: [bson-min]
Expand Down Expand Up @@ -158,14 +171,40 @@ buildvariants:
tasks:
- name: "test"

- matrix_name: app-tests-rails-7
- matrix_name: app-tests-rails-master
matrix_spec:
ruby: ["ruby-3.1", "ruby-3.2"]
driver: ["current"]
mongodb-version: '7.0'
topology: standalone
app-tests: yes
rails: ['master']
os: ubuntu-20.04
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
- name: "test"

- matrix_name: app-tests-rails-8
matrix_spec:
ruby: ["ruby-3.1", "ruby-3.2"]
driver: ["current"]
mongodb-version: '6.0'
mongodb-version: '7.0'
topology: standalone
app-tests: yes
rails: ['6.1', '7.0', '7.1', '7.2']
rails: ['8.0']
os: ubuntu-20.04
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
- name: "test"

- matrix_name: app-tests-rails-7
matrix_spec:
ruby: ["ruby-3.2"]
driver: ["current"]
mongodb-version: '7.0'
topology: standalone
app-tests: yes
rails: ['7.0', '7.1', '7.2']
os: ubuntu-20.04
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
Expand All @@ -178,7 +217,7 @@ buildvariants:
mongodb-version: '5.0'
topology: standalone
app-tests: yes
rails: ['6.0']
rails: ['6.0', '6.1']
os: rhel80
display_name: "app tests ${driver}, ${ruby}, ${rails}"
tasks:
Expand Down
2 changes: 1 addition & 1 deletion .evergreen/run-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,6 @@ if test -f tmp/rspec-all.json; then
mv tmp/rspec-all.json tmp/rspec.json
fi

python3 -m mtools.mlaunch.mlaunch stop --dir "$dbdir"
python3 -m mtools.mlaunch.mlaunch stop --dir "$dbdir" || true

exit ${test_status}
4 changes: 4 additions & 0 deletions gemfiles/rails-6.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ source 'https://rubygems.org'
gem 'actionpack', '~> 6.0'
gem 'activemodel', '~> 6.0'

group :test do
gem 'activejob', '~> 6.0'
end

gemspec path: '..'

require_relative './standard'
Expand Down
3 changes: 3 additions & 0 deletions gemfiles/rails-6.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source 'https://rubygems.org'
gem 'actionpack', '~> 6.1'
gem 'activemodel', '~> 6.1'

group :test do
gem 'activejob', '~> 6.1'
end
gemspec path: '..'

require_relative './standard'
Expand Down
3 changes: 3 additions & 0 deletions gemfiles/rails-7.0.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source 'https://rubygems.org'
gem 'actionpack', '~> 7.0'
gem 'activemodel', '~> 7.0'

group :test do
gem 'activejob', '~> 7.0'
end
gemspec path: '..'

require_relative './standard'
Expand Down
3 changes: 3 additions & 0 deletions gemfiles/rails-7.1.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source 'https://rubygems.org'
gem 'actionpack', '~> 7.1'
gem 'activemodel', '~> 7.1'

group :test do
gem 'activejob', '~> 7.1'
end
gemspec path: '..'

require_relative './standard'
Expand Down
3 changes: 3 additions & 0 deletions gemfiles/rails-7.2.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ source 'https://rubygems.org'
gem 'actionpack', '~> 7.2'
gem 'activemodel', '~> 7.2'

group :test do
gem 'activejob', '~> 7.2'
end
gemspec path: '..'

require_relative './standard'
Expand Down
14 changes: 14 additions & 0 deletions gemfiles/rails-8.0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# rubocop:todo all
source 'https://rubygems.org'

gem 'actionpack', '8.0.0.beta1'
gem 'activemodel', '8.0.0.beta1'

group :test do
gem 'activejob', '8.0.0.beta1'
end
gemspec path: '..'

require_relative './standard'

standard_dependencies
4 changes: 4 additions & 0 deletions gemfiles/rails-master.gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ source 'https://rubygems.org'
gem 'actionpack', git: 'https://github.com/rails/rails'
gem 'activemodel', git: 'https://github.com/rails/rails'

group :test do
gem 'activejob', git: 'https://github.com/rails/rails'
end

gemspec path: '..'

require_relative './standard'
Expand Down
1 change: 0 additions & 1 deletion gemfiles/standard.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ def standard_dependencies
end

group :test do
gem 'activejob'
gem 'timecop'
gem 'rspec-retry'
gem 'benchmark-ips'
Expand Down
2 changes: 1 addition & 1 deletion mongoid.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ Gem::Specification.new do |s|
# Ruby 3.0 requires ActiveModel 6.0 or higher.
# activemodel 7.0.0 cannot be used due to Class#descendants issue
# See: https://github.com/rails/rails/pull/43951
s.add_dependency("activemodel", ['>=5.1', '<7.3', '!= 7.0.0'])
s.add_dependency("activemodel", ['>=5.1', '<8.1', '!= 7.0.0'])
s.add_dependency("mongo", ['>=2.18.0', '<3.0.0'])
s.add_dependency("concurrent-ruby", ['>= 1.0.5', '< 2.0'])

Expand Down
2 changes: 2 additions & 0 deletions spec/mongoid/railties/bson_object_id_serializer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
# rubocop:todo all

require 'spec_helper'
RSpec.context.skip 'This test requires Rails version specified' if ENV['RAILS'].nil?

require 'active_job'
require 'mongoid/railties/bson_object_id_serializer'

Expand Down
Loading