Skip to content

Conversation

@sejas
Copy link
Contributor

@sejassejas commented Nov 10, 2023

Description

I'm adding the field update_version as a default field for plugin and theme commands. If no update_version is available we return an empty string following the same pattern as version itself.

Now wp plugin list and wp theme list display a table similar to:

+------------+----------+--------+---------+----------------+-------------+ | name | status | update | version | update_version | auto_update | +------------+----------+--------+---------+----------------+-------------+ | akismet | inactive | none | 5.3 | | off | | hello | inactive | none | 1.7.2 | | off | | Zombieland | inactive | none | 0.1.0 | | off | | no-mail | must-use | none | | | off | | polyfills | must-use | none | | | off | +------------+----------+--------+---------+----------------+-------------+ 
+-------------------+----------+--------+---------+----------------+-------------+ | name | status | update | version | update_version | auto_update | +-------------------+----------+--------+---------+----------------+-------------+ | twentytwentyfour | active | none | 1.0 | | off | | twentytwentythree | inactive | none | 1.3 | | off | | twentytwentytwo | inactive | none | 1.6 | | off | +-------------------+----------+--------+---------+----------------+-------------+ 

Testing instructions

  1. Run composer behat -- features/plugin-update.feature
  2. Run composer behat -- features/plugin.feature
  3. Run composer behat -- features/upgradables.feature
  4. Run composer behat -- features/theme.feature
  5. Observe the tests pass

@sejassejas requested a review from a team as a code ownerNovember 10, 2023 11:02
schlessera
schlessera previously requested changes Nov 10, 2023
Copy link
Member

@swissspidyswissspidy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Besides the alignment details this looks good 👍

@sejas
Copy link
ContributorAuthor

sejas commented Nov 10, 2023

Thanks for the quick review! I fixed the alignment issues (1335956). I also updated some comments on the functions. (7fb9b9b)

And I realized that the json format is returning null instead of an empty string. Is that something I need to change?
I would appreciate where that part of the code lives.

wp plugin list --format=json

[{"name":"akismet","status":"active","update":"none","version":"5.3","update_version":null} ,{"name":"hello","status":"inactive","update":"none","version":"1.7.2","update_version":null} ,{"name":"Zombieland","status":"inactive","update":"none","version":"0.1.0","update_version":null} ,{"name":"no-mail","status":"must-use","update":"none","version":"","update_version":null} ,{"name":"polyfills","status":"must-use","update":"none","version":"","update_version":null} ] 

The table, and csv format are working correctly returning an empty string.

I'll also solve the merging conflicts.

@sejas
Copy link
ContributorAuthor

And I realized that the json format is returning null instead of an empty string. Is that something I need to change?
I would appreciate where that part of the code lives.

I found it: 9749bd2

@swissspidyswissspidy merged commit d57c270 into wp-cli:mainNov 10, 2023
@danielbachhuberdanielbachhuber added command:plugin Related to 'plugin' command command:theme Related to 'theme' command command:plugin-list Related to 'plugin list' command command:theme-list Related to 'theme list' command labels Nov 10, 2023
@danielbachhuberdanielbachhuber added this to the 2.1.16 milestone Nov 10, 2023
@sejassejas deleted the add/update-version-default-field branch November 10, 2023 12:23
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

command:pluginRelated to 'plugin' commandcommand:plugin-listRelated to 'plugin list' commandcommand:themeRelated to 'theme' commandcommand:theme-listRelated to 'theme list' command

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@sejas@schlessera@swissspidy@danielbachhuber