-
Notifications
You must be signed in to change notification settings - Fork 970
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 rails 2.3.14 to 4.0.4 #130
Comments
Assigning it to @bsharanya as this task has started |
@bsharanya we can create a rails4 branch to do patch by patch. sharing the branch, let us going on it. I am very interesting the migration process. please let us can involved. |
TODO: #149 |
@xiaods we are going to try trunk based development with feature toogle for this, so you should be able to see the changes on the main repo. Currently we are doing some ground work for this like library updates (jruby-complete, jruby-rack) & gem updates (rails, rspec etc.). Trying to get the spec server running the specs. Once this much is done you can start contributing by fixing the specs/controllers/views etc. Does that make sense? Looking forward to your contribution. |
#130 - Remove RubyRuntimeFinder. Not used.
@srinivasupadhya yes, I will follow your suggestion to do some research on this codebase. let me have a try. |
Considering the current Rails version (2.3.4) I assume the project uses vendorized gems without Bundler. Migrating to a bundler-based setup is a requirement to this update, what about creating a different issue for that (which could be made without changing the Rails version)? |
However, JRuby at
Unfortunately, according to Bundler compatibility list the minimum version for I was trying to find a way to decouple the introduction of Bundle, this upgrade, the "ground work" @srinivasupadhya is currently doing and #149 but I don't think it's possible. @srinivasupadhya , is there any issue created for this "ground work"? |
created new rake file for this. RAILS_WORKING_DIR is 'rails.new' moved command to run tests from script/spec to rspec fixed format of rspec-extra-formatters create spec_helper: rails new myapp --skip-active-record --skip-javascript --skip-test-unit; cd myapp; add rspec & rspec-rails in Gemfile; bundle install; rails generate rspec:install; copy spec_helper.rb into rails.new/spec added dummy model & spec command to run spec: ./tools/bin/go.jruby -S rake --rakefile server/run_rspec_tests_use_new_rails.rake spec
./tools/bin/go.jruby -S gem install rspec --no-ri --no-rdoc ./tools/bin/go.jruby -S gem install rspec-rails --no-ri --no-rdoc ./tools/bin/go.jruby -S gem install rspec-extra-formatters --no-ri --no-rdoc install gems required to run rspec tests
For the tests, we load the Spring application context, which starts activemq, ehcache, h2, etc. which start daemon threads, which do not allow rspec to finish (and exit) once the tests are done (when run using autorun). Explicitly exit with the status code.
#130 - Make rspec exit after successful run.
./tools/bin/go.jruby -S gem install spork -v=1.0.0rc4 --no-rdoc --no-ri
#130 Add support to spork to rails.new tests
#130 - move backup_controller to rails.new
Had to move feeds_helpers & the spec for it as part of this. Commented out pipeline_details_url from feeds_helper as it needs a bunch of other things.
#130 - Fixed bug. rails.new/spec was getting packaged in installers
Because of the script tag not being closed, the next script, which was the one which set contextPath (var contextPath = ...) was not getting executed. Was causing many pages to fail rendering.
#130 - Fix script tag. Fixes many issues.
#130 - Fix broken Velocity pages for old rails after assets changes
* The class_eval action_view_extension.rb was being used to omit id generation for fields. Since ':id => nil' does the same task, replacing omit_id_generation with that. * Have added tests in few places. Didn't add tests for partials where new spec files were required to be added as it's a very small change.
* The action_view_extension.rb was used to provide omit_id_generation tag to omit the generation of id for the specified field. The usage of omit_id_generation has been replaced with ':id => nil' which does the same job of omitting the id from the specified fields. * This class also provided the to_check_box_tag with the ability to remove the hidden field tag from the field if required. This tag is no longer valid in Rails 4 and is not being used in the migrated classes.
* Using Ruby 1.9 hash syntax and added missing spaces around the braces.
* Using Ruby 1.9 hash syntax and added missing spaces around the braces.
…tinue working on those.
* The class_eval action_view_extension.rb was being used to omit id generation for fields. Since ':id => nil' does the same task, replacing omit_id_generation with that. * Have added tests in few places. Didn't add tests for partials where new spec files were required to be added as it's a very small change.
* The action_view_extension.rb was used to provide omit_id_generation tag to omit the generation of id for the specified field. The usage of omit_id_generation has been replaced with ':id => nil' which does the same job of omitting the id from the specified fields. * This class also provided the to_check_box_tag with the ability to remove the hidden field tag from the field if required. This tag is no longer valid in Rails 4 and is not being used in the migrated classes.
* Using Ruby 1.9 hash syntax and added missing spaces around the braces.
* Reverting the commit as inlining of partials wouldn't happen if Hound's feedbacks are incorporated.
…n production mode. Rails will continue to serve it in development mode. This is done to help with performance.
#130 - Implemented code-walkthrough feedback
#130 - Moved the usage of 'omit_id_generation=>true' to ':id=>nil'
All rails 4 issues seem to be fixed |
Go uses a 2.3.x release of Rails, which recently got deprecated. It causes Go to not be able to take advantage of new improvements in Rails. Causes people to have to use antiquated Rails contsructs rather than the new ones. We haven't been able to upgrade till now since rails 3 is not backward compatible & it's a daunting task to migrate all views at once - because of API changes in Rails, dependency on JRuby, RSpec and other gems. It feels like one upgrade was missed a few years ago and then it was too late.
Tasks:
Will need to first upgrade JRuby and Jetty to the newer revisions, since newer Rails releases do not support the old JRuby revision that is used (corresponds to Ruby 1.8.6). Then, need to do a pretty big upgrade to all Rails code in the codebase. Need to bring in Bundler into the codebase for gem management.
Biggest hurdles will be:
Default ERB syntax has changed, so most ERB files will not work out of the box, but will silently fail when viewed (will show ERB code on the rendered page).
RSpec needs to be upgraded, since the old gem will not work with the new JRuby/Rails combination. Most tests will fail.
The text was updated successfully, but these errors were encountered: