-
-
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 #43717
[5.1] Add update channel reset to Joomla Update Component #43717
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.
If we can offer the updates in the same way as before then do we really need to even update the update component? |
@brianteeman Like I wrote in the description:
|
that doesnt answer my question. never mind. i obviously speak a different language to everyone else and cannot express myself |
@brianteeman It does answer your question. When updates will always be provided on both channels then this PR is not necessary. But I doubt that will be the case, I think it will be only done this time. Anyway that’s not my decision. |
P.S. And as described, this PR here doesn’t include the part from the other PR which requires the extra component update. |
Why not - it has been that way for ages and if it has now been established that it can be done that way again why change. I just dont see the reason for the change. I am on holiday now so cant check but what happens when you update from the cli |
@brianteeman Sorry, you were right, I misunderstood your question first.
Yes, that would be the best. But it might require some additional work for those who deploy the updates to TUF - I am not involved in that so I don’t know if that is the way to go.
I haven’t checked that either so it would be good if someone could check. |
I am having some issues testing this but so far I have observed that the error page is Should the error page url not be |
@brianteeman That in case of error the component layout is used is nothing new from my PR. It was once introduced by Fedir when he improved error reporting and logging of the update component. |
to test the update with the update server please change the 115 line in then change the channel in the update component options form stable to next (with stable and next channel) you should get version 5.1.2 stable offered for version 5.1.0 and 5.1.1 this might only work today till the original update server does an timestamp update and the updater might refuse an outdated / different update information depending on the status of the data cached. |
I have tested this item ✅ successfully on 45e1091 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43717. |
I have tested this item 🔴 unsuccessfully on 45e1091 This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43717. |
I set the channel to Next |
which version was the installed one? |
|
strange are you sure this wasn't an error message form before? |
I do however ask again that as you have demonstrated that the Joomla Next channel can show the next joomla 5 release why do we need to have this PR to change to the Stable channel AND if production insists that this change must be done then it is incomplete as the language string below will now give incorrect information COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT="You are on the "%s" update channel. Through this channel you'll receive notifications for all updates of the current Joomla release (5.x) and you will also be notified when the future major release (6.x) will be available. Before upgrading to 6.x you'll need to assess its compatibility with your environment." |
Ready for testing again. |
Without an additional change to COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT this PR is incomplete |
@brianteeman Done. Wrong information removed from the language string. |
Hmm, in the backend the warning which is shown when the reset fails has the right colour, but it maybe has the wrong icon (check mark). @brianteeman Should it be something else? Do you know which one? Update: I just see when there is an other error it uses the same check mark icon, |
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.
That sounded very clumsy.
@brianteeman can you please take another look at it.Thank you.
@brianteeman Could you check @tecpromotion 's suggested change on the language string? Would be good to have a native speaker instead of 2 Germans 😄 |
done |
Thanks |
The more I look at this the more I see it as the wrong thing to do. |
@brianteeman I understand your point. To all readers: Personally I would also prefer if things could work like in past before the change to TUF so it would not need this PR at all. I was asked by other maintainers if I can make a pull request like this one now, and that's what I did. But I'm not the one to decide which way it should go. |
Surprised the maintainers didnt also ask the people who forced these changes to also look at fixing it. |
@brianteeman Sometimes people are busy with private life or job and don't have enough time when needed, so I stepped in to help. |
I need to write more clearly. This is a major issue that has a serious impact. There is no urgent need to make a release so better to spend the time to make the correct fix than settle on something we both agree is not an ideal solution. |
Thank you @richard67 for your work! |
Thank you @richard67 and also for suggestions, review and testing to all involved! |
I have no idea at all what you are referring to when you say security |
joomla/joomla-cms#43654 + joomla/joomla-cms#43716 + joomla/joomla-cms#43723 - (только для др. пакета) joomla/joomla-cms#43717 + joomla/joomla-cms#43754 - (только для др. пакетов) joomla/joomla-cms#43765 - (только для др. пакетов)
joomla/joomla-cms#43654 + joomla/joomla-cms#43716 + joomla/joomla-cms#43723 - (тільки для ін. пакету) joomla/joomla-cms#43717 + joomla/joomla-cms#43754 - (тільки для ін. пакетів) joomla/joomla-cms#43765 - (тільки для ін. пакетів)
Pull Request for Issue #43591 .
Summary of Changes
This pull request (PR) adds a function to the Joomla Update Component to automatically reset the update source (update channel) to "Default" in the component's options at the end of each CMS core update when it was set to "Joomla Next" before the update.
The reset is done for both the backend and the CLI core update.
The user is notified about the reset, and it is logged in the Joomla Update log file.
If an error happens with the reset, a warning is shown to the user and logged in the Joomla Update log file, but the update is still considered as successful if that was the only error during the update.
There is one difference between the update in the Administrator and the CLI:
The reason for the reset 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 language string
COM_JOOMLAUPDATE_VIEW_DEFAULT_UPDATES_INFO_NEXT
is changed so it doesn't tell about updates for the current major version, which was wrong since the introduction of the TUF-based updates.Testing Instructions
Test 1: Administrator Live Update - Successful Reset
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
and change line 115 from$updateURL = 'https://update.joomla.org/cms/';
to
$updateURL = 'https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/pr_list.xml';
so the update site is the one created by Drone for this PR.
Test 2: Administrator Upload & Update - Successful Reset
You can download that package here: https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/Joomla_5.1.2-rc2-dev+pr.43717-Development-Update_Package.zip
Test 3: Administrator Live Update - Error on Reset
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
and change line 115 from$updateURL = 'https://update.joomla.org/cms/';
to
$updateURL = 'https://test5.richard-fath.de/pr-43717-test-error_list.xml';
This makes the update site point to a modified update package which provokes a database error at the reset of the update source. Besides that the package is equal to the one created by Drone for this PR.
Test 4: Administrator Upload & Update - Error on Reset
You can download that package here: https://test5.richard-fath.de/Joomla_5.1.2-rc2-dev+pr.43717-Development-Update_Package_error.zip
Test 5: Administrator Live Update - No Reset Needed
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
and change line 115 from$updateURL = 'https://update.joomla.org/cms/';
to
$updateURL = 'https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/pr_list.xml';
so the update site is the one created by Drone for this PR.
Repeat the test but this time change the update source to "Custom URL" in step 2, and use the custom URL created by Drone for this PR: https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/pr_list.xml
The result should be the same.
Test 6: Administrator Upload & Update - No Reset Needed
You can download that package here: https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/Joomla_5.1.2-rc2-dev+pr.43717-Development-Update_Package.zip
Repeat the test but this time change the update source to "Custom URL" in step 1, and use the custom URL created by Drone for this PR: https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/pr_list.xml
The result should be the same.
Test 7: CLI - Successful Reset
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
and change line 115 from$updateURL = 'https://update.joomla.org/cms/';
to
$updateURL = 'https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/pr_list.xml';
so the update site is the one created by Drone for this PR.
libraries/src/Version.php
and change line 69 frompublic const EXTRA_VERSION = 'rc2-dev+pr.43717';
to
public const EXTRA_VERSION = 'rc2-dev';
so that an update will be found.
If you have used Patchtester to apply the PR you don't need to do that.
php ./cli/joomla.php core:update`
Test 8: CLI - Error on Reset
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
and change line 115 from$updateURL = 'https://update.joomla.org/cms/';
to
$updateURL = 'https://test5.richard-fath.de/pr-43717-test-error_list.xml';
This makes the update site point to a modified update package which provokes a database error at the reset of the update source. Besides that the package is equal to the one created by Drone for this PR.
->set($db->quoteName('params') . ' = :params')
to
->set($db->quoteName('paramsx') . ' = :params')
This will provoke an SQL error when trying to reset the update source.
libraries/src/Version.php
and change line 69 frompublic const EXTRA_VERSION = 'rc2-dev+pr.43717';
to
public const EXTRA_VERSION = 'rc2-dev';
so that an update will be found.
If you have used Patchtester to apply the PR you don't need to do that.
php ./cli/joomla.php core:update
Test 9: CLI - No Reset Needed
administrator/components/com_joomlaupdate/src/Model/UpdateModel.php
and change line 115 from$updateURL = 'https://update.joomla.org/cms/';
to
$updateURL = 'https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/pr_list.xml';
so the update site is the one created by Drone for this PR.
libraries/src/Version.php
and change line 69 frompublic const EXTRA_VERSION = 'rc2-dev+pr.43717';
to
public const EXTRA_VERSION = 'rc2-dev';
so that an update will be found.
If you have used Patchtester to apply the PR you don't need to do that.
php ./cli/joomla.php core:update
Repeat the test but this time change the update source to "Custom URL" in step 4, and use the custom URL created by Drone for this PR: https://artifacts.joomla.org/drone/joomla/joomla-cms/5.1-dev/43717/downloads/77094/pr_list.xml
The result should be the same.
Test 10: Check information on "Joomla Next" update channel
With the changes from this PR applied, check the text shown about the update channel in the update component.
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.
When being on the "Joomla Next" update source, the information shown about the update channel contains wrong information (see red underlined part):
Expected result AFTER applying this Pull Request
Tests 1 and 2: Administrator - Successful Reset
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:
The Joomla Update log
administrator/logs/joomla_update.php
contains an information log about the reset:Tests 3 and 4: Administrator - Error on Reset
When having the update source (update channel) set to "Joomla Next" in the Joomla Update Component's options before that update and an error happens with reset of the update source, e.g. due to a database problem, a warning message is shown at the top, telling the user to manually reset the update source, but if there was no other error the update is still shown as successful:
The Joomla Update log
administrator/logs/joomla_update.php
contains a warning log about the error details and another one about the failed reset:Tests 5 and 6: Administrator - No Reset Needed
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:
The Joomla Update log
administrator/logs/joomla_update.php
does not show anything about reset of the update source:Test 7: CLI - Successful Reset
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:
The Joomla Update log
administrator/logs/joomla_update.php
contains an information log about the reset:Test 8: CLI - Error on Reset
When having the update source (update channel) set to "Joomla Next" in the Joomla Update Component's options before that update and an error happens with reset of the update source, e.g. due to a database problem, a warning message is shown, telling the user to manually reset the update source, but if there was no other error the update is still shown as successful:
The Joomla Update log
administrator/logs/joomla_update.php
contains a warning log about the error details and another one about the failed reset:Test 9: CLI - No Reset Needed
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:
The Joomla Update log
administrator/logs/joomla_update.php
does not show anything about reset of the update source:Test 10: Check information on "Joomla Next" update channel
Link to documentations
Please select:
No documentation changes for docs.joomla.org needed
No documentation changes for manual.joomla.org needed