Forms: Add ability output schemas#49954
Conversation
|
Are you an Automattician? Please test your changes on all WordPress.com environments to help mitigate accidental explosions.
Interested in more tips and information?
|
|
Thank you for your PR! When contributing to Jetpack, we have a few suggestions that can help us test and review your patch:
This comment will be updated as you work on your PR and make changes. If you think that some of those checks are not needed for your PR, please explain why you think so. Thanks for cooperation 🤖 Follow this PR Review Process:
If you have questions about anything, reach out in #jetpack-developers for guidance! |
Code Coverage SummaryCoverage changed in 1 file.
|
|
Review — standard depth (296 lines, 1 project). No blockers; the change is correct and consistent with existing patterns. Three non-blocking suggestions, all around schema-vs-reality fidelity and test coverage of the new contracts.
|
Fixes JETPACK-1770
This PR is open because Forms is already the strongest Jetpack Abilities API integration, and agents need dependable response shapes to use it safely. It keeps the change limited to output contracts and a small no-op guard so the broader rollout can stay reviewable.
This follows the WordPress
wp_register_ability()documentation: schemas define the expected structure of ability inputs and outputs, support validation, and make the API contract self-documenting for developers and tools.Proposed changes
jetpack-forms/update-responseso calls must include a mutation field, matching the declared object output contract.jetpack-forms/get-forminstead of the public permalink.Related product discussion/links
codex/forms-abilities-output-schemastoadd/forms-abilities-output-schemas.Does this pull request change what data or activity we track or use?
No.
Testing instructions
projects/packages/forms, run:php vendor/bin/phpunit-select-config phpunit.#.xml.dist --colors=always tests/php/abilities/Forms_Abilities_Test.php30 tests, 227 assertions.CI=true jp test php packages/forms -vcurrently reaches PHPUnit but fails in existing webhook localhost tests unrelated to these Forms abilities changes.