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

Upgrade Ruby to version 2.7.4 #4662

Merged
merged 3 commits into from
Sep 8, 2021
Merged

Upgrade Ruby to version 2.7.4 #4662

merged 3 commits into from
Sep 8, 2021

Conversation

javierm
Copy link
Member

@javierm javierm commented Aug 15, 2021

Objectives

  • Update Ruby to a more recent version
  • Use a version of Ruby which includes version 2 of the Bundler gem so it's compatible with more development/production environments

Notes

Ruby 2.7 introduced a separation of positional and keyword arguments, which caused warnings on almost every existing gem. This was solved by silencing those warnings in Ruby 2.7.2. However, before merging this pull request we're still going to update as many gems as possible and check the warnings in order to study how hard it will be to upgrade to Ruby 3.

@javierm javierm self-assigned this Aug 15, 2021
@javierm javierm added this to Reviewing in Consul Democracy via automation Aug 15, 2021
@javierm javierm marked this pull request as draft August 15, 2021 18:31
@javierm javierm moved this from Reviewing to Doing in Consul Democracy Aug 15, 2021
@javierm javierm moved this from Doing to Reviewing in Consul Democracy Aug 27, 2021
@javierm javierm marked this pull request as ready for review August 27, 2021 01:14
@javierm javierm changed the base branch from master to dependabot/bundler/master/rubocop-rails-and-rubocop-performance-and-rubocop-rspec-and-rubocop-2.11.3 September 3, 2021 10:11
Note this version includes Bundler 2, so we can finally upgrade.
We were getting hundreds of "warning: URI.escape is obsolete" messages.
So we're using `URI::DEFAULT_PARSER.escape` instead.

IMHO it's OK to add this monkey-patch because we're replacing Paperclip
with Active Storage, and when we finish with that we'll delete this
file.
Copy link
Member

@Senen Senen left a comment

Choose a reason for hiding this comment

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

Hi, @javierm

As ruby 2.7 already includes bundler version 2 I wonder if we may delete the line 38 from the Dockerfile. Same with /bin/setup#L17 and /bin/update#L17 🤔

The Dockerfile seems to work fine when running docker build -t consul . without the mentioned line.

@Senen Senen self-assigned this Sep 7, 2021
@javierm
Copy link
Member Author

javierm commented Sep 7, 2021

@Senen It looks like we could have actually done so after upgrading to Ruby 2.6 🤔. But, yes, now it's a good moment 👍.

I've updated the pull request changing the Dockerfile. I'm not so sure about the other two, since those are scripts automatically generated by Rails and use the --conservative flag, which means that line won't do anything:

time gem install bundler --conservative
=> gem install bundler --conservative  0,42s user 0,16s system 114% cpu 0,508 total

I'm usually fond of deleting code that does nothing, but since this is an external script and every time we upgrade to a new Rails version we'd have to remember to remove this line, I'd vote for leaving it like that.

@javierm javierm force-pushed the ruby2.7 branch 2 times, most recently from 8982dc7 to f087d6f Compare September 7, 2021 19:08
I think we could have already done so when upgrading Ruby to version
2.6.x (which also included the Bundler gem), but since we didn't, now
that we've upgraded to Bundler 2.x it's probably a good moment.
Base automatically changed from dependabot/bundler/master/rubocop-rails-and-rubocop-performance-and-rubocop-rspec-and-rubocop-2.11.3 to master September 8, 2021 10:13
Consul Democracy automation moved this from Reviewing to Testing Sep 8, 2021
Copy link
Member

@Senen Senen left a comment

Choose a reason for hiding this comment

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

💎

@javierm javierm merged commit e5cd763 into master Sep 8, 2021
Consul Democracy automation moved this from Testing to Release 1.4.0 Sep 8, 2021
@javierm javierm deleted the ruby2.7 branch September 8, 2021 10:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants