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

upgrading to rails 6 #513

Merged
merged 27 commits into from Apr 20, 2020
Merged

upgrading to rails 6 #513

merged 27 commits into from Apr 20, 2020

Conversation

jrochkind
Copy link
Contributor

@jrochkind jrochkind commented Nov 26, 2019

Ref #299

Changes...

Gemfile.lock of course changes to update a lot of dependencies. And Gemfile to ask for Rails6, and related dependency updates.

Most file changes are just updating some 'standard' config files to have the config or logic that would have been generated with Rails6, to stay up to date.

Additionally, some response.content_type changed to response.media_type for Rails 6. https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#actiondispatch-response-content-type-now-returned-content-type-header-as-it-is

Many dependencies updated

As of this moment, bundle update can be run regularly to update all dependencies to the latest allowed by dependency tree restrictions, getting any new versions with bugfixes, security fixes, etc. The Gemfile is such that bundle update will not update anything known to break. And this PR includes regular bundle updates so when merged we'll be getting latest versions of lots of dependencies.

Some dependencies not updated

Originally I had hoped to upgrade some other dependencies in this PR too, just get all our dependencies really spiffy, with a really tiny output in bundle outdated.

However, browse-everything is still limiting us to some old dependencies -- bundle update won't get to latest version of some dependencies because browse-everything's gemspec restricts it.

An upcoming release of browse-everything might fix this, but at the moment we can't upgrade browse-everything because it refuses to let us use sprockets 4. This may be resolved subsequently samvera/browse-everything#310 samvera/browse-everything#345

* Specify rails ~> 6.0.0 to force rails 6.0.x
* remove coffee-rails entirely; would need a different version to work with Rails 6, but Rails 6 apps don't by default include it in Gemfile, and I don't believe we are using it at all.
* Temporarily point to a `qa` (aka "questioning_authority") branch directly on github, that allows Rails 6, as qa master/release does not yet. Hope to change this before we merge this branch here.
* rspec-rails requires 4.0 beta to work with Rails 6.

We than ran `bundle update` to update ALL dependencies to latest within requirements tree; many various dependencies needed to be updated for Rails 6 even if their gemspecs didn't say so, and this is just a good time to update all our dependencies.
Apparently even when not required cause original was pure ascii anyway?
In Rails6 too. Not totally sure what's going on here.
@jrochkind
Copy link
Contributor Author

Rails6 seems to have broken our attempts under testing to use different ActiveJob queue adapters for different tests.

Very confused about what's going on, not sure if it's broken that for everyone, everyone using rspec, just us, or what. Haven't yet figured out how to fix it.

rails/rails#37270

@jrochkind
Copy link
Contributor Author

Spending some time with https://guides.rubyonrails.org/upgrading_ruby_on_rails.html to potentially manually upgrade certain other in-app things.

@jrochkind
Copy link
Contributor Author

jrochkind commented Jan 21, 2020

One test is failing because of a bug in rspec-rails.

A fix has been merged into rspec-rails master, but is not yet released. rspec/rspec-rails#2242

I would like to give it a few weeks to see if we get an rspec-rails release; the only other option we know of for moving forward is making a temporary local fork of rspec-rails and depending on that instead of an official rspec-rails release. That is possible, but would be kind of unfortunate and require us to remember to switch back to real rspec-rails in the future. (Trying to depend on rspec-rails git master instead of a release -- while ordinarily an option with git-hosted rubygems, doesn't work with rspec-rails for idiosyncratic reasons).

update rspec-rails 4.0 final finally came out, resolving

@jrochkind
Copy link
Contributor Author

jrochkind commented Jan 30, 2020

Oops, need to do a bit of cleanup with regard to new zeitwerk autoloader too, especially wrt STI.

https://guides.rubyonrails.org/upgrading_ruby_on_rails.html#require-dependency

May want to put some of that in kithe, or not. update: put it in kithe, required a yell workaround too sciencehistory/kithe#79

Generally go over zeitwerk-related upgrade notes, and run the zeitwerk check script.

@jrochkind
Copy link
Contributor Author

After deploy of rails6, people will probably have to log in again -- rails 5 cookies will end up invalidated due to new security measures in Rails6.

@jrochkind jrochkind marked this pull request as ready for review April 20, 2020 19:39
@jrochkind jrochkind merged commit 881fc10 into master Apr 20, 2020
@eddierubeiz eddierubeiz deleted the rails6 branch April 22, 2020 15:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant