-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Fix the type of handlers options passed to render #2521
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
Merged
+9
−9
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would feel confident with merging this to
main
if we had a confirmation that withto_sym
all supported Rails versions (from soft-supported 5.0 and 5.1) up to 6.1 still work fine.Can you recall, what was the failing cucumber scenario for 7.0 without
.to_sym
exactly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't recall but I think that calling
render
without arguments raisesActionView::MissingTemplate
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems that an exception is raised if the path described in the description contains handler, locales, etc. as shown below. Sorry I don't know that there is such a test in rspec-rails' cucumber.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is that the change would break on an older version of Rails. As this is something that was not thought forward to be changed in the future, there might not be a test for it. Sorry for being extra cautious.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pirj In that case would it be possible to release this as a new major version
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pirj So I just saw this discussion after making a similar commit to the PR I opened a few days ago. I'm a little confused as to what the concern is.
We know symbols work on Rails versions in CI because the relevant Cucumber feature (
features/view_specs/view_spec.feature:124
) passes for those versions. If symbols didn't work on a particular Rails version that feature would fail.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fair enough. For some reason, I failed to find this feature.
Wondering if it works equally fine with
variant
andlocale
.For the reference, a discussion about
format.to_sym
.This discussion has an argument "if they don't support symbols, it's a Rails bug, and people using older versions of Rails, they should stick to older versions of
rspec-rails
". We've started adhering to semver since then, and currently we officially support Rails 5.2 and soft-support 5.0 and 5.1 (please correct if I'm wrong with this again). From my perspective, it would be quite irresponsible to break the currentrspec-rails
5.0.x for users of Rails 5.Even though we claim that:
and
We have a release strategy @JonRowe has described here that I've recently violated with the merge of that PR, hopefully without any breaking impact for the users.
For the future researchers, it might be surprising that Rails 7.0 compatibility support appears in
rspec-rails
5.0.3/5.1.0 releases that target Rails 6.0 and 6.1.I suggest branching
rails-7-0-dev
frommain
, and merging this PR and #2552 to it.When we release 5.0.3 and 5.1.0, it can be merged back to
main
, and it will be time forrspec-rails
6.0.@JonRowe Does this make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what it's worth, that approach sounds reasonable to me.
That said I'm not sure why there's a "soft support" for Rails 5 and 5.1. If you want to support them, why not just add them to CI? If they can't be added to CI, are they actually supported?
It's worth noting that PR #2552 + #2546 has only 2 code changes of very limited scope that could end users of spec-rails:
On top of these changes, this PR symbolizes a few other values passed to ActionView::Base.
That's a very small, tightly scoped set of changes. So the potential blast radius and risk of impact on end users is very limited.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want to support them, and we don't want to break them. The reason is to drop some burden, mostly branching in specs:
Actually, by looking at the former, there are two changes that presumably break Rails 5.0 support. But 5.1 may still work.
Right 👍
Please don't get me wrong with my rant above, I'm all for merging both ASAP and releasing this as 6.0.0-pre without bothering with 5.0.3 and 5.1.0.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess I just consider "soft support" very harmful because it adds ambiguity and discussion to almost any change, without any kind of authoritative answer. If it's in CI, then you know you didn't break it (or you broke it and need to fix it). Saving a few branches is in my view not worth the ambiguity on nearly every material PR. In my experience it sows up work (and open source work) substantially.
But I'm not a maintainer here, so I'll of course defer to the library maintainers.