ChiliProject is not maintained anymore. Please be advised that there will be no more updates.

We do not recommend that you setup new ChiliProject instances and we urge all existing users to migrate their data to a maintained system, e.g. Redmine. We will provide a migration script later. In the meantime, you can use the instructions by Christian Daehn.

Upgrade to Rails 3.latest (Feature #601)


Added by Felix Schäfer at 2011-09-01 04:49 am. Updated at 2013-09-25 12:54 pm.


Status:Open Start date:2011-09-01
Priority:Normal Due date:
Assignee:- % Done:

0%

Category:Libraries
Target version:4.0.0
Remote issue URL: Affected version:

Description

Now that rails 3.1 is officially out, we should (try to) upgrade to it.


rails3.png (84.8 kB) Toshi MARUYAMA, 2013-07-10 01:11 am

rails3.odg (12.3 kB) Toshi MARUYAMA, 2013-07-10 01:11 am

rails3-small.png (53.5 kB) Toshi MARUYAMA, 2013-07-10 01:13 am

rails2-git-mbox.diff (155.3 kB) Toshi MARUYAMA, 2013-07-14 02:08 am

rails3-git-mbox.diff (2.3 MB) Toshi MARUYAMA, 2013-07-14 02:08 am


History

Updated by Felix Schäfer at 2011-09-01 05:00 am

I've begun some work on this, and the I got the application to load (just in irb, not in a rack server or even in a browser…):

chiliproject $ bundle exec irb
>> require ::File.expand_path('../config/environment',  __FILE__)
=> true
>> defined? ChiliProject::Application
=> "constant"

I took a lot of shortcuts to get this working though, so let's say that this is 0,5% of the way ;-)

The biggest problem currently is that the autoloader finds lib/chili_project/version.rb when looking for something defining a Version in a has_many :versions call. I haven't found a proper way to tell the has_many method that we want to use ::Version and not just any Version for that, but it doesn't seem to care… I'll see if tweaking the lazy-load order helps…

Updated by Felix Schäfer at 2011-09-03 05:31 pm

Current status:

chiliproject $ rails c
Loading development environment (Rails 3.1.0)
>> 

In other words: it loads ;-)

My current working branch is on github, I still have some work done on named_scope s (replaced by scope s in rails 3) I need to commit and push though, so what's on github probably won't load for the moment.

Updated by Felix Schäfer at 2011-09-04 07:51 pm

Added the rest needed to get rails console to work, it should work from e4e0be3 onward. Could anyone confirm this?

Updated by Holger Just at 2011-09-04 09:08 pm

  • Subject changed from rails 3 to Upgrade to Rails 3.1
  • Tracker changed from Bug to Feature

Updated by Felix Schäfer at 2011-09-05 09:32 pm

Current status: rails s will show the welcome page!

OK, so that's been the fun part, all this is from testing by hand and everything, I haven't even tried running the test suite for now. As I'm not sure how well the test suite (more precisely: parts of the test framework used) upgrades to rails 3 (I think at least object_daddy hasn't officially been updated to support rails 3) and seeing that everyone's complaining about the test suite anyway, I might start porting it to rspec2 as a next step (see the discussion in the forums about switching to rspec2 for more info or if you want to give an opinion before I begin…).

Updated by Felix Schäfer at 2011-09-18 06:52 pm

I've begun converting the tests to rspec2/shoulda and factory_girl, the results for the News tests (model, routing, controller) can be found on GitHub (and have already yielded bugfixes…), comments welcome.

Updated by John Yani at 2012-02-02 10:56 pm

Subject should be changed to "Upgrade to Rails 3.2"

Updated by John Yani at 2012-02-21 11:10 pm

There's a great progress on the same issue in redmine: http://www.redmine.org/issues/4796
All main features except for wiki are working fine.

Any chance of porting what Toshi has done with Redmine to Chiliproject?

Updated by John Yani at 2012-03-27 05:21 pm

Any milestone for rails 3 support? Redmine 2.0 is planned to be soon after 1.4.0 release.

Updated by John Yani at 2012-05-06 03:56 pm

Redmine 2.0.0 is expected to be released in two weeks. Is there any effort to merge theirs work?

Updated by John Yani at 2012-05-16 03:09 pm

Redmine 2.0.0 is out. What's the status of chiliproject's Rails 3 support?

Updated by Felix Schäfer at 2012-05-17 06:24 pm

John, sorry for the lack of response, we're all pretty much taken up by our other lives at the moment (mostly university and family, things should be moving smoother again after Euruko), I'll try to blog about it in not too long.

