Repository navigation
Run the Abilities API in the runtime-matrix smoke test (Phase A3) - #152
Merged
Merged
Conversation
On WordPress 6.9+, run borges/get-bibliographies and a borges/add-citations dry run through the Abilities API as admin (wp eval-file check-abilities.php), asserting dryRun, an etag, entryCount + 1, and unchanged post content. Older WordPress skips with a message. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #152 +/- ##
=========================================
Coverage 88.28% 88.28%
Complexity 22 22
=========================================
Files 61 61
Lines 7290 7290
Branches 690 690
=========================================
Hits 6436 6436
Misses 291 291
Partials 563 563 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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
Phase A, ticket 3 of
docs/planning/refactor-and-standards-memo.md.Until now, no ability had ever run on a real WordPress install. The PHPUnit mocks only cover registration and wiring. This PR adds
scripts/runtime-matrix/check-abilities.php, whichsmoke.shruns throughwp eval-file … --user=admin, the same waycheck-blocks.phpandformat-styles.phprun.What it checks:
borges/get-bibliographiesreturns the smoke post's bibliography with entries.borges/add-citationsdry run with one CSL book:dryRun: trueand anetag;entryCountup by exactly one;post_contentbyte-identical.Gating. On WordPress without the Abilities API (6.4–6.8, such as the
apache-php74-wp64cell), the script printsabilities-skipand the smoke test carries on. Thewplatestcells run it.Why PHP, not REST. The abilities run in PHP through
wp_get_ability()->execute(), not through core's/wp-abilities/v1REST controller. That still exercises the real permission callbacks (edit_postas admin), input-schema validation, and the dry-run and ETag logic. Testing the REST exposure would be a small follow-up if wanted.The write abilities register because the earlier part of the smoke test already installs the mu-plugin that enables the write routes.
Validation
bash -n scripts/runtime-matrix/smoke.sh: passes.php -lon the new file: passes.composer test:php: 446 tests pass./smokemount (scripts/runtime-matrix:/smoke:ro) and theadminuser (created with--admin_user=adminin every install path) againstsmoke.sh.wplatestcells. The check has not run against real WordPress before.Checklist
🤖 Generated with Claude Code
https://claude.ai/code/session_01KbVuMPN7YTcV27vwsG3LZ2
Generated by Claude Code