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

Add update_version to the default fields for plugin and theme commands #380

Merged
merged 13 commits into from Nov 10, 2023

Conversation

sejas
Copy link
Contributor

@sejas sejas 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

@sejas sejas requested a review from a team as a code owner November 10, 2023 11:02
features/plugin.feature Outdated Show resolved Hide resolved
features/theme.feature Outdated Show resolved Hide resolved
features/theme.feature Outdated Show resolved Hide resolved
Copy link
Member

@swissspidy swissspidy 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
Contributor Author

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
Contributor Author

sejas commented Nov 10, 2023

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

@swissspidy swissspidy merged commit d57c270 into wp-cli:main Nov 10, 2023
36 checks passed
@danielbachhuber danielbachhuber added this to the 2.1.16 milestone Nov 10, 2023
@sejas sejas deleted the add/update-version-default-field branch November 10, 2023 12:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants