Migration Guide
This guide covers breaking changes and migration steps when upgrading Chubes Docs from version 0.1.x to 0.2.x.
Note: Current plugin version is 0.2.8.
Version 0.2.0 Breaking Changes
API Parameter Changes
Sync Endpoints
Before (v0.1.x):
curl -X POST /wp-json/chubes/v1/sync/doc
-d '{
"title": "My Doc",
"content": "# Content",
"codebase_path": ["wordpress-plugins", "my-plugin"]
}'
After (v0.2.x):
# Step 1: Setup project
curl -X POST /wp-json/chubes/v1/sync/setup
-d '{
"project_slug": "my-plugin",
"project_name": "My Plugin",
"category_slug": "wordpress-plugins",
"category_name": "WordPress Plugins"
}'
# Step 2: Sync document
curl -X POST /wp-json/chubes/v1/sync/doc
-d '{
"source_file": "README.md",
"title": "My Doc",
"content": "# Content",
"project_term_id": 15,
"filesize": 1024,
"timestamp": "2025-12-01T10:00:00Z",
"subpath": ["docs"]
}'
New Required Parameters
source_file: Original file path (string, required)filesize: File size in bytes (integer, required)timestamp: ISO 8601 timestamp (string, required)project_term_id: Project taxonomy term ID (integer, required)subpath: Hierarchical path as array (array, optional)
Parameter Format Changes
subpath: Now expects array instead of stringcodebase_path: Docs endpoints acceptcodebase_pathas an array (for resolving and assigning taxonomy)
Taxonomy Management Changes
Path Resolution
Before:
curl -X POST /wp-json/chubes/v1/codebase/resolve
-d '{"path": ["wordpress-plugins", "my-plugin", "api"]}'
After:
curl -X POST /wp-json/chubes/v1/codebase/resolve
-d '{"path": ["wordpress-plugins", "my-plugin", "api"]}'
Documentation Assignment
Before:
curl -X POST /wp-json/chubes/v1/docs
-d '{
"title": "API Docs",
"content": "...",
"codebase_path": ["wordpress-plugins", "my-plugin", "api"]
}'
After:
# First resolve/create taxonomy path
curl -X POST /wp-json/chubes/v1/codebase/resolve
-d '{
"path": ["wordpress-plugins", "my-plugin", "api"],
"create_missing": true
}'
# Then create documentation
curl -X POST /wp-json/chubes/v1/docs
-d '{
"title": "API Docs",
"content": "...",
"codebase_path": ["wordpress-plugins", "my-plugin", "api"]
}'
Migration Steps
1. Update Sync Scripts
Modify existing sync scripts to use the new API:
// Before
const syncData = {
title: "My Doc",
content: markdown,
codebase_path: "wordpress-plugins/my-plugin"
};
// After
const setupResponse = await fetch('/wp-json/chubes/v1/sync/setup', {
method: 'POST',
body: JSON.stringify({
project_slug: "my-plugin",
project_name: "My Plugin",
category_slug: "wordpress-plugins",
category_name: "WordPress Plugins"
})
});
const { project_term_id } = await setupResponse.json();
const syncData = {
source_file: "docs/README.md",
title: "My Doc",
content: markdown,
project_term_id: project_term_id,
filesize: fs.statSync("docs/README.md").size,
timestamp: new Date().toISOString(),
subpath: ["docs"]
};
2. Update Taxonomy References
Replace string-based paths with array-based paths:
# Before
curl /wp-json/chubes/v1/docs?codebase=my-plugin
# After (same - slug-based filtering still works)
curl /wp-json/chubes/v1/docs?codebase=my-plugin
3. Update Batch Operations
Modify batch sync payloads:
{
"docs": [
{
"source_file": "docs/install.md",
"title": "Installation",
"content": "...",
"project_term_id": 15,
"filesize": 2048,
"timestamp": "2025-12-01T10:00:00Z",
"subpath": ["guides"]
}
]
}
4. Update CI/CD Pipelines
Update GitHub Actions or other automation:
- name: Sync Documentation
run: |
# Get project term ID
SETUP_RESPONSE=$(curl -s /wp-json/chubes/v1/sync/setup
-d '{"project_slug":"my-plugin","project_name":"My Plugin","category_slug":"wordpress-plugins","category_name":"WordPress Plugins"}')
PROJECT_TERM_ID=$(echo $SETUP_RESPONSE | jq -r '.project_term_id')
# Sync documents
curl /wp-json/chubes/v1/sync/batch
-d "{"docs": [{"source_file":"README.md","title":"README","content":"...","project_term_id":$PROJECT_TERM_ID,"filesize":1024,"timestamp":"$(date -Iseconds)"}]}"
Compatibility Notes
Backward Compatibility
- Not maintained: Direct migration from 0.1.x to 0.2.x requires code changes
- Data preservation: Existing posts and taxonomy terms are preserved
- URL compatibility: Existing documentation URLs remain functional
Deprecated Features
- String-based
codebase_pathand string-basedsubpathparameters (use arrays)
Troubleshooting Migration
Common Issues
"Project term not found"
- Ensure
/sync/setupis called before sync operations - Verify
project_term_idis used instead ofcodebase_path
"Invalid parameter format"
- Check that
subpathis an array, not a string - Ensure
timestampis valid ISO 8601 format
"Content not updating"
- Include
filesizeandtimestampparameters - Use
force: trueif needed
Rollback Plan
If migration fails:
- Restore backup of WordPress database
- Downgrade plugin to previous version
- Test functionality before retrying migration
- Update scripts gradually rather than all at once
Validation Steps
After migration:
- Test sync operations with sample data
- Verify taxonomy structure in WordPress admin
- Check documentation URLs are working
- Validate API responses match expected format
- Test batch operations with multiple documents
Manual GitHub Sync Endpoints (0.2.8)
Version 0.2.8 adds manual GitHub sync and diagnostics endpoints:
POST /sync/allPOST /sync/term/{id}GET /sync/test-tokenPOST /sync/test-repo
These endpoints require manage_options.
Version 0.2.1 Updates
Additional Changes in 0.2.1
- Enhanced
/sync/setupendpoint with improved error handling - Better subpath resolution for nested documentation
- Improved timestamp validation for content updates
- Enhanced metadata support for repository information
Migration from 0.2.0 to 0.2.1
No breaking changes – update is backward compatible. New features include:
- Better error messages in sync responses
- Improved performance for large batch operations
- Enhanced debugging capabilities
Support
For migration assistance:
- Review this guide thoroughly before starting
- Test in staging environment first
- Backup data before migration
- Update scripts incrementally to minimize downtime
- Contact support if issues persist after following this guide