Automattic / newspack-plugin

An advanced open-source publishing and revenue-generating platform for news organizations.
https://newspack.com
GNU General Public License v2.0
324 stars 48 forks source link

feat(cli): cap-migration tweaks #3198

Closed adekbadek closed 2 weeks ago

adekbadek commented 3 weeks ago

All Submissions:

Changes proposed in this Pull Request:

  1. Adds two arguments for more fine-grained control: user_logins and guest_author_ids
  2. Ensures user email is always set when creating a WP User. Lack of an email causes issues with user avatar display.
  3. Fixes the liked WP Users migration – before, the contributor_no_edit role was not added, so the updated WP User would not be assignable to posts.
  4. Adds a CLI script to backfill the WP Users who should have the contributor_no_edit role added (subscriber/customer with posts authored)

How to test the changes in this Pull Request:

  1. Create two Guest Authors – one linked to a WP User with subscriber role, and one not
  2. Ensure the second one does not have an email address
  3. Execute wp newspack migrate-co-authors-guest-authors --user_logins=<login-of-the-WP-User> --verbose --live and observe only the first Guest Author was processed
  4. Execute wp newspack migrate-co-authors-guest-authors --guest_author_ids=<guest-author-ID-here> --verbose --live and observe only the second Guest Author was processed
  5. Observe the WP User created from the second Guest Author has a dummy email address assigned
  6. Observe that same WP User has the contributor_no_edit role

Other information:

adekbadek commented 2 weeks ago

only thing that felt weird to me was to add the example.com domain to the made up emails... Maybe the site domain? not sure...

I know. I've opted for @example.com to make it clear that it's a dummy address, not intended for any use.

matticbot commented 1 week ago

:tada: This PR is included in version 4.5.0-alpha.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

matticbot commented 1 week ago

:tada: This PR is included in version 4.5.0-hotfix-add-attributes-loader-effect-hook-deps.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

matticbot commented 1 week ago

:tada: This PR is included in version 4.6.0-alpha.1 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

matticbot commented 3 days ago

:tada: This PR is included in version 4.6.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: