-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
[5.1] Add update channel reset to Joomla Update Component version 5.1.2 #43695
[5.1] Add update channel reset to Joomla Update Component version 5.1.2 #43695
Conversation
Add installer script to com_joomlaupdate for reset of the core update channel from "next" to "default" when updating the component.
Reset the core update channel from "Next" to "default" at the end of an update.
Thank you! |
Test 1 - Successful according to what is expected |
@obuisard Sorry, my mistake, had forgotten to upload it. I've meanwhile created a new one based on the one cleared by Drone for this PR. Please use https://test5.richard-fath.de/Joomla_5.1.2-dev+pr.43695-Development-Update_Package_test-error.zip . I've updated the testing instructions with the new link. Thanks for testing so far. |
Thank you, Richard! For Test 2, I cannot get it to fail with the latest package. |
@obuisard Could be a problem with the state storage not being cleaned up when running several updates in a row. But that would not be caused by this PR. Maybe just test again in a new browser session. |
Meanwhile I've made the alternative PR #43717 which does only part 1 of this PR here (which is tested with Test 2 here) and can be used if it turns out that it does not need the extra update for the Joomla Update Component because we can offer the core update to 5.1.2 on both channels so people will find it also when being on "Joomla Next". |
Meanwhile it has been checked that the update to 5.1.2 can be provided to both update channels so it does not need a separate update for the update component. Closing in favor of PR #43717 . |
Pull Request for Issue #43591 .
Alternative to PR #43717 .
Summary of Changes
This pull request (PR) does 2 things:
The reason for this is that with the change to TUF-based updates in 5.1.0, the update channels are handled differently to how it was done before (and still is done with 4.4).
JVERSION . '.x'
for the "Default" andJVERSION+1 . '.x'
for "Joomla Next".So when you update e.g. from 5.1 to a 6.0 nightly build, "Default" is mapped to channel "5.x" and "Joomla Next" is mapped to channel "6.x" before the update, but after the update "Default" is mapped to channel "6.x" and "Joomla Next" is mapped to channel "7.x".
And when your update source was "Joomla Next" before the update you can only have come from the previous major version. E.g. when you have updated to 5.1 with "Joomla Next" you for sure came from 4.4, and when you have updated to 6.0 with "Joomla Next" you for sure came from the latest 5.x (currently 5.2. but will be 5.4 at the end of the 5.x cycle).
Therefore we can reset from "Joomla Next" to "Default" after every update, there is no need for additional version checks.
The change mentioned above with change number 2, the new installer script for the component, will be removed again with 6.0 because it will not be needed anymore with 6.0. Therefore this part is already marked as deprecated, and when this PR here will be merged and be merged up into 6.0-dev (via 5.2-dev) I will make a PR for 6.0-dev for the removal.
For the stand-alone update mentioned with change number 2 see also joomla/update.joomla.org#366 .
Update: Meanwhile I've made the alternative PR #43717 which does only part 1 of this PR here and can be used if it turns out that it does not need the extra update for the Joomla Update Component because we can offer the core update to 5.1.2 on both channels so people will find it also when being on "Joomla Next".
Testing Instructions
Test 1: Update Joomla Update Component
Pre-condition: You have to be on Joomla version 5.1.0, 5.1.1 or 5.1.2-dev.
Update the Joomla Update Component either by uploading the patched zip package in the extensions installer or by changing the update site URL for the Joomla Update Component e.g. with phpMyadmin and then checking for extension updates.
The patched package can be downloaded from here: https://test5.richard-fath.de/com_joomlaupdate-5.1.2.zip
The custom update site URL which points to this package can be found here: https://test5.richard-fath.de/com_joomlaupdate_test-5-1-2.xml
Do several tests with different starting conditions regarding the update source set in the Joomla Update Component's options:
In addition, do the same different tests using the following patched package for upload in the extensions installer: https://test5.richard-fath.de/com_joomlaupdate-5.1.2-test-error.zip
The patched package provokes a database error for checking what happens when the reset of the update source fails. It can also be used to check that the reset does not take place when the update source is not "Joomla Next" before the update.
It does not need to fall back to the same starting conditions after each test, you can just upload the package again in the extension installer or when using the custom update URL, patch the version in the manifest cache of the component's record in the extension table. But you should at least use a new browser tab or logout and in again after each test to make sure you do not see any old but still enqueued messages (which is another issue when doing several core or extension update attempts in a row and which is not related to this PR).
Test 2: Update the CMS core
Update the CMS core by uploading in the Joomla Update Component the patched zip package created by Drone for this PR.
You can download that package here: https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43695/downloads/76879/
Do several tests with different starting conditions regarding the update source set in the Joomla Update Component's options:
When using "Custom URL" you can use the custom URL created by Drone for this PR instead of uploading the package. You can find that custom URL at the same place where you could find the patched package.
In addition, do the same different tests using the following patched package for upload: https://test5.richard-fath.de/Joomla_5.1.2-dev+pr.43695-Development-Update_Package_test-error.zip
The patched package provokes a database error for checking what happens when the reset of the update source fails. It can also be used to check that the reset does not take place when the update source is not "Joomla Next" before the update.
It does not need to fall back to the same starting conditions after each test, you can just upload the package again in the update component. But you should at least use a new browser tab or logout and in again after each test to make sure you do not see any old but still enqueued messages (which is another issue when doing several core or extension update attempts in a row and which is not related to this PR).
Test 3: Make sure the update package from Test 1 is only found when on 5.1.0, 5.1.1 or 5.2-dev.
Change the update site URL for the Joomla Update Component e.g. with phpMyadmin to the following URL and then check for extension updates: https://test5.richard-fath.de/com_joomlaupdate_test-5-1-2.xml
Do that on different Joomla CMS versions, e.g. 4.4.x, 5.1.0, 5.1.1 or a 5.2.0-alpha1 or a 5.2-dev or 6.0-dev nightly.
Actual result BEFORE applying this Pull Request
When you are still on the "Joomla Next" update channel after an update from 4.4 to 5.1, there will not be any update found for the CMS core until 6.0.0-alpha1 will be released, and then only updates to 6.0 releases will be found, so you will miss any further updates for 5.1 until that time has come.
There is no notification about that and no automatic reset after the update.
Expected result AFTER applying this Pull Request
Test 1: Update Joomla Update Component
Updating the Joomla Update Component component works.
When having the update source (update channel) set to "Joomla Next" in the Joomla Update Component's options before that update, the update source is rest to "Default" at the end of the update, and an information message is shown about that:
When under the same conditions an error happens with that reset, e.g. due to a database problem, a warning message is shown, which tells the user to manually reset the update source:
The update of the component is shown as success as nothing else is broken.
When the update source is not "Joomla Next" so it is "Default" or "Custom URL", the update source is not changed, and the update of the components works as it does without this PR:
Test 2: Update the CMS core
Updating the Joomla CMS core works.
When having the update source (update channel) set to "Joomla Next" in the Joomla Update Component's options before that update, the update source is rest to "Default" at the end of the update, and a success message is shown about that:
When under the same conditions an error happens with that reset, e.g. due to a database problem, the usual error layout is shown with all details, and in addition a warning message is shown at the top, telling the user to manually reset the update source:
In this case the Joomla Update log
administrator/logs/joomla_update.php
contains details like for other errors:When the update source is not "Joomla Next" so it is "Default" or "Custom URL", the update source is not changed, and the update of the CMS core works as it does without this PR:
Test 3: Make sure the update package from Test 1 is only found when on 5.1.0, 5.1.1 or 5.2-dev.
The update for the Joomla Update Component will only be found when the CMS version is 5.1.0, 5.1.1 or 5.1.2(-dev) but not e.g. on 4.4.x or 5.2.0(-dev).
When later 5.1.2 stable is released and you have updated the CMS to 5.1.2, the targetplatform for the component update would still match, but there will not be an update found anymore for the component because it will already be up to date with its version 5.1.2.
Link to documentations
Please select:
No documentation changes for docs.joomla.org needed
No documentation changes for manual.joomla.org needed