Skip to content

refactor: route Taxonomy CLI through registered abilities #3380

Description

@chubes4

Goal

Complete the Taxonomy CLI adapter convergence by removing direct concrete ability construction from TaxonomyCommand and executing the already registered WordPress abilities through the existing CLI AbilityRunner.

Refs #3332. Parent: #3113.

Scope

Update inc/Cli/Commands/TaxonomyCommand.php to execute:

  • datamachine/get-taxonomy-terms
  • datamachine/create-taxonomy-term
  • datamachine/update-taxonomy-term
  • datamachine/delete-taxonomy-term
  • datamachine/resolve-term

The list command already establishes the AbilityRunner pattern. Remove the five concrete Taxonomy ability imports. Do not modify ability implementations.

Contract preservation

Preserve exactly:

  • command names and aliases
  • positional arguments, options, defaults, casts, and optional-field inclusion
  • all preflight validation messages
  • delete confirmation timing and --yes
  • JSON, table, CSV, and YAML behavior where supported
  • success, warning, log, and error text
  • pagination behavior
  • WP_CLI::error() exit behavior
  • create success-message ordering before optional JSON
  • resolve Created versus Resolved presentation

Do not move parsing or presentation into abilities. AbilityRunner may normalize native WP_Error into the existing CLI failure-array path, but public output must not leak diagnostic metadata.

Tests

  • Extend AllAbilitiesRegisteredTest with all five Taxonomy slugs.
  • Add focused Taxonomy CLI coverage for list defaults/output, create success/failure, update, delete confirmation and --yes, resolve existing/create behavior, and native error normalization.
  • Continue running TaxonomyAbilityWpErrorTest.

Constraints

  • No helper, wrapper, resolver, framework, DSL, or compatibility infrastructure.
  • No ability implementation changes.
  • No command or output contract changes.
  • Use existing AbilityRunner; do not duplicate raw registry plumbing.
  • Keep production PHP net-negative.
  • Do not edit CHANGELOG.md or version strings.
  • Avoid every file touched by open PR fix: prepare WordPress.org release package #3361.
  • Conventional refactor: commit.
  • PR only; do not release or deploy.

Expected production delta: approximately -5 PHP LOC.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions