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 Update Misses Feedback #24983

Closed
hmistry opened this issue May 11, 2016 · 3 comments
Closed

Rails Update Misses Feedback #24983

hmistry opened this issue May 11, 2016 · 3 comments

Comments

@hmistry
Copy link
Contributor

hmistry commented May 11, 2016

I recently updated my Rails project from 5.0.0.beta2 to 5.0.0.rc1 using rails rails:update. Here's a list of things where it missed or did not provide feedback.

I resolved this manually but posting only to provide you with feedback. Hope this helps.

Context:

Steps to reproduce

Take existing Rails 5.0.0.beta2 app, update Gemfile, run bundle install, and then run rails rails:update.

Expected behavior

It magically updated all the config files to the new one with all my edits in place! (just kidding on last part)

Actual behavior

It did not make the following changes:

  • delete cable.coffee and replace with cable.js
  • changes to application.html.erb. Since I'm using HAML, I don't expect it to autofix it, but I think a print out in STDOUT to change the data-turbolinks-track from true to reload would be nice.
  • all changes to require paths in Rakefile, config.ru, config/*
  • did not create config/initializers/ssl_options.rb and config/initializers/to_time_preserves_timezone.rb files

In cases where config options were removed or it can't make changes like in my application.haml file, falling back to a note STDOUT to inform the user of the changes would be really nice to have and prevents pain down the road.

System configuration

Rails version: 5.0.0.rc1
Ruby version: 2.3.0

@prathamesh-sonpatki
Copy link
Member

prathamesh-sonpatki commented May 15, 2016

@hmistry Thanks for the report. But Rails update task does not guarantee automagically replacing files or configs during upgrades between beta to beta or beta to RC releases. This is because things keep changing between beta and RC releases. (Example - cable.coffee to cable.js)

Also check discussion on #23450 for similar issue report.

config/initializers/ssl_options.rb and config/initializers/to_time_preserves_timezone.rb are not created for applications upgraded from older versions. This is to maintain the backward compatibility.

In cases where config options were removed or it can't make changes like in my application.haml file, falling back to a note STDOUT to inform the user of the changes would be really nice to have and prevents pain down the road.

Though this is nice to have feature, upgrades during beta and RC releases are expected to have such things. Also this is sort of a feature request so please discuss it on rubyonrails core mailing list. The issue tracker is reserved for bug reports only.

@hmistry
Copy link
Contributor Author

hmistry commented May 15, 2016

@prathamesh-sonpatki Yep I was not expecting it to automagically upgrade. I tried the feature and provided feedback where it fell short so the team can look into it depending on time and resources. I was pleased to see that it performed as well as it did.

I'll pass the nice to have feature to the mailing group.

config/initializers/ssl_options.rb and config/initializers/to_time_preserves_timezone.rb are not created for applications upgraded from older versions. This is to maintain the backward compatibility.

This sounds contradictory. If this is not for upgrades from old applications, then what backward compatibility is it trying to maintain?

@prathamesh-sonpatki
Copy link
Member

@hmistry Because those are breaking changes for old applications. See #22663 (comment) and c9c5788a for the reasons behind why these are breaking changes for older apps.

In case of config/initializers/ssl_options.rb you will get a deprecation warning in an older app upgraded to Rails 5 explaining you about the new HSTS option so you can upgrade your app accordingly.

I am not sure how we should handle the case of config/initializers/to_time_preserves_timezone.rb. May be follow the same approach of deprecation warning of HSTS subdomains config for older apps, so that they know of this change. @pixeltrix Thoughts?

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

No branches or pull requests

2 participants