Goal
Bulk REST operations run synchronously today. Large collections can time out or run out of memory. Cap REST requests and send larger jobs through WP-CLI instead.
Scope
- Cap REST bulk operations at 1000 affected rows.
- For
migrate_rows, count rows that hold the source value.
- For
delete_dependent_rollups_for_field, count rows across every rollup that depends on the deleted field.
- Over the cap, return HTTP 400 with
cortext_bulk_op_requires_cli and a message containing the exact CLI command to run.
- Add uncapped WP-CLI commands with progress and resume:
wp cortext migrate-field <id> --from=<value> --to=<value>
wp cortext rebuild-dependent-rollups
- Add
Cortext\Background\BulkRunner with a sync implementation so an async runner can be added later without changing callers.
Acceptance criteria
FieldsController::migrate_rows and delete_dependent_rollups_for_field return 400 with the CLI command when the request is above the cap.
- Both CLI commands complete on a large dataset with a progress bar.
- Under-cap behavior is unchanged.
Goal
Bulk REST operations run synchronously today. Large collections can time out or run out of memory. Cap REST requests and send larger jobs through WP-CLI instead.
Scope
migrate_rows, count rows that hold the source value.delete_dependent_rollups_for_field, count rows across every rollup that depends on the deleted field.cortext_bulk_op_requires_cliand a message containing the exact CLI command to run.wp cortext migrate-field <id> --from=<value> --to=<value>wp cortext rebuild-dependent-rollupsCortext\Background\BulkRunnerwith a sync implementation so an async runner can be added later without changing callers.Acceptance criteria
FieldsController::migrate_rowsanddelete_dependent_rollups_for_fieldreturn 400 with the CLI command when the request is above the cap.