drush-ops / drush

Drush is a command-line shell and scripting interface for Drupal, a veritable Swiss Army knife designed to make life easier for those who spend their working hours hacking away at the command prompt.
https://www.drush.org
2.34k stars 1.08k forks source link

Add flag to filter for migration status (complete, incomplete, in progress) #5013

Open brooke-heaton opened 2 years ago

brooke-heaton commented 2 years ago

Is your feature request related to a problem? Please describe.

I'm running a D7 to D9 migration and am constantly updating the source DB as we approach our 'Go Live' date. This requires me to rerun migrations and occasionally I hit snags and need to reset then rerun them. So I'm then having to look at the VERY LONG and very verbose output of drush migrate-status to see what needs updating. Sometimes a migration 'gets stuck' on 'In Progress' so I need to reset it and I've been grepping the output of drush migrate-status to find any migrations stuck in In Progress. I also only want to run migrations that have new entities that are Unprocessed. All of this experience suggests there's a better way.

Describe the solution you'd like

Create a --status parameter that can be passed to the migrate-status command that will look for migrations by status. in-progress would show any migrations current in progress complete would look for migrations at Idle that have 0 unprocessed entities incomplete would look for migrations at Idle that have >0 unprocessed entities

Describe alternatives you've considered Alternately if there were a better way to grep the output of migrate-status for a status output of the table, that might work, however the table only outputs In Progress as a status. Idle is not that helpful.

weitzman commented 2 years ago

grep is a very good approach IMO.

If you want to be more precise, you can usually use the --filter option on table output but for some reason that option is not present in this command. I'll open a PR for that in a sec. See https://www.drush.org/latest/output-formats-filters/#output-filters

weitzman commented 2 years ago

I see now that you want to add a new type of status. I'll leave this open as a feature request

weitzman commented 2 years ago

That option is added in https://github.com/drush-ops/drush/pull/5014