-
Notifications
You must be signed in to change notification settings - Fork 39
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 to Rails 6.1 / Ruby 2.7 #663
Conversation
Config was taken from a vanilla Rails 6.1
@@ -39,5 +39,4 @@ | |||
# Ignore local seeds file | |||
db/seeds.local.rb | |||
|
|||
# Ignore vagrant configuration/runtime files | |||
.vagrant/ | |||
/config/master.key |
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.
This is something I think we need to put in as a secret in kube that maps to this location, and I guess keep in our vault separately.
gem 'sync', :require => false # required by more_core_extensions | ||
gem 'rugged', :require => false | ||
gem 'minigit', '~> 0.0.4' | ||
gem 'net-ssh', '~> 7.2.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.
We can probably drop the ~>
here or use >=
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.
wow, that's a version bump. 😉
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.
A few comments. Looks good so far.
gem 'sync', :require => false # required by more_core_extensions | ||
gem 'rugged', :require => false | ||
gem 'minigit', '~> 0.0.4' | ||
gem 'net-ssh', '~> 7.2.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.
wow, that's a version bump. 😉
include Sidekiq::Worker | ||
sidekiq_options :queue => :miq_bot | ||
module PullRequestMonitorHandlers | ||
class MergeTargetTitler |
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.
oh ruby and collapsed namespacing random bugs it causes
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 actually don't think this was related. This was because of that eager load thing. Even so, I want to keep this, since it was the only outlier.
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.
Yes, it might not have been the cause this time but it certainly can cause weird constant lookup strangeness.
# -*- mode: ruby -*- | ||
# vi: set ft=ruby : | ||
|
||
Vagrant.configure("2") do |config| |
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.
Were systemd and vagrant setups we wanted to resurrect later? Maybe systemd?
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.
No I don't think so, but git is forever :)
|
||
puts "\n== Restarting application server ==" | ||
system! 'bin/rails restart' | ||
end |
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.
Curiosity. I don't see a commit title related to this change, is this just normalizing bin/setup to what we've done elsewhere or is it solving a problem you hit in the upgrade?
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.
Normalizing to the default bin/setup.
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.
Actually most of this is the default Rails file - only the part about database.yml.sample was normalizing.
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.
cool, it wasn't clear if you just took the defaults and changed them after or left them as is. 👍
@@ -1,4 +1,6 @@ | |||
# Be sure to restart your server when you modify this file. | |||
|
|||
# Configure sensitive parameters which will be filtered from the log file. | |||
Rails.application.config.filter_parameters += [:password] | |||
Rails.application.config.filter_parameters += [ | |||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn |
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.
is it intentional to drop :password
from this list? Not sure if this is rails defaults overriding our values.
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.
filter parameters are substring match, so passw includes password. This is the same original file, so we didn't "add" password originally as it was the default.
Can you update the CI ruby to test against 2.7? |
config/environments/development.rb
Outdated
config.eager_load = true | ||
config.eager_load = false |
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.
Done. |
Tests are failing because rails db:prepare doesn't seem to be doing what it's supposed to do on CI - I'll dig in. |
if ENV["CI"] | ||
system! 'RAILS_ENV=test bin/rails db:prepare' | ||
else |
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'm not sure why we need this - feels like a bug in Rails, but it's fine for now.
noticed this typo in the commit message |
Hmmm, is it possible it's trying to load from schema.rb? |
Checked commits Fryguy/miq_bot@2b0cea1~...68b775b with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint **
config/application.rb
config/environments/development.rb
config/environments/production.rb
config/initializers/session_store.rb
config/initializers/wrap_parameters.rb
config/puma.rb
lib/git_service/branch.rb
spec/models/batch_job_spec.rb
|
This makes a lot more sense if we go commit by commit.
I can pull some of these out as separate PRs to make this easier.
@bdunne @jrafanie I'd like your thoughts on how to move forward.
I tried to get to Ruby 3, but the hard part is actually upgrading faraday, because the specs mess around with the guts of faraday which have changed.