Re-introduce Base#format and Collection#format to fix Rails 7.1 tests#2412
Merged
joelhawksley merged 10 commits intomainfrom Aug 5, 2025
Merged
Re-introduce Base#format and Collection#format to fix Rails 7.1 tests#2412joelhawksley merged 10 commits intomainfrom
joelhawksley merged 10 commits intomainfrom
Conversation
cda24f4 to
5ae119c
Compare
5ae119c to
004314c
Compare
4647985 to
01162ab
Compare
joelhawksley
approved these changes
Aug 5, 2025
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.
What are you trying to accomplish?
ViewComponent's tests suddenly started failing in CI a few days ago. This PR is the result of my investigation, and should repair the build. It does four things:
ViewComponent::Base#formatmethod back for Rails 7.1 only.~> 7.1.0instead of~> 7.1.What approach did you choose and why?
First, I performed a
git bisectand discovered the test failures started happening under Rails 7.1 after this PR was merged. Strangely, the the same tests passed when the PR was originally created, so I tried to run them on my laptop. I was unable to reproduce a passing test suite.Further investigation revealed that gemfiles/rails_7.1.gemfile contains perhaps too loose a version constraint on Rails:
Although I was not able to determine the root cause for certain, here's my current hypothesis:
bundle installnumerous times on main, both with and without a lockfile, but bundler always installed Rails 7.1. This indicates to me that some other dependency must be influencing the Rails version somehow. Strangely however, I was also able to force Rails 7.2 to install by updating the version constraint to~> 7.2. So actually maybe we've run into a bug in bundler 😅