-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Add back rollback PRs #2225
Add back rollback PRs #2225
Conversation
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.
Are you able to create a pull request that is the revert of the revert and then propose any changes as a PR on to that branch. That will allow the folks working on this ticket to keep track of what is happening.
I still don't have enough of an idea about the updater to approve new code, tracking down a bug is much easier than approval, so I'm willing to help out with testing and so on of patches but I don't want to be the committer because if it came to the crunch, I wouldn't be able to explain what I committed.
But once the new code is split out of this PR, I will happily assist with manual testing and reviewing architecture decisions.
Lots of testing with @costdev and @BronsonQuick. Below is a summary. In testing, VirtualBox was the only common denominator. We found the following issues with VB. When we tested it seems the issue is entirely about VirtualBox it not working well with the We thought the most reproducible method of determining whether or not VirtualBox was running, was for the user to set either a constant or an environmental variable. A new method in All testing was via the Rollback Update Failure feature plugin which contained the changes. Pinging @SergeyBiryukov and @hellofromtonya |
If at all possible, my preference would be to try and determine if the install is running on VirtualBox without requiring a constant be defined. VVV, Chassis and other WP dedicated systems could add these, other VB based set ups may not know to add them.
I'd go with something more generic but naming things is hard so will ponder. |
Part of the issue is there doesn't seem to be a simple test to determine if a system is running on VirtualBox. If we ever do figure that out we can always add it to the |
Need to determine acceptable values
…t_test_update_temp_backup_writable() site health tests (closing P tags were missing).
…he site health debug data.
I'm removing the auto-update functionality to focus on the core Rollback feature. I will create a new ticket for the auto-update feature. |
$dest_dir = $wp_filesystem->wp_content_dir() . 'temp-backup/'; | ||
// Create the temp-backup directory if it does not exist. | ||
if ( ( | ||
! $wp_filesystem->is_dir( $dest_dir ) | ||
&& ! $wp_filesystem->mkdir( $dest_dir ) | ||
) || ( | ||
! $wp_filesystem->is_dir( $dest_dir . $args['dir'] . '/' ) | ||
&& ! $wp_filesystem->mkdir( $dest_dir . $args['dir'] . '/' ) | ||
) | ||
) { | ||
return new WP_Error( 'fs_temp_backup_mkdir', $this->strings['temp_backup_mkdir_failed'] ); | ||
} |
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.
Just a nitpick but thinking this code could be a bit more readable. Perhaps something like (untested):
$dest_dir = $wp_filesystem->wp_content_dir() . 'temp-backup/';
$sub_dir = $dest_dir . $args['dir'] . '/';
if ( ! $wp_filesystem->is_dir( $sub_dir ) ) {
if ( ! $wp_filesystem->is_dir( $dest_dir ) ) {
$wp_filesystem->mkdir( $dest_dir );
}
if ( ! $wp_filesystem->mkdir( $sub_dir ) ) {
// Couldn't make the backup directory.
return new WP_Error( 'fs_temp_backup_mkdir', $this->strings['temp_backup_mkdir_failed'] );
}
}
Something like this is also a better "code formatting" imho.
Also wondering why FS_CHMOD_DIR
is not used here (may be missing something?). Seems to be used in every other call to $wp_filesystem->mkdir()
in core.
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.
at 1st glance, I agree that your suggestion is easier to read. Will have to actually test to make sure the logic is the same. Will report back when that's been done.
agree that we should be chmod'ing to created dirs
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.
Agree with above. Code tested and committed.
Thanks for the PR! Merged in r55720. Great job everyone! 🙌 |
Adds back PRs for rollback that were reverted from 5.9 release.
Updates to fix issue with VirtualBox and updates
move_dir()
to return better values.Invaluable help from @peterwilsoncc, @costdev, @BronsonQuick, @aristath and many others
Trac tickets:
https://core.trac.wordpress.org/ticket/51857
https://core.trac.wordpress.org/ticket/54166
https://core.trac.wordpress.org/ticket/54543
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.