Regarding Rails 3 support: we're not there yet. If your only goal is to have project management on rails 3, well, we're not it. Yet.

Rails 3 status: nothing really new, we're still trying to figure out the best way to support and/or deprecate older stuff.

Updated by Holger Just at 2012-08-01 11:49 am

The update to Rails 3.latest (currently 3.2.7) is the main goal of the ChiliProject 4.0.0 release.

  • Subject changed from Upgrade to Rails 3.1 to Upgrade to Rails 3.latest
  • Target version set to 4.0.0

Updated by Robert Mitwicki at 2012-09-03 08:58 am

Hi, to make a little update

I work all the time on preparing CP to work with r3.2 the progress is very slow but at least it start worked in browser.
I also keep update it with master branch to make sure that after all we will have all existing changes.

The plan is to prepare it to work with all existing functionality (in palaces where it will be possible of course).
It will allow everybody to migrate quite smooth to new version.
After that start implement new, better solutions.

Link to branch:
https://github.com/mitfik/chiliproject/tree/rails3.2

cheers

Updated by Qadeer Mohammed at 2012-09-07 07:10 pm

Hi Robert,
I am new to redmine/chiliproject and currently learning a bit of ruby & rails. I have configured a local instance of chiliproject my machine using your version of the code https://github.com/mitfik/chiliproject/tree/rails3.2, but when i try to migrate the database, it fails at the point where permissions are being created.

-- create_table("users", {:force=>true})
   -> 0.1454s
-- create_table("versions", {:force=>true})
   -> 0.1239s
-- add_index("versions", ["project_id"], {:name=>"versions_project_id"})
   -> 0.1386s
-- create_table("workflows", {:force=>true})
   -> 0.1219s
rake aborted!
An error has occurred, all later migrations canceled:

Can't mass-assign protected attributes: controller, action, description, sort, is_public

Tasks: TOP => db:migrate
Click here to rerun the task with tracing enabled

Any help with this? I would like to contribute to the project (but yes once i get comfortable with ruby & rails)..!

Updated by Toshi MARUYAMA at 2013-06-10 01:01 am

It seems ChiliProject members have restarted Rails3 porting.
I don't know why do not they announce here.

This is my Japanese presentation that how we ported Redmine to Rails3.

Updated by Felix Schäfer at 2013-06-10 09:20 am

Toshi MARUYAMA wrote:

It seems ChiliProject members have restarted Rails3 porting.

Yes.

I don't know why do not they announce here.

Because we're currently trying to iron out the biggest kinks and are trying to find a way/guidelines for contributors to help us without us drowning in helping them. Furthermore, we've announced it so many times with the effort dying off quickly afterwards that we didn't want to announce it too soon.

This is my Japanese presentation that how we ported Redmine to Rails3.

We'll have a look, thanks! :-)

Updated by Toshi MARUYAMA at 2013-06-26 07:21 am

http://railslts.com/

With the release of Rails 4, support for Rails 2.3 has ended.

Updated by Toshi MARUYAMA at 2013-07-09 12:49 am

Felix Schäfer wrote:

This is my Japanese presentation that how we ported Redmine to Rails3.

We'll have a look, thanks! :-)

http://marutosi.bitbucket.org/redmine-shinagawa-20120519/one-html/html/index.html#rails3-1

  • 互換性のあるものをtrunkに入れる(バックポート)
    • ビュー html_safe
    • モデル validate
      • r6714 2011-08-29 Redmine ローカル
  • Mercurialの transplant(移植)拡張 と Mercurial Queues (MQ)拡張 を併用
  • (git/hgの)mergeではなく rebase
    • コミット単位を小さくする
    • リビジョンを 直線 にする
    • Rails 3.0 -> 3.1 -> 3.2 と順番にする
      • それぞれのバージョンで「廃止」があり、切り分けが困難

Updated by Felix Schäfer at 2013-07-09 09:58 am

Toshi I'm very sorry but even with Google Translate your slides are very difficult to read for us, for example:

(git/hgの)mergeではなく rebase
コミット単位を小さくする
リビジョンを 直線 にする
Rails 3.0 -> 3.1 -> 3.2 と順番にする
それぞれのバージョンで「廃止」があり、切り分けが困難

translates to:

rebase rather than merge (the git / hg)
I commit to reduce the unit
I want to line the revision
I want to order> and 3.2 - Rails 3.0 -> 3.1
There are "obsolete" for each version, carved difficult

