-
-
Couldn't load subscription status.
- Fork 1.5k
Add a command to update all local plugins #21521
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: 11.0/bugfixes
Are you sure you want to change the base?
Add a command to update all local plugins #21521
Conversation
|
@flegastelois I added the |
|
is composer update triggered ? |
Plugins releases are supposed to bring all their dependencies, like GLPI release archives. |
| Session::addMessageAfterRedirect( | ||
| htmlescape(sprintf(__('Plugin %1$s prerequisites are not matching, it cannot be installed.'), $this->fields['name'])) . ' ' . $msg, | ||
| true, | ||
| ERROR | ||
| ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems this error message will be lost in CLI context.
Maybe it should throw an exception for CLI?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are calls to $this->outputSessionBufferedMessages() in the commands, to handle these messages. This is how all plugins commands are made. I do not want to refactor these right now, but I agree it should use exceptions in the future.
Co-authored-by: Adrien Clairembault <[email protected]>
| parent::configure(); | ||
|
|
||
| $this->setName('marketplace:update_local_plugins'); | ||
| $this->setDescription(__('Download up-to-date sources for all local plugins and process updates of active plugins')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Download and update all plugins to their latest compatible versions, then reactivate active ones."
| { | ||
| parent::configure(); | ||
|
|
||
| $this->setName('marketplace:update_local_plugins'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"marketplace:update"
|
I have some specific plugins enabled only on my workstation (that is, not available at all on the marketplace), and when the command runs, I get a message: Plugin "xxxxxx" is not available for your GLPI version. This message is not very clear; it should say, "This plugin does not exist on the marketplace," or something similar, more explicit. |
Checklist before requesting a review
Description
To simplify the plugins source handling during a migration to a new intermediate/major version of GLPI, I propose to introduce a new
marketplace:update_local_pluginscommand. This command will download, for every plugin present in theglpi_pluginstable, the latest compatible version, unless the local version present on the filesystem is already up-to-date. This will be done for all plugins, even uninstalled/inactive plugins, as even an inactive plugin may completely break GLPI due to compile errors (see #18695). For all active plugins, il will then automatically execute theinstallandactivatemethod, so every active plugins before the execution will be but back to their active state after the command execution.Example of a migration script:
This command could also be used as a scheduled routine to always get latest versions of plugins.
Screenshots (if appropriate):
First execution, right after a GLPI update, with an empty

pluginsdirectory:Second execution, a few days later, to get latest updates:
