MONGOID-5872 - [🛠️ Let's Fix Mongoid's Broken CI] Actually test Rails 6.0.0, 7.0.0, 7.1.0, and released version of 8.0.0 - #5980
Merged
Conversation
johnnyshields
force-pushed
the
actually-test-rails
branch
from
May 9, 2025 11:27
4c4e43c to
6d9d656
Compare
We have MONGOID-5812 for separately addressing Ruby 3.4 support
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR fixes Mongoid's CI configuration to ensure proper testing of specific Rails major versions by making gem version constraints more precise. The issue was that loose version constraints like ~> 6.0 were resolving to the latest patch versions (e.g., 6.Y.Z) instead of testing the intended major.minor versions.
- Updates gem version constraints from
~> X.Yto~> X.Y.0format for Rails 6.0, 6.1, 7.0, 7.1, 7.2, and 8.0 - Changes Rails 8.0 from pinned RC version to stable release pattern
- Ensures CI actually tests the intended Rails versions rather than unintended newer patch releases
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| gemfiles/rails-6.0.gemfile | Updates Rails 6.0 gem constraints to ~> 6.0.0 format |
| gemfiles/rails-6.1.gemfile | Updates Rails 6.1 gem constraints to ~> 6.1.0 format |
| gemfiles/rails-7.0.gemfile | Updates Rails 7.0 gem constraints to ~> 7.0.0 format |
| gemfiles/rails-7.1.gemfile | Updates Rails 7.1 gem constraints to ~> 7.1.0 format |
| gemfiles/rails-7.2.gemfile | Updates Rails 7.2 gem constraints to ~> 7.2.0 format |
| gemfiles/rails-8.0.gemfile | Changes from pinned RC version to ~> 8.0.0 stable release pattern |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Contributor
Author
|
Any reason this is not merged yet? |
Rails 6.0 doesn't have the necessary plumbing to allow us to massage the BSON value into something that can be interpreted as numeric. Rails 6.0 is EOL, though, and rather than copy-and-paste the entire validate_each implementation to support a dead version of Rails, we'll just skip the test when that version of Rails is installed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fun fact: Mongoid's CI is not testing the following versions of Rails at all:
The reason is that
gem 'actionpack', '~> 6.0'resolves to6.Y.Zwhere Y and Z are the highest possible version. To enforce it is actually testing6.0.Z, one must declare it as~> 6.0.0In addition, Rails 8.0 is pinned at 8.0.0-rc2, i.e. not the latest 8.0.Z release.
Please kindly backport this to any branches under stable maintenance to ensure that future patches to those branches also have proper test coverage.