Skip to content
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 & Ruby 3.1 #3330

Open
benjaminfaure opened this issue Jul 18, 2023 · 4 comments
Open

Rails 7 & Ruby 3.1 #3330

benjaminfaure opened this issue Jul 18, 2023 · 4 comments
Assignees
Labels
effort-medium 1/2 to 1 day of dev time infrastructure

Comments

@benjaminfaure
Copy link
Contributor

I recently updated DMP OPIDoR to Rails 7 & Ruby 3.1.

The upgrade has been fairly easy, the most notable changes coming from Ruby 3.1. I'll send a PR for this update.

https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/
Ruby 3.1 brings an autocomplete feature in the Rails console. It can be usefull if you use it a lot.
The main changes is a new syntax suger for hash literals, they tried to add something a bit similar to ES6 Javascript ;

Values in Hash literals and keyword arguments can be omitted.
    {x:, y:} is syntax sugar for {x: x, y: y}.
    foo(x:, y:) is syntax sugar for foo(x: x, y: y).

This change triggers a lot a rubocop warning, as it now expects apps to use this new syntax.
It can be automatically fixed by Rubocop. We might have to discuss if we keep this change or if we deactivate the rule, as the syntax is not really clear.

@benjaminfaure benjaminfaure added infrastructure effort-medium 1/2 to 1 day of dev time labels Jul 18, 2023
@benjaminfaure benjaminfaure self-assigned this Jul 18, 2023
This was referenced Jul 18, 2023
@johnpinto1
Copy link
Contributor

johnpinto1 commented Jul 24, 2023

Bringing this change would be good. We need to keep up to date with developments. So @benjaminfaure can suggest a way of introducing the change gradually to the code? You said Rubocop autofixes code. So maybe just doing it as a PR as I think you suggested at the last meeting. We can ask others to contribute to discussion too.

@briri
Copy link
Contributor

briri commented Jul 24, 2023

Agree that this would be a good change. We should stay up to date with the latest trends. It will however require a lot of testing since our current code coverage isn't great.

@benjaminfaure
Copy link
Contributor Author

I think by using the rubocop -a/rubocop -A command, Rubocop can autofix most of the syntax issue, this one included.

I can do a commit on this branch with the rubocop fixes if you want

@aaronskiba
Copy link
Contributor

aaronskiba commented Sep 4, 2024

In terms of the Roadmap 2024 Q4 Project Backlog, it is looking like only the Rails 7 upgrade will be included for now (Rails 7 PR: #3426).

A further Rails upgrade to 7.2 will probably occur in the near future to address the following issue: #3429. Perhaps the Ruby 3.1 upgrade will be done at that time as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort-medium 1/2 to 1 day of dev time infrastructure
Projects
None yet
Development

No branches or pull requests

4 participants