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
Added --minor
and --patch
CLI option in wp theme update
#393
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.
Thanks, @up1512001 !
Can you include some functional tests on this PR?
OK so there are a couple of reasons why the tests are not currently working. First, this PR right now only allows these two new args to be passed, but does not actually change the code to do anything with those args. Support for extension-command/src/WP_CLI/CommandWithUpgrade.php Lines 351 to 357 in 955bd94
I just addressed this in 895e6ad Second, and most importantly, the WordPress.org API by default does not actually return information about available versions for themes. Here's the API response for Hello Dolly: https://api.wordpress.org/plugins/info/1.2/?action=plugin_information&request%5Blocale%5D=en_US&request%5Bslug%5D=hello-dolly Here's the API response for Twenty Twelve: https://api.wordpress.org/themes/info/1.2/?action=theme_information&request%5Blocale%5D=en_US&request%5Bslug%5D=twentytwelve See how there's no To address this, we first need to add support for fetching additional fields. After those code modifications, this PR will work as expected. See wp-cli/wp-cli#5893 for where I add this support. |
Hi @swissspidy @danielbachhuber may I know any update regarding wp-cli/wp-cli#5893 PR and when can I expect feedback for my PR? |
This PR is already in good shape. Once wp-cli/wp-cli#5893 is merged, this PR only requires a dependency update and then it should be good to go. I just pinged the other committers on wp-cli/wp-cli#5893 to review it. |
Hey @swissspidy I just checked the new theme update logic as I understand instead of getting info from style.css we will now fetch from the theme archive for its info am I right? |
Not sure what you mean, this doesn't really change how themes are looked up or anything. The one thing I noticed while testing this patch is that Another interesting find was that the theme update transient is a list of arrays, whereas for plugins it's a list of objects apparently. So the PR now also caters for that. As you can see, all existing tests are still passing and the new tests helped uncover these flaws. |
Hey, @danielbachhuber as wp-cli/wp-cli#5893 this PR is merged can you please update this PR status? |
Fixes #394
Added missing CLI option for
--minor
and--patch
intowp theme update
command list.Output Before Adding CLI Options for
--minor
&--patch
Output After Adding CLI Options for
--minor
&--patch