To be honest I can't make heads or tails of half of it.

Now regarding the comment you made on Github:

It is too hard to port jumping Rails 3.2.
You should port Rails 3.0 -> 3.1 -> 3.2.

Rails 3.0 and 3.1 are not maintained anymore and a lot of things added in 3.2 are not available in Rails 3.0 and 3.1, thus the plan was always to move to Rails 3-latest. I don't deny it will be a lot of work, but we're not convinced that taking all the extra steps in between with all the required extra work to support the quirks of the Rails versions in between is worth it.

Anyway, we have decided to try to directly update to 3.2, this is currently not open to debate.

Updated by Toshi MARUYAMA at 2013-07-09 04:47 pm

Redmine revision 6714
http://www.redmine.org/projects/redmine/repository/revisions/6714

 1Index: attachment.rb
 2===================================================================
 3--- attachment.rb    (revision 6713)
 4+++ attachment.rb    (revision 6714)
 5@@ -24,6 +24,7 @@
 6   validates_presence_of :container, :filename, :author
 7   validates_length_of :filename, :maximum => 255
 8   validates_length_of :disk_filename, :maximum => 255
 9+  validate :validate_max_file_size
10
11   acts_as_event :title => :filename,
12                 :url => Proc.new {|o| {:controller => 'attachments', :action => 'download', :id => o.id, :filename => o.filename}}
13@@ -45,7 +46,7 @@
14   cattr_accessor :storage_path
15   @@storage_path = Redmine::Configuration['attachments_storage_path'] || "#{Rails.root}/files" 
16
17-  def validate
18+  def validate_max_file_size
19     if self.filesize > Setting.attachment_max_size.to_i.kilobytes
20       errors.add(:base, :too_long, :count => Setting.attachment_max_size.to_i.kilobytes)
21     end

Rails 3.0 suggests "validate" is obsolete.
But Rails 3.1 does not.
How do you catach it on Rails 3.2?

We ran all tests on Rails 3.0 and we fixed.
But you cannot catch "validate" check on Rails 3.2.
How do you fix it on Rails 3.2?

Updated by Toshi MARUYAMA at 2013-07-10 01:11 am

Rails3 porting policy figure

Updated by Toshi MARUYAMA at 2013-07-10 01:13 am

Small figure.

Updated by Felix Schäfer at 2013-07-13 11:45 am

Toshi MARUYAMA wrote:

Rails 3.0 suggests "validate" is obsolete.
But Rails 3.1 does not.
How do you catach it on Rails 3.2?

We ran all tests on Rails 3.0 and we fixed.
But you cannot catch "validate" check on Rails 3.2.
How do you fix it on Rails 3.2?

You're right, we would have missed it. It's a risk we're willing to take.

I really appreciate that you want to help, but opening countless pull requests without much explanation is confusing, at least for me. I'll be happy to take your contributions under consideration, but please follow these guidelines:
  • No work is planned in the current master (currently Rails 2.3) branch, that branch will only be updated with security fixes as needed until it is replaced by the Rails 3 work.
  • The current unstable branch is to be port to Rails 3.2 and we are not planning on going through Rails 3.0 and Rails 3.1. We might do some rebasing of the unstable branch at a later time to regroup and squash commits, but it currently is a work branch, we will certainly find things at a later time that we overlooked in previous commits (for example the app/views/my/blocks that were forgotten in 6ee13d0 and added in 5fd3eeb can be squashed) and as such it matters a little less if the commits aren't all exceptionally neat right now.

Regarding deprecation warnings in Rails 3.0 or Rails 3.1 that we might miss, for example that #validate methods from ActiveRecord::Base subclasses won't be used to validate models anymore as you have pointed out, do you have a list that we could use to check ChiliProject?

Updated by Toshi MARUYAMA at 2013-07-13 05:04 pm

Felix Schäfer wrote:

Regarding deprecation warnings in Rails 3.0 or Rails 3.1 that we might miss, for example that #validate methods from ActiveRecord::Base subclasses won't be used to validate models anymore as you have pointed out, do you have a list that we could use to check ChiliProject?

No.

Only way is "Porting all features and passing all tests on Rails 3.0".
The issue is not only deprecation but also routing.

OpenProject keeps default route.
https://github.com/opf/openproject/blob/d7903ef92892c9595da/config/routes.rb#L517

1match '/:controller(/:action(/:id))'

Redmine removed default route on Rails2.
http://www.redmine.org/projects/redmine/repository/revisions/8162
And we added all routing tests.

