Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(content-distribution): migration tweaks #201

Open
wants to merge 3 commits into
base: trunk
Choose a base branch
from

Conversation

miguelpeixe
Copy link
Member

@miguelpeixe miguelpeixe commented Jan 22, 2025

Implements 2 new features to the migration:

  • --dry-run flag for the CLI command
  • Lock editing distributed posts for 10 minutes after a migration to give time for the incoming posts to process:
image

Testing

  1. Using Distributor, distribute a post to a couple of nodes
  2. Run the dry run migration:
wp newspack network distributor migrate --all --dry-run
  1. Confirm you get information about the migration but it doesn't go through
  2. Run the migration:
wp newspack network distributor migrate --all
  1. Confirm the migration runs
  2. Visit the posts dashboard in the distribution origin and confirm you get the notice as in the image above and you're unable to edit the distributed posts (other posts should be fine)
  3. Wait 10 minutes or manually delete the transient:
wp transient delete newspack_network_distributor_migration_lock
  1. Refresh the page and confirm the notice is gone and you are able to edit the posts

@miguelpeixe miguelpeixe marked this pull request as ready for review January 23, 2025 13:57
@miguelpeixe miguelpeixe requested a review from a team as a code owner January 23, 2025 13:57
@miguelpeixe miguelpeixe self-assigned this Jan 23, 2025
@miguelpeixe miguelpeixe requested a review from naxoc January 23, 2025 13:57
Copy link
Member

@naxoc naxoc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! Tested and works 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants