WP-CLI configuration files can inherit another YAML file through the reserved `_` block, but larger projects…
harbor run -t mimo-v2.6-rl/format-code-task-001029harbor download mimo-v2.6-rl/format-code-task-001029Fix the following issue:
WP-CLI configuration files can inherit another YAML file through the reserved _ block, but larger projects need to compose shared configuration without depending on the process working directory or accidentally applying the same ancestor twice. Please make WP_CLI\Configurator::merge_yml() treat inheritance as an ordered, failure-safe configuration graph while preserving the existing merge and alias behavior.
The _ -> inherit value must accept either the existing single path string or a YAML sequence of paths. Resolve every relative inherited path against the directory of the file that declares it, including at nested levels. Traverse parents depth-first in the order listed and apply the declaring file after all of its parents. Consequently, later parents and then the child replace earlier single-valued declared settings, while declared settings marked multiple (notably require) append their values in that same order. Relative path values and every relative require entry must likewise be made absolute against the directory of the YAML file where that value was written, rather than against the top-level file or current working directory.
Keep the existing extra-configuration merge switch meaningful at every level of inheritance. For an array-valued extra key, a file with _ -> merge: true shallow-merges its entries over the inherited array; without that flag, its array replaces the inherited value. The _ control block itself is metadata and must never appear in the extra configuration returned by to_array().
Aliases participate in the same parent/child precedence. Aliases that do not collide are retained. A later definition of the same alias replaces the earlier alias as a whole, so fields from two definitions do not bleed together, and each stored definition continues to expose only the supported user, url, path, and ssh fields.
Identify files by their canonical resolved path during one top-level merge_yml() call. If a shared ancestor is reached through multiple branches, apply it only at its first encounter; this prevents duplicated values in multiple settings. That visited set is per call: explicitly merging the same file again in a later merge_yml() call must apply it again.
Configuration graph failures must be explicit and atomic. A nonexistent inherited target must throw RuntimeException whose message identifies that target. A direct or indirect inheritance cycle must throw RuntimeException whose message identifies every file participating in the cycle. In either case, the failed top-level call must leave all previously accumulated declared configuration, extra configuration, and aliases exactly as they were before the call.