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
Create plugin.json files if needed for plugins moved from core to marketplace #16323
Conversation
plugins/CoreUpdater/Updater.php
Outdated
@@ -168,6 +169,8 @@ public function oneClickUpdatePartTwo() | |||
try { | |||
|
|||
if (Marketplace::isMarketplaceEnabled()) { | |||
Updates_4_0_0_b1::ensureCorePluginsThatWereMovedToMarketplaceCanBeUpdated(); |
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.
when updating from 3.14.1 to 4.X then this method would be executed... we'll create the needed plugin.json files shortly before checking for updates so the plugins won't be marked as "bogus"
|
||
// eg the case when not updating from most recent Matomo 3.X and when not using the UI updater | ||
// afterwards the should receive a notification that the plugins are outdated | ||
self::ensureCorePluginsThatWereMovedToMarketplaceCanBeUpdated(); |
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.
This logic runs for people that upgrade from 3.14.0 and older because there the oneClickUpdatePartTwo
wouldn't be executed as it either didn't exist yet or it wasn't working.
This logic runs also for people who update on the command line.
We then create the files during the update step so at least people will be made aware there's an update available on the marketplace.
For say 6 months or 1 year we should include Provider and Custom Variables plugin still in Matomo 4.X so there are no complications when upgrading. We won't enable them though by default. Once most users have updated to Matomo 4 (in 6 months or 1 year), we could stop shipping it with the release. For people that update from the most recent 3.14.1 version it will update the plugins through the marketplace anyway. For other users updating from an older version it will show an update is available because of matomo-org/matomo#16323 but the plugins will be deactivated by core when updating and the admin has to activate them again. I reckon it be good to still ship it with Matomo at least for a few months simply to prevent possible issues where the plugins would be otherwise deactivated or not updated. Refs
While doing our testing when updating from Matomo core 3.14.0 or older Matomo won't update the Provider and custom variables plugin. There's no real possible workaround because we can't change the update process so figured the best and only workaround be to continue shipping the plugins for a while with Matomo see matomo-org/matomo-package#112 . The plugins won't be updated because Matomo thinks the plugins are bundled with core in https://github.com/matomo-org/matomo/blob/3.14.1-b1/plugins/Marketplace/Api/Client.php#L170 (could think about removing that check in the future however would make the post request a lot larger and put bit more load on the marketplace potentially but nothing serious I suppose)
When people then upgrade from older Matomo versions to a newer Matomo 4.X version without the Provider and Custom Variables plugin, this change will make sure that the marketplace will look for updates and find them. By adding the plugin.json the plugins will be no longer bogus.
What is still a problem is that when updating from a version before Matomo core 3.14.1 is that the 2 plugins will be deactivated. There's no real workaround since we can't know whether they were activated previously. What happens is that a user eg updates from Matomo 3.10 to Matomo 4.8 (the 2 plugins are no longer shipped with Matomo):
Without this change Matomo would never even show there is an update for the plugins available.