Skip to content

recipe-run does not apply input mount rewrites to wordpress.phpunit execution #1696

Description

@chubes4

Summary

wp-codebox recipe-run can receive a recipe with declared inputs.mounts, compute valid canonical input-mount mappings, but still execute a wordpress.phpunit workflow step with the original mount paths. For readonly/materialized input mounts this makes the command fail before tests run.

Observed failure

Homeboy generated a recipe containing these mounts:

[
  {"source":"/home/chubes/Developer/_lab_workspaces/wpcom-...","target":"/wordpress/wp-content/plugins/wpcom","mode":"readwrite"},
  {"source":"/home/chubes/Developer/_lab_workspaces/wpcom-...","target":"/home/wpcom/public_html","mode":"readwrite"},
  {"source":"/home/chubes/.config/homeboy/extension-sources/wordpress/wordpress/vendor","target":"/wp-codebox-vendor","mode":"readonly"},
  {"source":"/home/chubes/.config/homeboy/extension-sources/wordpress/wordpress","target":"/homeboy-extension","mode":"readonly"}
]

The wordpress.phpunit step args included:

autoload-file=/wp-codebox-vendor/autoload.php
tests-dir=/wp-codebox-vendor/wp-phpunit/wp-phpunit
cwd=/home/wpcom/public_html/bin/tests/i18n-tools
test-root=/home/wpcom/public_html/bin/tests/i18n-tools
phpunit-xml=/home/wpcom/public_html/bin/tests/i18n-tools/phpunit.xml

Directly importing the built helper on the runner proves the map and rewrite are correct:

{
  "map": [
    {"originalTarget":"/wp-codebox-vendor","canonicalTarget":"/tmp/wp-codebox-inputs/2-wp-codebox-vendor-73845ca47d2f"},
    {"originalTarget":"/home/wpcom/public_html","canonicalTarget":"/tmp/wp-codebox-inputs/1-public_html-e7fcac2fc561"}
  ],
  "rewritten": [
    "cwd=/tmp/wp-codebox-inputs/1-public_html-e7fcac2fc561/bin/tests/i18n-tools",
    "autoload-file=/tmp/wp-codebox-inputs/2-wp-codebox-vendor-73845ca47d2f/autoload.php",
    "tests-dir=/tmp/wp-codebox-inputs/2-wp-codebox-vendor-73845ca47d2f/wp-phpunit/wp-phpunit",
    "test-root=/tmp/wp-codebox-inputs/1-public_html-e7fcac2fc561/bin/tests/i18n-tools",
    "phpunit-xml=/tmp/wp-codebox-inputs/1-public_html-e7fcac2fc561/bin/tests/i18n-tools/phpunit.xml"
  ]
}

But runtime execution still fails with the original path:

RuntimeException: configured PHPUnit harness autoload file is not readable: /wp-codebox-vendor/autoload.php

Evidence

  • Homeboy/WP Codebox run: runner-exec-test-wpcom-homeboy-lab-4db6ee87-5f72-4dea-8efb-e794ee523848
  • Captured recipe debug dir on runner: /home/chubes/Developer/.tmp/wpcom-codebox-wrapper-debug-1783036172
  • Earlier artifact debug dir: /home/chubes/Developer/.tmp/wpcom-codebox-debug-1783035721

Expected behavior

Every workflow command execution path should receive args rewritten through rewriteInputMountPathArgs() when inputs.mounts are canonicalized/materialized. wordpress.phpunit should see the canonical readable paths, not the original declared mount target.

Impact

This blocks running native WPCOM PHPUnit suites headlessly through WP Codebox because the PHPUnit harness autoload and project paths are mounted inputs.

AI assistance

  • AI assistance: Yes
  • Tool(s): openai/gpt-5.5 via OpenCode
  • Used for: Diagnosing the failing recipe-run path and drafting this issue.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions