Project

General

Profile

Actions

Feature #5306

closed

Separation of core and Redmine plugins

Added by Jean-Philippe Lang about 14 years ago. Updated about 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
Plugin API
Target version:
-
Start date:
2010-04-13
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Currently, Redmine plugins are mixed with Rails plugins used by the core in /vendor/plugins.
It's not very clean and it causes the following problems:
  • people somtimes move plugin directories incorrectly when upgrading
  • some Redmine plugins get loaded before core plugin
A solution would be:
  1. to move plugins used by the core into a new directory (eg. /vendor/core) and leave Redmine plugins in /vendor/plugins
  2. to override Rails plugin loading mechanism so that Redmine plugins get loaded after all the others

Feedback is welcome from plugin developpers.

Actions #1

Updated by Jean-Philippe Lang about 14 years ago

  • Category changed from Code cleanup/refactoring to Plugin API
Actions #2

Updated by Eric Davis about 14 years ago

I don't like the idea of putting Rails plugins or Redmine plugins in a different path. It would be even more code that we would need to support and maintain (and with Rails 3, who knows what would break). I think Radiant went this path by not using Engines and now they are trying to migrate back to how we are doing things.

What I recommend is:

  1. Redmine plugins are prefixed with "redmine" - the generators already do that and legacy plugins can be renamed
  2. Install Redmine plugins as Rubygems - this works really good with config/additional_environment.rb. I found one issue I'm working on and that's getting a gem's static assets to load.

Another option is to have Redmine manage the load order of it's "core" plugins itself. This is supported by Rails and would fix any loading issues. The :all option can be used to pick up all of the Redmine plugins.

# config/environment.rb

  # Only load the plugins named here, in the order given (default is alphabetical).
  # :all can be used as a placeholder for all plugins not explicitly named
  config.plugins = [ :core_1, :core_2, :all ]
Actions #3

Updated by Holger Just about 14 years ago

I'm in support of separating core Redmine plugins and user-defined ones. This would make upgrading using tar.gz files so much easier. And we would not have to abandon engines, which would be a bad idea indeed.

The seperatio could be transparently supported by moving all core-plugins to something like vendor/core_plugins and then configuring something like this:

# config/environment.rb

  # Insert /path/to/redmine/vendor/core_plugins at the top of the plugin load paths
  config.plugin_paths.insert(0, File.join(RAILS_ENV, "vendor", "core_plugins"))

From my understanding of the default plugin locator implementation in /path/to/rails/railtis/lib/rails/plugin/locator.rb, the order of the plugin load paths properly defines the load order. Using this approach, we would not have to update the environment.rb on plugin additions. This works great, if you only have to make sure that the core plugins are loaded before user plugins.

I have no idea how the RubyGem plugins have to be handled using this or the current approach.

Actions #4

Updated by Ryan Cross about 13 years ago

the approach by Holger seems like the best. The adjustment of load order by Eric could be used in addition to this approach as well if it is ever needed.

Actions #5

Updated by Ivan Cenov about 11 years ago

This issue is outdated. Redmine 2.x.x uses /plugins folder for plugins.
I propose this issue to be closed.

Actions #6

Updated by Daniel Felix about 11 years ago

  • Status changed from New to Closed

Well this seems to done in the 2.x branches.
If there is any regression to close this, please reopen this issue. Otherwise this one is done.

Actions

Also available in: Atom PDF