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.

Environment for plugin development

Added by Thibault B at 2011-06-01 01:38 pm

Hi everybody,

I'll soon be developing plugins for ChiliProject and Redmine, and after reading a lot of documentation I'm still missing some information, mainly about development process and testing. I must add I've read quite a lot, but have no significant experience in Rails development.

I've gone through both ChiliProject and Redmine forums, without finding relevant answers to my questions...

To summarize, my main questions are:

  • How do you run your tests ?
    • Is there any remote debugger server ? (although I guess the answer is a no)
    • How do you run several instances (different versions) of Redmine/ChiliProject on a same machine, assuming it's not supported ?
    • Is working in SET_ENV="development" or "test" enough to isolate your production instance of ChiliProject from the development one ?
  • How do you deal with differences between ChiliProject and Redmine (like i18n handling ?)

If you have any relevant ressources or answers to give me I would greatly appreciate it! I've read many tutorials and docs but can't get the whole development process clearly.

Thank you for work, and your answers if you have any minute

Thibault


Replies (2)

RE: Environment for plugin development - Added by Eric Davis at 2011-06-10 04:42 pm

Thibault B wrote:

  • How do you run your tests ?

I write tests for each plugin and run them directly from the plugin directory (not the main ChiliProject directory). Basically what I'm trying to do is to make sure my plugin works as expected with ChiliProject.

I've written a small Ruby gem that I use in my Rakefile that helps build the tasks I use when testing. You can see it loaded in the Rakefile of most of my newer plugins along with some tests.

https://github.com/edavis10/chiliproject_auto_wiki

  • Is there any remote debugger server ? (although I guess the answer is a no)

Yes, in a way.

  1. Install the ruby-debug gem
  2. In your code put debugger where you want to start the debugger
  3. Run the code

If you are running the code in a test, the debugger will start automatically. If your code is running on a server, you can use rdebug -c to connect to it. I use the remote debugger to connect to Passenger that is running locally.

You will want to look up the documentation on ruby-debug. It's a complex tool but something I use daily.

  • How do you run several instances (different versions) of Redmine/ChiliProject on a same machine, assuming it's not supported ?

I'm running passenger locally so I'm running 3 versions. My desktop is named "acheron" and I have my DNS set up so any subdomain goes to my machine

  • cp.acheron => my ChiliProject development directory
  • redmine.acheron => my Redmine development directory (used for legacy code and client work still)
  • acheron/redmine => my Redmine development directory but using a sub-uri to test out various things

Now each directory also supports multiple versions too. I just

  1. switch the version of the code - git checkout v1.4.0
  2. change my database (I have one per version and several client databases) - EDITOR config/database.yml
  3. restart Passenger so the code is reloaded - touch tmp/restart.txt
  • Is working in SET_ENV="development" or "test" enough to isolate your production instance of ChiliProject from the development one ?

Never heard of SET_ENV before. First, I never run tests on my production server. Second, the test_helper.rb and rake tasks should switch over to the RAILS_ENV="test" environment automatically.

  • How do you deal with differences between ChiliProject and Redmine (like i18n handling ?)

Right now there aren't that many differences, but they will be in the future. My plan is to:

  1. Provide some compatibility classes and methods to smooth over the differences. I've already had to do this when Redmine changed it's own internal APIs.
  2. Stop supporting Redmine once the differences are too great.

I'd say you could probably get away with some compatibility classes for the next 6 months or so. You'll want to stay updated on changes done to both projects though, that way to you can spot major changes before someone uses them in production.

If you have any relevant ressources or answers to give me I would greatly appreciate it! I've read many tutorials and docs but can't get the whole development process clearly.

It's kinda hard for me to think about what else to talk about. I've done Redmine and now ChiliProject development since mid 2007 so there is a lot of knowledge that I've internalized that I don't even know. But if you run into a problem or have a question, post here and we can try to get you some advise. (and I'll post larger answers to the wiki and/or my blog too)

Eric Davis

RE: Environment for plugin development - Added by Thibault B at 2011-06-14 08:18 am

Thank you very much for this valuable information.

This is really helpful, I'll post here if I discover useful information for newcomers.
I'll keep up with the wiki, your blog and twitter.

Many thanks,
Thibault

(1-2/2)