プロジェクト

全般

プロフィール

Vote #77557

未完了

Plugin load order defined by inter-plugin dependencies

Admin Redmine さんが約4年前に追加.

ステータス:
Reopend
優先度:
通常
担当者:
-
カテゴリ:
-
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
0
version_id:
0
issue_org_id:
23131
author_id:
3866
assigned_to_id:
0
comments:
7
status_id:
8
tracker_id:
2
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Reopend]

説明

Currently plugins requiring another plugin not yet loaded will cause a hard error, forcing plugin authors to somehow name their plugins to have a name that will be sorted after the names of all the other plugins they rely on in the default sort order (alphabetical I'd guess). See source:/tags/3.3.0/lib/redmine/plugin.rb#L236 for the method to require other plugins, which will throw a hard error on line 251 on @Plugin.find@ when the plugin hasn't been loaded yet.

This was something handled in ChiliProject, see https://github.com/chiliproject/chiliproject/commit/a24a24eb1980625fbc4558fc44f15498e883d2d9

Would something like that be of interest to Redmine? We could take care of adapting that patch to current Redmine trunk.


journals

--------------------------------------------------------------------------------
Felix, I think that it would be a good thing if the Redmine core would include _some_ solution for this issue. Please see #6324 (authored by Tim Felgentreff) and specifically the patch by Jean-Baptiste Barth in #6324#note-8.
Kind regards, Mischa.
--------------------------------------------------------------------------------
Thanks, I hadn't seen that one.

This is _not_ the same requirement and solution though, as it is not possible to depend on _code_ in not-yet-loaded plugins with this solution.

Example: Plugin A requires Plugin B and specifically needs @lib/b.rb@ from that plugin to be require-able, which wouldn't work with the solution in #6324.

The referenced ChiliProject commit allows for this. It is a more generic (and in my opinion better) solution to that problem.
--------------------------------------------------------------------------------
That is not entirely true. Requiring plugin-external libraries in a @to_prepare@ and/or @after_initialize@ block works just fine.
See: http://guides.rubyonrails.org/configuring.html#initialization-events
--------------------------------------------------------------------------------
Wouldn't a simple topological sort (ruby @TSort@) in @lib/redmine/plugin.rb@self.load@ do the trick?

Of course provided that we can get information about the dependencies without having to load the plugins first... Chicken/Egg problem.

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,New,24939,Changing plugin loading order
relates,New,26439, Plugin load order defined by plugin checks
duplicates,New,6324,requires_redmine_plugin should defer loading plugins if not all dependencies are met

表示するデータがありません

他の形式にエクスポート: Atom PDF

いいね!0