feat: add universal handler dry-run command (wp datamachine test)#937
Merged
feat: add universal handler dry-run command (wp datamachine test)#937
Conversation
New primitive for testing any fetch handler without running a full pipeline. Resolves handler by slug, applies config defaults, calls get_fetch_data(), and returns packet summaries. Supports --list, --describe, --config, --flow, --limit, and --format. Closes #936
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
Adds
wp datamachine test <handler>— a universal dry-run command for any fetch handler. Resolves #936.TestHandlerAbility(inc/Abilities/Handler/TestHandlerAbility.php) — the ability that resolves handler by slug, applies config defaults, callsget_fetch_data('direct', ...), and returns packet summariesTestCommand(inc/Cli/Commands/TestCommand.php) — the CLI surface with--list,--describe,--config,--flow,--limit, and--formatflagsdata-machine.php(require + instantiation) andBootstrap.php(CLI registration)CLI Interface
Testing Done
Tested live on events.extrachill.com:
--list→ 13 fetch handlers listed ✅--describe ticketmaster→ config fields table ✅--flow=3(Royal American web scraper) → 26 events found ✅ticketmaster --config='{"location":"32.7,-79.9","radius":"50"}'→ 151 events ✅rss --config='{"feed_url":"https://pitchfork.com/feed/feed-news/rss"}'→ RSS items ✅