Rails 3.0 supports both of old and new format route.
Firstly, you should adjust old format routing on Rails 3.0.

Updated by Toshi MARUYAMA at 2013-07-14 01:24 am

Felix Schäfer wrote:

  • No work is planned in the current master (currently Rails 2.3) branch, that branch will only be updated with security fixes as needed until it is replaced by the Rails 3 work.
  • The current unstable branch is to be port to Rails 3.2 and we are not planning on going through Rails 3.0 and Rails 3.1.

If it is true, what is status current unstable branch?
Why don't you merge unstable to master?

If you don't use current unstable branch, you should remove current unstable branch.

Updated by Toshi MARUYAMA at 2013-07-14 01:32 am

Felix Schäfer wrote:

  • The current unstable branch is to be port to Rails 3.2 and we are not planning on going through Rails 3.0 and Rails 3.1. We might do some rebasing of the unstable branch at a later time to regroup and squash commits, but it currently is a work branch,

Will you do history editing on central repository?
https://github.com/chiliproject/chiliproject

It is very stupid.
You should use forked repository.
GitHub limits one forked repository on one account.
It is ridiculous limitation.
You should use other repository instead of GitHub.
For example, Bitbuket or building on own hosting machine.

Updated by Toshi MARUYAMA at 2013-07-14 02:08 am

Felix Schäfer wrote:

I really appreciate that you want to help, but opening countless pull requests without much explanation is confusing, at least for me.

My policy is very simple.

Updated by Toshi MARUYAMA at 2013-07-14 02:30 am

Felix Schäfer wrote:

I really appreciate that you want to help, but opening countless pull requests without much explanation is confusing, at least for me.

If you feel pull request is confusing, you should not use pull request.

As I described Japanese presentation,
http://marutosi.bitbucket.org/redmine-shinagawa-20120519/one-html/html/index.html#github2
pull request is not suitable for big well-maintained centralized project.

Linus refused pull request.
https://github.com/torvalds/linux/pull/17

Mercurial and its related projects (TortoiseHg, hgsubversion, hg-git) refuse pull request.
https://bitbucket.org/durin42/hg-git/pull-request/13/fix-pulling-from-multiple-clones/activity

Updated by Toshi MARUYAMA at 2013-07-14 02:48 am

Felix Schäfer wrote:

I really appreciate that you want to help, but opening countless pull requests without much explanation is confusing, at least for me.

This policy is that Eric suggested us.
http://www.redmine.org/issues/4455#note-143

If you can convert the code it into multiple patches I can review and apply individually, then that would be great. For example:

  • one patch for branch support
  • one patch for tag support
  • one patch to fix bug 3421
  • ...

Updated by Toshi MARUYAMA at 2013-07-16 11:28 pm

dff8cf66 which removed Ruby 1.8 contains unstable changes.
Why do you merge unstable to stable first?

Updated by Toshi MARUYAMA at 2013-07-21 08:12 am

Felix Schäfer wrote:

Rails 3.0 and 3.1 are not maintained anymore and a lot of things added in 3.2 are not available in Rails 3.0 and 3.1, thus the plan was always to move to Rails 3-latest. I don't deny it will be a lot of work, but we're not convinced that taking all the extra steps in between with all the required extra work to support the quirks of the Rails versions in between is worth it.

Anyway, we have decided to try to directly update to 3.2, this is currently not open to debate.

I send pull request Rails 3.0 porting , Rails 3.1 porting and Rails 3.2 porting

Travis tests of Rails 3.0 and Rails 3.1 show many DEPRECATION WARNING.
But, Rails 3.2 does not.

It is obvious that you should port to Rails 3.0 then Rails 3.1.

Updated by Toshi MARUYAMA at 2013-09-03 03:46 am

Done ratio: 20%

I cannot change done ratio of this issue.

Main pull request

Done work

On Rails2

On Rails3.0

I removed almost all "DEPRECATION WARNING".

On Rails3.1 and Rails3.2

Routing tests pass.

Notes

There are many functional test failures due to html escaping on Rails3.
Because I don't use ChiliProject, I won't fix these failures.

Because ChiliProject team have not accepted any pull requests,
I cannot continue porting.
So, I stopped porting.

Updated by John Yani at 2013-09-25 12:54 pm

Ironically, it is obvious that all the points in the Why fork? are relevant to Chiliproject. Development and maintenance of Redmine is much more active.

Also available in: Atom PDF