Skip to content
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

Open
wants to merge 9 commits into
base: 5.1-dev
Choose a base branch
from

Conversation

richard67
Copy link
Member

@richard67 richard67 commented Jun 28, 2024

Pull Request for Issue #43591 .

Alternative to PR #43695 .

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.

It is equal to part 1 of PR #43695 and can be used instead of that PR when it turns out (needs to be tested by maintainers) that the update to the upcoming 5.1.2 can be offered on the "Default" source (channel "5.x" for TUF) as well as (with a different zip file name) on the "Joomla Next" source (channel "6.x" for TUF) so that it does not need a separate extra update of the Joomla Update Component to reset the update source in order to find the core update after that, which was part 2 of the other PR.

The reset after each update provided with part 1 of the other PR or with this PR here makes still sense, except if we want to provide updates on both channels in parallel also in the future and not only this one time to fix the issue.

Find more details in the description of the other PR #43695 .

Testing Instructions

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/43717/downloads/76941/

Do several tests with different starting conditions regarding the update source set in the Joomla Update Component's options:

  • Test with update source = "Joomla Next" before the update.
  • Test with any other update source, i.e. "Default" or "Custom URL".

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 modified package for upload: https://test5.richard-fath.de/Joomla_5.1.2-dev+pr.43717-Development-Update_Package_error.zip

When using "Custom URL" you can use the following custom URL to update to that modified package: https://test5.richard-fath.de/pr-43717-test-error_list.xml

The modified package provokes a database error in order to test 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 use a new browser session after each test.

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

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:
test-core-update-reset-ok

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:
test-core-update-reset-error

In this case the Joomla Update log administrator/logs/joomla_update.php contains details like for other errors:

2024-06-22T16:44:16+00:00	INFO 192.168.98.1	update	Test logging
2024-06-22T16:44:16+00:00	INFO 192.168.98.1	update	Uploading update file
2024-06-22T16:44:18+00:00	INFO 192.168.98.1	update	File [ROOT][TMP]/juRNnKH5 downloaded.
2024-06-22T16:44:18+00:00	INFO 192.168.98.1	update	Starting installation of new version.
2024-06-22T16:44:25+00:00	INFO 192.168.98.1	update	Finalising installation.
2024-06-22T16:44:26+00:00	INFO 192.168.98.1	update	Start of SQL updates.
2024-06-22T16:44:26+00:00	INFO 192.168.98.1	update	The current database version (schema) is 5.1.1-2024-04-18.
2024-06-22T16:44:26+00:00	INFO 192.168.98.1	update	End of SQL updates.
2024-06-22T16:44:26+00:00	INFO 192.168.98.1	update	Uninstalling extensions
2024-06-22T16:44:26+00:00	INFO 192.168.98.1	update	Deleting removed files and folders.
2024-06-22T16:44:26+00:00	ERROR 192.168.98.1	update	An error has occurred while running "resetUpdateSource". Code: 1054. Message: Unknown column 'paramsx' in 'field list'.
2024-06-22T16:44:26+00:00	INFO 192.168.98.1	update	Cleaning up after installation.
2024-06-22T16:44:26+00:00	INFO 192.168.98.1	update	Update to version 5.1.2-dev is complete.

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-core-update-no-reset

Link to documentations

Please select:

  • No documentation changes for docs.joomla.org needed

  • No documentation changes for manual.joomla.org needed

@brianteeman
Copy link
Contributor

If we can offer the updates in the same way as before then do we really need to even update the update component?

@richard67
Copy link
Member Author

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:

The reset after each update provided with part 1 of the other PR or with this PR here makes still sense, except if we want to provide updates on both channels in parallel also in the future and not only this one time to fix the issue.

@brianteeman
Copy link
Contributor

The reset after each update provided with part 1 of the other PR or with this PR here makes still sense, except if we want to provide updates on both channels in parallel also in the future and not only this one time to fix the issue.

that doesnt answer my question. never mind. i obviously speak a different language to everyone else and cannot express myself

@richard67
Copy link
Member Author

@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.

@richard67
Copy link
Member Author

P.S. And as described, this PR here doesn’t include the part from the other PR which requires the extra component update.

@brianteeman
Copy link
Contributor

@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.

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

@richard67
Copy link
Member Author

@brianteeman Sorry, you were right, I misunderstood your question first.

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.

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 am on holiday now so cant check but what happens when you update from the cli

I haven’t checked that either so it would be good if someone could check.

@brianteeman
Copy link
Contributor

I am having some issues testing this but so far I have observed that the error page is
administrator/index.php?option=com_joomlaupdate&view=joomlaupdate&layout=complete&tmpl=component

This produces a "naked" page
image

Should the error page url not be
administrator/index.php?option=com_joomlaupdate&view=joomlaupdate&layout=complete

So that you get a fully styled page
image

@richard67
Copy link
Member Author

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Language Change This is for Translators PR-5.1-dev
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants