[6.0] Initial update script clean up for 6.0 #43598
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Pull Request for Issue # .
Summary of Changes
This pull request (PR) implements an initial clean up of scripts related to core updates for the new major version 6.0 by doing 5 things:
As we will require to be on the latest 5.x version (very likely 5.4) before updating to 6, these scripts will never be run on update.
Because there is no update SQL script yet for 6.0, a dummy script
6.0.0-2024-06-01.sqlis added for each database type so that the folders will not be empty. The script contains a comment on what to do with it when the first real update SQL script for 6.0 will be added.5.x update SQL scripts should also be excluded from upmerges from any 5.x-dev branch in future.
administrator/components/com_admin/script.phpfor 6.0 byupdateAssetsmethod in fileadministrator/components/com_admin/script.phpby obsolete entries from 5.x.uninstallExtensionsandpostflightmethods and adapt version checks in these methods to 6.0.build/deleted_file_check.phpscript which is used to create the lists of deleted files and folders and renamed files in theadministrator/components/com_admin/script.phpfile.The exclusions were once added either for the migrations and removals removed in step 3 or for older stuff which becomes obsolete with 6.0.
Testing Instructions
Code review by an experienced maintainer or release manager who is familiar with the update process should be sufficient.
But if you want to do real tests:
Test 1: Update from 5.2 to 6.0 to test changes in script.php
Update the latest 5.2 nightly build or a 5.2.0-alpha1 to the latest 6.0 nightly build to get the actual result, and update latest 5.2 nightly build or a 5.2.0-alpha1 to the patched package created by Drone for this PR to get the expected result.
Here you can find the patched update package or custom update URL created by Drone for this PR: https://artifacts.joomla.org/drone/joomla/joomla-cms/6.0-dev/43598/downloads/76503/
After the update
administrator/components/com_admin/sql/updates/mysqlandadministrator/components/com_admin/sql/updates/postgresql,Test 2: Test the deleted_file_check.php script
The tests require PHP CLI so you can run PHP scripts on a command line (Linux shell or Windows CMD, no need for WSL) and a local Git clone of the 6.0-dev branch so the
buildfolder is available. They can be executed on a clean branch without the need to runcomposer installornpm install, but if they have been run it will not do any harm.The instructions below are made with Linux file paths, i.e. separator
/. When being on Windows, just replace that by a backslash\.E.g. when using the
tmpfolder of your Git clone and folder names equal to the files base names of the packages, the folders will be:The following steps will use these folders.
(I know, the name "Joomla_5.2.0-alpha1-dev" is wrong, it should be "Joomla_5.2.0-alpha2-dev", but that's an issue with the nightly builds which I have already reported internally.)
./build/deleted_files.txtand./build/deleted_folders.txthave been created, but no text file./build/renamed_files.txt.build/deleted_file_check.phpfrom this PR, but only the changes in that file and not the other changes.Result: There are no differences.
Actual result BEFORE applying this Pull Request
Test 1: Update from 5.2 to 6.0 to test changes in script.php
In folders folders
administrator/components/com_admin/sql/updates/mysqlandadministrator/components/com_admin/sql/updates/postgresqlthere are all 5.x update SQL scripts from 5.2, and these were even updated because they are in the update package of the nightly build.The files and folders which have been deleted in the source code with PRs #42884 and #42890 are still present after the update.
Test 2: Test the deleted_file_check.php script
The script creates text files
./build/deleted_files.txtand./build/deleted_folders.txt, but no text file./build/renamed_files.txtExpected result AFTER applying this Pull Request
Test 1: Update from 5.2 to 6.0 to test changes in script.php
In folders folders
administrator/components/com_admin/sql/updates/mysqlandadministrator/components/com_admin/sql/updates/postgresqlthere are no 5.x update SQL scripts. Only one update SQL script6.0.0-2024-06-01.sqlis present, which includes only a comment on what to do when the first real update SQL script for 6.0 will be added.The files and folders which have been deleted in the source code with PRs #42884 and #42890 have been deleted by the update.
There are no other differences compared to the actual result on filesystem or database except of expected differences like e.g. the superadmin's user ID, creation times or such things.
Test 2: Test the deleted_file_check.php script
The script creates text files
./build/deleted_files.txtand./build/deleted_folders.txt, but no text file./build/renamed_files.txtThe
./build/deleted_files.txtand./build/deleted_folders.txtfiles are the same as without this PR.Link to documentations
Please select:
No documentation changes for docs.joomla.org needed
No documentation changes for manual.joomla.org needed