refactor: extract content templates from SDK core#6
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
📝 WalkthroughWalkthroughThis pull request removes content-template functionality from the SDK core and directs users to a separate ChangesContent Template Removal and Separation
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@CHANGELOG.md`:
- Line 21: The changelog currently marks the release heading "## [1.2.0] -
2026-05-17" as released; move that section under the existing "## [Unreleased]"
heading (or rename it to "## [Unreleased] — pending 1.2.0") so 1.2.0 remains
marked as unreleased until the tag is created; locate the heading string "##
[1.2.0] - 2026-05-17" in CHANGELOG.md and either relocate its notes beneath "##
[Unreleased]" or change the heading to indicate pending status.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 73b032a4-4a8c-4f36-befc-c774d983b708
📒 Files selected for processing (34)
AGENTS.mdCHANGELOG.mdREADME.mddocs/02-user-guide/01-services-and-queries.mddocs/02-user-guide/posts.mddocs/03-examples/README.mddocs/04-development/testing.mddocs/guides/features.mddocs/guides/templates.mddocs/services/posts.mdexamples/custom-template.phpexamples/template-usage.phpsrc/Services/PostsService.phpsrc/Support/Templates/Contracts/TemplateDataInterface.phpsrc/Support/Templates/Data/AbstractTemplateData.phpsrc/Support/Templates/Data/ProductReviewTemplateData.phpsrc/Support/Templates/Data/StoryChapterTemplateData.phpsrc/Support/Templates/Data/StoryTemplateData.phpsrc/Support/Templates/PostTemplate.phpsrc/Support/Templates/ProductReviewTemplate.phpsrc/Support/Templates/StoryTemplate.phpsrc/Support/Templates/TemplateRegistry.phptests/ExtendedIntegration/Support/Templates/StoryTemplateExtendedIntegrationTest.phptests/Integration/Support/Templates/TemplateWorkflowIntegrationTest.phptests/Unit/Services/PostsServiceTest.phptests/Unit/Templates/AbstractTemplateDataTest.phptests/Unit/Templates/PostTemplateTest.phptests/Unit/Templates/ProductReviewTemplateDataTest.phptests/Unit/Templates/ProductReviewTemplateTest.phptests/Unit/Templates/StoryChapterTemplateDataTest.phptests/Unit/Templates/StoryTemplateDataTest.phptests/Unit/Templates/StoryTemplateTest.phptests/Unit/Templates/TemplateRegistryTest.phptools/test-coverage-map.php
💤 Files with no reviewable changes (24)
- src/Support/Templates/Contracts/TemplateDataInterface.php
- src/Support/Templates/Data/ProductReviewTemplateData.php
- examples/custom-template.php
- src/Support/Templates/Data/StoryChapterTemplateData.php
- docs/guides/templates.md
- src/Support/Templates/ProductReviewTemplate.php
- tests/Unit/Templates/StoryChapterTemplateDataTest.php
- src/Support/Templates/Data/StoryTemplateData.php
- tests/Unit/Templates/TemplateRegistryTest.php
- tests/Unit/Templates/ProductReviewTemplateTest.php
- tests/ExtendedIntegration/Support/Templates/StoryTemplateExtendedIntegrationTest.php
- tests/Unit/Templates/AbstractTemplateDataTest.php
- tests/Unit/Templates/ProductReviewTemplateDataTest.php
- src/Services/PostsService.php
- src/Support/Templates/TemplateRegistry.php
- tests/Unit/Templates/StoryTemplateDataTest.php
- src/Support/Templates/Data/AbstractTemplateData.php
- src/Support/Templates/PostTemplate.php
- examples/template-usage.php
- tests/Integration/Support/Templates/TemplateWorkflowIntegrationTest.php
- src/Support/Templates/StoryTemplate.php
- tests/Unit/Templates/PostTemplateTest.php
- tests/Unit/Templates/StoryTemplateTest.php
- tests/Unit/Services/PostsServiceTest.php
|
|
||
| - Updated testing docs, README development commands, and AI contributor guidance to require Docker-only WordPress integration tests. | ||
|
|
||
| ## [1.2.0] - 2026-05-17 |
There was a problem hiding this comment.
Keep 1.2.0 notes under Unreleased until the tag exists.
Line 21 marks 1.2.0 as released on 2026-05-17, while this PR was opened on 2026-05-16. That can misstate release state and confuse release automation/changelog consumers. Consider moving this block under ## [Unreleased] (or clearly marking as pending) until the actual tag is cut.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@CHANGELOG.md` at line 21, The changelog currently marks the release heading
"## [1.2.0] - 2026-05-17" as released; move that section under the existing "##
[Unreleased]" heading (or rename it to "## [Unreleased] — pending 1.2.0") so
1.2.0 remains marked as unreleased until the tag is created; locate the heading
string "## [1.2.0] - 2026-05-17" in CHANGELOG.md and either relocate its notes
beneath "## [Unreleased]" or change the heading to indicate pending status.
There was a problem hiding this comment.
Pull request overview
Refactors the SDK core by removing non-native “content template” functionality (template DTOs/classes, template-specific docs/examples/tests, and PostsService::createFromTemplate()), keeping only generic payload/Gutenberg helpers (PostBuilder, ContentBuilder) and pointing template users to jooservices/wordpress-content-templates.
Changes:
- Removed template framework (template contracts/data objects/templates/registry) and all related unit + (extended) integration tests/examples/docs.
- Removed
PostsService::createFromTemplate()and updated SDK docs to recommend passing template-generated payloads toposts()->create(). - Updated coverage-map tooling to reflect the new integration test layout and added explicit integration-coverage alias reasons for services.
Reviewed changes
Copilot reviewed 34 out of 34 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| tools/test-coverage-map.php | Removes template-specific mappings; improves integration test path resolution; expands integration coverage alias reasons. |
| tests/Unit/Templates/TemplateRegistryTest.php | Removes template registry unit tests (template system extracted). |
| tests/Unit/Templates/StoryTemplateTest.php | Removes story template unit tests (template system extracted). |
| tests/Unit/Templates/StoryTemplateDataTest.php | Removes story template DTO unit tests (template system extracted). |
| tests/Unit/Templates/StoryChapterTemplateDataTest.php | Removes chapter DTO unit tests (template system extracted). |
| tests/Unit/Templates/ProductReviewTemplateTest.php | Removes product review template unit tests (template system extracted). |
| tests/Unit/Templates/ProductReviewTemplateDataTest.php | Removes product review template DTO unit tests (template system extracted). |
| tests/Unit/Templates/PostTemplateTest.php | Removes abstract post template unit tests (template system extracted). |
| tests/Unit/Templates/AbstractTemplateDataTest.php | Removes shared template DTO validation unit tests (template system extracted). |
| tests/Unit/Services/PostsServiceTest.php | Removes unit test coverage for createFromTemplate() (method removed). |
| tests/Integration/Support/Templates/TemplateWorkflowIntegrationTest.php | Removes template workflow integration coverage (moved out of SDK core). |
| tests/ExtendedIntegration/Support/Templates/StoryTemplateExtendedIntegrationTest.php | Removes extended integration coverage for story template workflow (moved out of SDK core). |
| src/Support/Templates/TemplateRegistry.php | Removes template registry from SDK core. |
| src/Support/Templates/StoryTemplate.php | Removes story template implementation from SDK core. |
| src/Support/Templates/ProductReviewTemplate.php | Removes product review template implementation from SDK core. |
| src/Support/Templates/PostTemplate.php | Removes abstract post template contract from SDK core. |
| src/Support/Templates/Data/StoryTemplateData.php | Removes story template DTO from SDK core. |
| src/Support/Templates/Data/StoryChapterTemplateData.php | Removes chapter DTO from SDK core. |
| src/Support/Templates/Data/ProductReviewTemplateData.php | Removes product review DTO from SDK core. |
| src/Support/Templates/Data/AbstractTemplateData.php | Removes shared template DTO base class from SDK core. |
| src/Support/Templates/Contracts/TemplateDataInterface.php | Removes template DTO interface from SDK core. |
| src/Services/PostsService.php | Removes PostsService::createFromTemplate() API. |
| README.md | Updates SDK helper positioning; points template users to jooservices/wordpress-content-templates. |
| examples/template-usage.php | Removes template usage example (no longer in SDK core). |
| examples/custom-template.php | Removes custom template example (no longer in SDK core). |
| docs/services/posts.md | Removes/updates template references; clarifies external template packages generate payloads for posts()->create(). |
| docs/guides/templates.md | Removes templates guide (no longer applicable to SDK core). |
| docs/guides/features.md | Updates features guide to point content templates to external package. |
| docs/04-development/testing.md | Updates testing docs to remove template-specific integration coverage claims. |
| docs/03-examples/README.md | Updates examples index to point to external content-template examples. |
| docs/02-user-guide/posts.md | Updates user guide to remove SDK-core template helper references; points to external package. |
| docs/02-user-guide/01-services-and-queries.md | Updates user guide to remove template helper bullet; points to external package. |
| CHANGELOG.md | Adds 1.2.0 migration notes for template extraction and createFromTemplate() removal. |
| AGENTS.md | Adds explicit repository guidance: do not add content template features to SDK core. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
* feat: add chapter-based story templates * chore: add coverage gates and refresh docs * test: remove logger mock notice * fix: align service pagination and endpoint behavior * refactor: extract content templates from SDK core (#6) * refactor: extract content templates from SDK core * fix: clear release validation blockers * chore: prepare release 1.2.0
What
Why
Content templates are not native WordPress REST API SDK features. SDK core remains focused on endpoints, auth, HTTP, DTO/data, pagination, services, request/response handling, errors, and generic helpers.
Validation
Passed:
Blocked/not fully verified:
Migration
Use jooservices/wordpress-content-templates for story/product-review/article/custom content templates and pass generated payloads to posts()->create().
Release impact
Prepares wordpress-sdk 1.2.0. Release remains blocked until the configured Docker/WP scripts are restored or the repo scripts/docs are corrected.
Risk
Public BC break for template classes and PostsService::createFromTemplate(); native posts CRUD and generic builders remain covered.
Summary by CodeRabbit
Breaking Changes
jooservices/wordpress-content-templatespackage; users relying on story, product review, or article templates must migrate to the new dedicated package.Documentation