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

"wordpress is up to date" message displayed when attempting downgrade without --force #105

Open
3 tasks
benlk opened this issue Mar 1, 2019 · 2 comments
Open
3 tasks

Comments

@benlk
Copy link

benlk commented Mar 1, 2019

With a WordPress site on WordPress 5.1 that I want to downgrade to 5.0.3 for testing:

$ wp core update --version=5.0.3
Success: WordPress is up to date.

There are several problems with this message:

  • "Success" is wrong; the installed WordPress version did not change
  • "up to date" is not the desired outcome. Could this message be expanded to "Wordpress is up to date at version $version"?
  • When attempting to "upgrade" to a version older than the currently-installed version, wp core update doesn't explain to the user why the version was not updated. Some additional verbosity here would be appreciated: "Did not upgrade to 5.0.3 because the newer version 5.1 is already installed. retry with --force to ignore this check."

A solution to this problem might look like:

  • Do not display "Success" if the safety checks in wp core update abort an update
  • Display the installed version number in "WordPress is up to date" messages
  • When an "upgrade" to an older version is blocked by the presence of a newer version, output a message saying that that is the case, listing the newer version currently installed, and provide a "did you mean to --force?" message
The successful command, which is irrelevant to this issue The successful command was:
$ wp core update --version=5.0.3 --force
Updating to version 5.0.3 (en_US)...
Downloading update from https://wordpress.org/wordpress-5.0.3.zip...
Unpacking the update...
Cleaning up files...
File removed: wp-includes/ms-site.php
File removed: wp-includes/ms-network.php
File removed: wp-includes/js/backbone.js
File removed: wp-includes/js/underscore.js
File removed: wp-includes/js/codemirror/fakejshint.js
File removed: wp-includes/js/codemirror/esprima.js
6 files cleaned up.
Success: WordPress updated successfully.
@schlessera
Copy link
Member

@benlk Your proposed solution sounds good to me, with one potential caveat:

Do not display "Success" if the safety checks in wp core update abort an update

I'm not sure off the top of my head whether we can actually differentiate between "is up-to-date, all good" and "is higher already, abort". And for the purposes of CI systems, we don't want a scenario of "is up-to-date, all good" to throw an error and stop the pipeline.

@benlk
Copy link
Author

benlk commented Mar 5, 2019

And for the purposes of CI systems, we don't want a scenario of "is up-to-date, all good" to throw an error and stop the pipeline.

This might be behavior to put behind a flag: --fail-if-higher to be used in conjunction with update --version=<version> causes failure if ${wp core version} is greater than <version>, but only if that flag is passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants