-
Notifications
You must be signed in to change notification settings - Fork 205
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
add: created a new CLI cmd to backfill missing author terms for posts. #1060
Conversation
@GaryJones do you know why we have these failing tests here? I see that we no longer support php 7.1 ( Co-Authors-Plus/co-authors-plus.php Line 16 in 37065d2
|
Since https://github.com/Automattic/Co-Authors-Plus/blob/develop/.github/workflows/integrate.yml use PHP 7.4, it looks like this PR branch should be targetted to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks and tests well.
Can we just add a comment to the command description highlighting the difference between this and the old command?
I also think we could add a comment in the old command, saying that we should give preference to this new and more robust version of it.
And a NIT, not blocking: since the batching occurs on run time, there is no real difference from a user perspective running the command with or without it, from a functional point of view. The only thing that can happen is an OOM if you run without batching... In other words, there is no reason to have an option to run this command without doing batches. Is there? We could leave just the option for the batch size and always run in batches... WDYT?:
The comments are meant to clarify the key differences between the two commands, and that the new one should be preferred over the old one.
Great idea! Done here.
That batching approach really comes from a L&I point of view. Often times, our migration commands can be interrupted due to memory constraints or we can cause MySQL binlog replication issues. Although not a perfect approach, tackling a certain amount of records at a time usually mitigates those problems. I don't mind removing it though, since the command should operate just fine if it were restarted due to an interruption during execution. |
I don't mean removing the batching approach. I mean making it the default and only approach. There is no benefit in not using it |
I obviously need some more coffee today! I think we shouldn't remove the batched flag, but we should make it |
Description
This is a new, more efficient, command to help backfill author term data for any posts that are missing it. The new command was based off of the old one. The key differences between that command and this one are:
wp co-authors-plus create-terms-for-posts
would always start back from the first post. For sites of a certain stature, this could create a situation where this command would never finish executing. Instead, this new command only looks for posts that are missing the requisite author term in the relationships table via SQL.Deploy Notes
Are there any new dependencies added that should be taken into account when deploying to WordPress.org?
No, this is an entirely new command.
Steps to Test
wp co-authors-plus create-author-terms-for-posts
wp co-authors-plus create-terms-for-posts
. Notice that no new author terms are being created.