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
Rails 7 support? #385
Comments
I'm interested to contribute to this repo by resolving this issue. However, this will be the first time I will be opening a PR on github and I'm in need of some guidance on how to proceed. So far, I have forked the repository, cloned it and have it run existing tests using As the next step, I generated new config for appraisal. Note: we need to use the main branch of devise for rails 7 compatibility.
With that done, I found that mongoid is breaking on rails 7 too with the error. Please let me know how best I can help to move this forward. |
We need this done too. Is there a maintainer you could contact directly @mmhan? |
@gonzalo-bulnes Us too 👍🏼 |
@mmhan Maybe try again now that Rails 7 is officially released. Also found this: Might need to add those as dependencies - not sure but worth a shot: gem 'activemodel-serializers-xml' |
Hi @mmhan, Opening a PR is the right way to go! ❤️ Note that as long as Devise's support for Rails 7 is not released, we'll have to wait. This gem relies heavily on Devise, and relying on unstable versions of Devise is not an option. Don't let that prevent you from preparing your PR from Devise's With regards to @OskarEichler suggestion: I haven't looked at the situation in detail, but some parts of Rails are sometimes extracted to gems. That is usually documented in the Rails migration docs from one version to another. |
See also: #367 on the topic of Mongoid support. |
@gonzalo-bulnes Thanks so much for looking into this! As far as I can tell the main branch of Devise is the stable branch - the older stable branches haven't been updated in years, and the main branch is very actively maintained. Maybe worth opening an issue and asking if the main branch can be considered stable and used. Will do that right now ;) |
Note @OskarEichler that even if the When any dependency is updated, it is possible that its changes are incompatible with the way you use them (depend on them). If that were to happen, any installation of your gem would stop working the way it is expected (which may or not be obvious, but could be hard to detect). Usually, with well-maintained gems, like Devise, the features that are dependable are documented, and their maintainers communicate when breaking changes happen by choosing carefully the new release number (see semantic versioning). If any gem doesn't reference its dependencies by release number... well, it cannot take advantage of that information. 🤷♀️ On the contrary, if a gem references its dependencies by release number, when a new release breaks important assumptions nothing happens, because the previous release remains in use until explicitly updated. 🥇 That is what I meant when I said "unstable" - if it was based on the Summary: Devise will eventually create a release that supports Rails 7, until then, we're not ready to support it either! Does this make sense? |
Hey @gonzalo-bulnes, thanks so much for the long explanation - makes total sense. They did release version 4.8.1 with Rails 7 support on the main branch (here)- why not just lock in the dependancy at that version? |
Great @OskarEichler, that solves the Devise requirement. 4.8.1 is within the existing version constraints for Devise, which means that Devise 4.8.1 can already be used with this gem, and there isn't anything special that need to be done for that. On the testing side of things, now the appraisal that @mmhan got started (above) can be updated to reference Devise 4.8.1 ✅ (Appraisals allow to test specific combinations of dependencies together.) Then will likely remain to follow up on Mongoid in the same way 🙂 |
I'm afraid things are a little too much at home right now with all the activities related to settling in after recently migrating from one country to another. I will get back to this once all the dust has settled. Feel free to take over from here if anyone wishes to. If not, I'll drop a comment when I can get around to it. |
No rush on my side! Thanks for following up @mmhan (and sharing your progress in the first place!) It seems @OskarEichler is on a good track, and maybe this will incentive others to join the thread 🙂 |
@gonzalo-bulnes Okay I tested all of this, thanks for the help here @mmhan The issue this is failing is because mongoid hasn't been updated to support Rails 7 yet, see here: When running Appraisal it actually resolves mongoid to an old beta version (4.0.0.beta2) because that probably didn't have a gemspec. It's not compatible and once forcing the latest version of Mongoid by specifying it in the Appraisal file the bundler fails because it is not yet compatible:
Will need to wait until Mongoid is updated... |
@gonzalo-bulnes Actually it seems like mongoid is only a dependancy for development:
Can this potentially be ignored or why do you need it in development mode? |
Looks like Mongoid was updated to support Rails 7 a few days ago. Was that the only thing holding this up? |
@amorimlucas Just updated Mongoid and looks like everything is working now indeed! @gonzalo-bulnes Made a PR here for you to review and merge: #391 |
@gonzalo-bulnes Any progress on this? Is there someone else that could make this merge? Thx |
@OskarEichler Thank you! |
Just wanted to check in and see if #391 is any closer to being merged? 🙏 🙏 🙏 |
Using #391 as a base, I ran the tests using Ruby 2.5 (except with Rails 7, which only supports Ruby 2.7+) and 2.7 complete successfully, but Ruby 3.0 and 3.1 have three test failures on all Rails versions. All three are almost identical failures and while I haven't looked into them yet, I believe it's because of Ruby 3.0+'s kwarg handling, but I could be wrong. Also I don't think these are related to Rails 7 support so are not necessarily blocking. The test failures looks like this:
@gonzalo-bulnes, would you be open to a little cleanup of supported Ruby and Ruby on Rails versions? Rails 5.2 hits EOL in two weeks, Ruby 2.6 hit EOL a month ago, but personally I think maintaining EOL Rubies like 2.5 is easier than older Rails versions. Since old versions of the gem would continue to work for users of older versions, I'd like to propose the following cleanup:
What do you think? PS: I haven't taken a closer look at mongoid support and if |
As an outside observer looking for Rails 7 support, that sounds like a good plan @aried3r. 😄 Any update on Rails 7 support? I'd like to upgrade the opensource project I maintain but am blocked by this gem (which is a great and very helpful gem). Willing to jump in if needed. |
Hi everyone! I'm catching up on the thread.
Mongoid is a "peer dependency". It made little sense to me to require it if you don't use it, but since support for Mongoid was added, I wouldn't remove it without careful consideration (and a major versiom change). |
@aried3r You're certainly making a good argument for scoping the supported Rails version range. In my experience, Rails support tends indeed to require more compromises than supporting older Rubies. (example) I have tried to keep support until now to avoid breaking backwards compatibility. More by principle than for any practical reason, so it may be time to do a pragmatic pruning and make a I'll get to the test failures in a separate comment. |
Adding to my comment on @aried3r proposal for support pruning: dropping support for |
To everyone in the thread, thank you. I know my involvment has been long to come, and I appreciate how you've stepped in to research, discuss, write code for, test and provide feedback on #391. This is exactly what many people starting open-source project wish to see. It is what I've wished to see for sure. Maintaining whatever project is a significant amount of work in the long run, and I think it's fair to say that my earlier attempts to get this kind of dynamics going were not successful. I'm very glad to see this (especially because it's been somewhat unexpected!), and I want to acknowledge @mmhan @OskarEichler @aried3r @pglombardo and everybody else involved for your work on this. ❤️ In the meantime, Travis CI changed their policies, which is a bit of a set back. I'd love to get some alternative going so that we can release either |
Feel free to copy .github/workflows/ruby.yml file to enable Github Actions. Also suggested in #391. |
what's the state of this? Does anyone need help to push this forward? I don't mind to help |
Closed via #401 |
Given than rails 7 has released an alpha version, is rails 7 support coming to simple_token_authentication soon?
The text was updated successfully, but these errors were encountered: