Skip to content

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
jamis merged 9 commits into
mongodb:masterfrom
johnnyshields:actually-test-rails
Sep 2, 2025
Merged

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
jamis merged 9 commits into
mongodb:masterfrom
johnnyshields:actually-test-rails

Conversation

@johnnyshields

@johnnyshields johnnyshields commented May 9, 2025

Copy link
Copy Markdown
Contributor

Fun fact: Mongoid's CI is not testing the following versions of Rails at all:

  • 6.0.x
  • 7.0.x
  • 7.1.x

The reason is that gem 'actionpack', '~> 6.0' resolves to 6.Y.Z where Y and Z are the highest possible version. To enforce it is actually testing 6.0.Z, one must declare it as ~> 6.0.0

In 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.

@johnnyshields
johnnyshields requested a review from a team as a code owner May 9, 2025 11:20
@johnnyshields
johnnyshields force-pushed the actually-test-rails branch from 4c4e43c to 6d9d656 Compare May 9, 2025 11:27
@johnnyshields johnnyshields changed the title Actually test Rails 6.0.0, 7.0.0, 7.1.0, and released version of 8.0.0 [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 May 12, 2025
@johnnyshields johnnyshields changed the title [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 [🛠️ 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 May 12, 2025
@johnnyshields johnnyshields changed the title [🛠️ 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 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 May 12, 2025
Copilot AI review requested due to automatic review settings August 29, 2025 13:27

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

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 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.Y to ~> X.Y.0 format 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.

@johnnyshields

Copy link
Copy Markdown
Contributor Author

Any reason this is not merged yet?

@jamis jamis left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks, @johnnyshields!

jamis added 3 commits August 29, 2025 14:54
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.
@jamis
jamis merged commit 5e7df1c into mongodb:master Sep 2, 2025
63 checks passed
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.

4 participants