-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Switch copy_dir() with move_dir() in WP_Upgrader::install_package() #3911
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
Conversation
d985ff9 to
bce22eb
Compare
|
This PR will fail until PR3903 has been committed. |
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.
LGTM 👍 Tested this exact change extensively in WSL2 (Ubuntu), Ubuntu (Virtual Cloud Server) and Chassis (VirtualBox 6 and 7). When move_dir() is committed, this should be good to go.
|
Tests are failing and will fail as |
felixarntz
left a comment
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.
peterwilsoncc
left a comment
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.
Added a note to account for whether the working directory ought to be cleared.
During manual testing this is what happens on trunk, ie not this PR:
- at the start of an update, the
upgradefolder is emptied - currently updated item is extracted to that folder
- with
clear_working => falsethe theme/plugin is not deleted from theupgradefolder - with
clear_working => truethe theme/plugin is deleted from theupgradefolder
So when bulk updating a bunch of themes/plugins, after the upgrade process is complete only one folder is retained (per screen shot). I think the purpose of retaining the folder is to allow plugin authors to do something (I don't know what) with the working copy after the end of the update.
The inline change will have little affect as core always clears the working folder but it's best to account for it.
costdev
left a comment
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.
LGTM 👍
|
Merged. |

While working extensively on #57375 in various discussions on that ticket and on Slack it was decided to move forward with PR3909.
PR3909 does not include the needed change to WP_Upgrader::install_package() to take advantage of its new code. This ticket and PR will accomplish that. The plan is to replace copy_dir() in WP_Upgrader::install_package() with move_dir().
This change was tested extensively during the development of #57375
Related: #57375, #57386
Trac ticket: https://core.trac.wordpress.org/ticket/57557