-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Do not disable plugins during bugfixes updates #19199
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
base: main
Are you sure you want to change the base?
Do not disable plugins during bugfixes updates #19199
Conversation
Plugins can define that they only support specific minors versions. |
No, the plugin loading logic will anyway check the compatibility of the plugin everytime GLPI is booted, and the plugin will be disabled in this case. See Lines 790 to 812 in a71aa6f
|
Plugin loading in general should be more resilient now. Any exception thrown from an init function should disable that plugin now. I wonder if it's needed to limit this just to bugfix versions or if it is OK globally. |
If there is compile error, the error will not be caught (see #18695), so we cannot remove this for now for all updates. Something was started to handle this, see #18765, but we did not had time yet to finish it. |
I agree with this proposal only if you can assure me the plugins are not called (no hooks) during updates. |
Our migrations are not suppose to use something else than hardoded values, and are supposed to only do direct DB queries that cannot be hooked by plugins. |
I would say the same as @orthagh: I'm OK if plugins are not loaded during the installation phase - "hooks" are probably not only the only possible issue. |
Unless on specific circumstances, the plugins are not loaded during the update process, see glpi/src/Glpi/Kernel/Listener/InitializePlugins.php Lines 61 to 64 in 8cf551b
The are loaded only in CLI context, if the update is "replayed", or if the Disabling the plugins will anyway only disable the hooks execution in the current update context. We could add a |
096dc3f
to
76a3155
Compare
Like I said IRL, I'm not strongly against the proposed changes. We quickly mention the public router may disable its legacy routes when a plugin is disabled (update or not) |
It is a partial solution to this, and has been done in #19271.
With the current state of the code, it is not possible, but unrelated changes may change this behaviour. The best solution would be to implement the following behaviour:
It is probably easy to implement, and I would like to do it prior to the GLPI 11.0 RC1 release, but I have to focus on most important topics for the moment. |
Checklist before requesting a review
Description
It make sense to disable all plugins when GLPI is upgraded to a new intermediate version (e.g. 9.4 -> 9.5) or a new major version (9.5 -> 10.0), because we can introduce BC breaks in the code that would result in a complete GLPI crash when an incompatible plugin is loaded. But it does not seems required to do it when the update does not contains more than bugfixes. Indeed, in bugfixes version, we are not suppose to introduce BC-breaks (see https://glpi-developer-documentation.readthedocs.io/en/develop/sourcecode.html#backward-compatibility).
I therefore propose to disable the plugins only when an update is made to a new intermediate or major version.
Please note that it will also prevent the
tester
plugin to be disabled on the test database everytime an update is made to update the DB to the latest dev version.