Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Site migration: change
migration_status
in sites endpoint to `site_…
…migration` (#14716) * Site migration: save migration meta option on target site, and return the data in sites endpoint Summary: In this patch, the migration manager saves a `site_migration_meta` option on the target site when a migration is failed or finished. This is an array containing the source blog ID, status and last modified timestamp of the migration. The `/me/sites` endpoint returns this array in a `site_migration` element, replacing the `migration_status` value we've been returning up till now. Test Plan: * Apply the patch and sandbox the API. * Sandbox the migration job by adding this to your `0-sandbox.php` file, and run the async job [[ https://fieldguide.automattic.com/asynchronous-jobs/testing-asynchronous-jobs-on-a-sandbox/ | watcher script ]]. ```php function sandbox_import_jobs( $sandboxed, $type ) { return in_array( $type, array( 'wpcom_migrate_site_monitor', ) ); } add_filter( 'sandbox_async_job', 'sandbox_import_jobs', 10, 2 ); ``` * Do a migration: run Calypso locally, go to `https://calypso.localhost:3000/migrate/[ TARGET SITE DOMAIN ]` and follow the steps. * When the migration is complete, check the `site_migration_meta` option for the target site. It should contain the source blog ID, status and last modified timestamp for the migration. * Go to the [[ https://[private link] | WordPress.com console ]] and make a request to `https://[private link].2/me/sites`. * View the target site you've just migrated to. It should have a `site_migration` node with the same data. * View a Simple site in the array. It should should have a `site_migration` node with a value of `false`. Reviewers: #samus_team, biskobe Reviewed By: #samus_team, biskobe Subscribers: biskobe Tags: #touches_jetpack_files Differential Revision: D38929-code This commit syncs r203001-wpcom. * Update to site_migration in 1.2 endpoint * Update e2e tests to match new value Co-authored-by: Jeremy Herve <jeremy@tagada.hu>
- Loading branch information