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 rails 2.3.14 to 4.0.4 #130

Closed
bsharanya opened this issue Apr 25, 2014 · 11 comments
Closed

upgrade rails 2.3.14 to 4.0.4 #130

bsharanya opened this issue Apr 25, 2014 · 11 comments

Comments

@bsharanya
Copy link
Contributor

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.

@sachinsudheendra
Copy link
Contributor

Assigning it to @bsharanya as this task has started

@xiaods
Copy link
Contributor

xiaods commented Apr 28, 2014

@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.

@srinivasupadhya
Copy link
Contributor

TODO: #149

@srinivasupadhya
Copy link
Contributor

@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.

@srinivasupadhya srinivasupadhya changed the title upgrade rails 2.3.14 to 4.x upgrade rails 2.3.14 to 4.0.4 Apr 30, 2014
mdaliejaz added a commit that referenced this issue Apr 30, 2014
#130 - Remove RubyRuntimeFinder. Not used.
@xiaods
Copy link
Contributor

xiaods commented Apr 30, 2014

@srinivasupadhya yes, I will follow your suggestion to do some research on this codebase. let me have a try.

@juniorz
Copy link
Contributor

juniorz commented Apr 30, 2014

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)?

@juniorz
Copy link
Contributor

juniorz commented Apr 30, 2014

However, JRuby at tools/jruby is at version 1.8.6 and is incompatible with latest bundler

$ gocd/tools/jruby/bin/jruby -S gem install bundler
ERROR:  Error installing bundler:
    bundler requires Ruby version >= 1.8.7

$ gocd/tools/jruby/bin/jruby -S gem install bundler -v=1.0
ERROR:  Error installing bundler:
    bundler requires RubyGems version >= 1.3.6

$ gocd/tools/jruby/bin/jruby -S gem --version
1.3.5

Unfortunately, according to Bundler compatibility list the minimum version for rubygems is 1.3.6.

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"?

srinivasupadhya added a commit that referenced this issue May 7, 2014
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
srinivasupadhya added a commit that referenced this issue May 7, 2014
./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
arvindsv added a commit to arvindsv/gocd that referenced this issue May 8, 2014
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.
srinivasupadhya added a commit that referenced this issue May 8, 2014
#130 - Make rspec exit after successful run.
juniorz added a commit to juniorz/gocd that referenced this issue May 8, 2014
./tools/bin/go.jruby -S gem install spork -v=1.0.0rc4 --no-rdoc --no-ri
srinivasupadhya added a commit that referenced this issue May 12, 2014
#130 Add support to spork to rails.new tests
bsharanya added a commit that referenced this issue May 19, 2014
#130 - move backup_controller to rails.new
bsharanya added a commit to bsharanya/gocd that referenced this issue May 20, 2014
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.
bsharanya added a commit to bsharanya/gocd that referenced this issue May 20, 2014
bsharanya added a commit to bsharanya/gocd that referenced this issue May 21, 2014
sachinsudheendra added a commit that referenced this issue Sep 16, 2014
#130 - Fixed bug. rails.new/spec was getting packaged in installers
sachinsudheendra added a commit that referenced this issue Sep 16, 2014
arvindsv added a commit to arvindsv/gocd that referenced this issue Sep 16, 2014
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.
arvindsv added a commit that referenced this issue Sep 16, 2014
jyotisingh added a commit that referenced this issue Sep 17, 2014
#130 - Fix broken Velocity pages for old rails after assets changes
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Sep 22, 2014
* 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.
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Sep 22, 2014
* 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.
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Sep 22, 2014
* Using Ruby 1.9 hash syntax and added missing spaces around the braces.
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Sep 22, 2014
* Using Ruby 1.9 hash syntax and added missing spaces around the braces.
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Sep 23, 2014
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Sep 23, 2014
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Sep 23, 2014
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Sep 23, 2014
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Oct 1, 2014
* 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.
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Oct 1, 2014
* 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.
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Oct 1, 2014
* Using Ruby 1.9 hash syntax and added missing spaces around the braces.
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Oct 1, 2014
* Reverting the commit as inlining of partials wouldn't happen if Hound's feedbacks are incorporated.
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Oct 7, 2014
…n production mode. Rails will continue to serve it in development mode. This is done to help with performance.
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Oct 7, 2014
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Oct 7, 2014
jyotisingh added a commit to jyotisingh/gocd that referenced this issue Oct 8, 2014
pravds added a commit that referenced this issue Oct 8, 2014
#130 - Implemented code-walkthrough feedback
mdaliejaz added a commit to mdaliejaz/gocd that referenced this issue Oct 9, 2014
arvindsv added a commit that referenced this issue Oct 13, 2014
#130 - Moved the usage of 'omit_id_generation=>true' to ':id=>nil'
@arikagoyal
Copy link
Contributor

All rails 4 issues seem to be fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants