Fix smoke-test-published-packages: 6 packages broken on v0.7.2#264
Merged
Fix smoke-test-published-packages: 6 packages broken on v0.7.2#264
Conversation
The nightly smoke-test-published-packages workflow has been failing on
v0.7.2 against six packages. Each one had a different reason for not
working when installed standalone via `composer require`:
- blueprints: bin/blueprint.php hard-coded a monorepo-relative path to
vendor/autoload.php and exposed CLI-only classes through the classmap,
so any consumer that triggered autoload of those classes hit the bad
require. Excluded bin/ and Steps/scripts/ from the classmap, made the
CLI bootstrap try multiple autoload locations and skip the require if
composer's ClassLoader is already in scope, and excluded the
Symfony event-dispatcher/DependencyInjection bridge that depends on
symfony/dependency-injection (not bundled).
- corsproxy: PSR-4 autoload mapped WordPress\\CORSProxy\\ to a tree
whose classes are actually declared in the global namespace, so the
classes never autoloaded. Switched to classmap + an autoload.files
entry for cors-proxy-functions.php, and fixed a phpcbf-introduced
syntax error on line 394 that this file hits as soon as it's actually
loaded.
- data-liberation: DataLiberationHTMLProcessor extends WP_HTML_Processor
but the package didn't depend on wp-php-toolkit/html. Added the dep.
- markdown: vendored symfony/yaml and webuni/front-matter ship optional
integrations (Console-based LintCommand, Twig/Haml/Pug filters) that
require packages we don't bundle. Excluded those subdirs from the
classmap.
- merge: required the non-existent `wordpress/data-liberation:dev-trunk`
and pulled in `yetanotherape/diff-match-patch` as a Composer dep even
though the package is already in vendor-patched/. Replaced both with
the toolkit's own data-liberation, dropped to PHP >=7.2 to match the
project floor.
- polyfill: wordpress.php was loaded eagerly via autoload.files and
declared WP_Error at composer-bootstrap time, which fatals as soon as
a consumer also boots WordPress (this is exactly what
bin/check-wp-coexistence.php was added to catch). Moved WP_Error and
WP_Exception into classmap-loaded class-*.php files so they're
declared lazily, and added the missing php-functions.php entry to
the standalone autoload.files list.
The smoke check itself was tightened in two places:
- bin/check-package-autoload.php now reads each package's
autoload.exclude-from-classmap and skips those paths during the
symbol scan, so excluding files from the classmap (CLI entry points,
optional integrations) doesn't trigger false-positive "unreachable
via autoload" failures.
- The root composer.json's autoload was brought in line with the
per-component config: components/CORSProxy/ and components/Polyfill/
are now in the classmap, cors-proxy-functions.php is in
autoload.files, and the bogus WordPress\\CORSProxy\\ PSR-4 entry
is gone.
Local replay of the smoke workflow against all 17 packages (using path
repositories of the components/) now reports OK on every package.
The PHPUnit matrix uses composer-ci-matrix-tests.json (a parallel autoload config to root composer.json), which had not been updated alongside it. Without components/Polyfill/ in its classmap, the WP_Error and WP_Exception classes that were just moved into class-*.php files are not autoloadable in CI, causing every test that references WP_Error from DataLiberation to fail. Mirrors the root composer.json change: adds components/Polyfill/ and components/CORSProxy/ to classmap, drops the bogus WordPress\\CORSProxy\\ PSR-4 entry, and adds php-functions.php / cors-proxy-functions.php to autoload.files.
4 tasks
adamziel
added a commit
to adamziel/reprint
that referenced
this pull request
May 4, 2026
## Summary Picks up [wp-php-toolkit v0.7.3](https://github.com/WordPress/php-toolkit/releases/tag/v0.7.3), which fixed the published-package autoload regressions caught by WordPress/php-toolkit#264. The most relevant fixes for reprint: - data-liberation@0.7.3 now correctly declares its dependency on wp-php-toolkit/html - polyfill@0.7.3 no longer eagerly declares WP_Error through autoload.files - Various optional integrations bundled in vendored Symfony / webuni packages are excluded from the classmap ## Changes - packages/reprint-exporter/composer.json: ^0.7.2 -> ^0.7.3 for data-liberation and html - packages/reprint-importer/composer.json: same - composer.lock refreshed; all transitive toolkit packages resolve to v0.7.3 ## Test plan - [x] composer update wp-php-toolkit/data-liberation wp-php-toolkit/html resolves cleanly to v0.7.3 across all transitive packages - [x] composer compat (PHP 7.4 compatibility) passes - [x] ExportLibraryLoadTest and BuildPdoDsnTest pass locally - [ ] PHPUnit matrix green on CI
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The nightly smoke-test-published-packages workflow has been failing on v0.7.2 against six packages — each for a different reason. None of these are caught by the in-monorepo PHPUnit suite because the bug only surfaces once the package is split off and consumers
composer requireit standalone.Failing packages:
blueprints,corsproxy,data-liberation,markdown,merge,polyfill.What changed
Per-package fixes (see commit message for full reasoning):
bin/blueprint.phphad a hard-coded monorepo-relative path tovendor/autoload.php, and exposed CLI-only classes through the classmap. Nowbin/andSteps/scripts/are excluded from the classmap, the CLI bootstrap probes multiple autoload locations and skips the require when composer'sClassLoaderis already in scope, and the SymfonyDependencyInjectionbridge (which needs symfony/dependency-injection — not bundled) is excluded too.WordPress\\CORSProxy\\to a tree whose classes are actually globally namespaced, so the classes never autoloaded. Switched to classmap +autoload.filesforcors-proxy-functions.php, and fixed a phpcbf-introduced syntax error on line 394 that the file hits as soon as it's actually loaded.DataLiberationHTMLProcessorextendsWP_HTML_Processorbut the package didn't depend onwp-php-toolkit/html. Added the dep.symfony/yamlandwebuni/front-mattership optional integrations (Console-based LintCommand, Twig/Haml/Pug filters) that need packages we don't bundle. Those subdirs are now excluded from the classmap.wordpress/data-liberation:dev-trunkand pulled inyetanotherape/diff-match-patchas a Composer dep even though it's already invendor-patched/. Replaced both with the toolkit's ownwp-php-toolkit/data-liberation, dropped tophp: >=7.2to match the project floor.wordpress.phpwas loaded eagerly viaautoload.filesand declaredWP_Errorat composer-bootstrap time, which fatals as soon as a consumer also boots WordPress (the exact regressionbin/check-wp-coexistence.phpwas added to catch).WP_ErrorandWP_Exceptionnow live in classmap-loadedclass-*.phpfiles so they're declared lazily, and the missingphp-functions.phpentry was added to standaloneautoload.files.The smoke check itself was tightened so it doesn't false-positive against the new excludes:
bin/check-package-autoload.phpnow reads each package'sautoload.exclude-from-classmapand skips those paths during the symbol scan.composer.json's autoload was brought in line with the per-component config (CORSProxy/Polyfill in classmap,cors-proxy-functions.phpinautoload.files, bogusWordPress\\CORSProxy\\PSR-4 mapping removed).Test plan
components/reports OK on every packagecomposer lint -- -ncleancomposer test --testsuite "Project Test Suite"(the fast non-Blueprints suite) passesPublishworkflow run cuts a new tag — the chainedsmoke-published-packagesjob should pass against the freshly-cut tag🤖 Generated with Claude Code