Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Companion issue to #2714529: Add source and destination IDs to the data returned by getMessageIterator() .
Once that lands, drush mmsg
doesn't need to print the source_ids_hash column.
Patch coming soon, stay tuned.
Comment | File | Size | Author |
---|---|---|---|
#22 | 2960221-22.patch | 4.84 KB | heddn |
Comments
Comment #2
dwwClarified title and summary that this is about the
drush mmsg
command.Comment #3
dwwPostponed might be a more appropriate status here, although the way I wrote this it doesn't depend on #2960209 landing first, and will happily work whether you're running a version of core that includes that fix/patch or not.
Comment #4
heddnCan we just load/print the source ids if they don't exist? And needs tests so needs work.
Comment #5
dwwSort of. I suppose we could stop using \Drupal\migrate\Plugin\migrate\id_map\Sql::getMessageIterator() entirely and write our own version that does the same query. But that seems evil and wrong, and will break if the migration's id_map isn't being stored in SQL (not sure if that even works, but presumably if this is all so class-tastically flexible, it's intended to work).
Can you be more specific? What exactly would you want tested here? It's a trivial fix to the UI. Please clarify and I'll see what I can do.
Thanks,
-Derek
Comment #6
dwwUpon closer inspection, I see no existing test coverage for any of the drush commands. I have no idea where to start with that. Seems unfair to hold up this trivial fix for adding entirely new test plumbing. If you want to open a new issue for "add test coverage for migrate_tools drush commands" I'll try to help, but for now, I'm resetting the status on this. Hope you agree.
Thanks,
-Derek
Comment #7
mikeryanIf #2714529: Add source and destination IDs to the data returned by getMessageIterator() gets in, a change to migrate_tools shouldn't be necessary - that patch will remove the hash value from the getMessageIterator() return.
Comment #8
dwwExcept we can't always remove the hash from
getMessageIterator()
. See #2714529-18: Add source and destination IDs to the data returned by getMessageIterator() and #19.That said, patch #20 would break this, since we would no longer be able to assume consistent column aliases in that case. :( Not entirely sure the cleanest solution to that. Input welcome.
Comment #9
heddnWith drush 9 released, shouldn't we support it too?
Comment #10
dwwMaybe, although I've never been able to get Drush 9 working on any site where I've tried it, so I'm the wrong one to ask. ;)
Plus, it seems like the parent issue is stalled upstream, so I don't know when/if it's worth trying to fix drush to benefit from it.
Perhaps this is a more appropriate status.
Comment #11
heddnIs this any easier now that #2798363: Implement --idlist options on rollback and messages has landed?
Comment #12
benjifisherSince #2960209: Provide human-readable source IDs from \Drupal\migrate\Plugin\migrate\id_map\Sql::getMessageIterator() was closed as a duplicate of #2714529: Add source and destination IDs to the data returned by getMessageIterator() , let's reference the latter in the issue summary.
Comment #13
alisonWith #2714529: Add source and destination IDs to the data returned by getMessageIterator() , I'm quite content with the drush mmsg command output (see example below) -- honestly, it's still nice to have the info, don't y'all think?
Perhaps a new feature could be to allow including/excluding columns in mmsg output...?
.............................
Example mmsg output: (I removed characters from the hashes so that it's easier to read here) (maybe that's why ppl want this column gone haha... but, I maintain that it's nice to have all the details!)
Comment #14
benjifisherNow that #2714529: Add source and destination IDs to the data returned by getMessageIterator() has gone in, we can un-postpone this issue. I am not sure whether it should be NW or NR, but I guess NW for drush 9 support (Comment #9).
Comment #15
heddnNW seems fine since this needs to work w/ Drush 9 (and 10)
Comment #16
heddnWhat's need here? Now the core patch has landed, is this a simple fix?
Comment #17
dwwIt was once a simple fix. ;) Then Drush released 2 more major versions, and apparently we're trying to support all of them.
I honestly haven't looked at any of this code in ages. Not sure why patch #3 is drush-version-dependent. Not sure what else needs to happen here, if anything.
#13 claims the current UI is fine (including the incomprehensible hash value). I disagree, but I don't really care that much.
So, either "Won't fix" if we believe #13 that this UI is good as-is.
Or figure out what, if anything, needs to change about #3 to work with All The Drushes(tm).
There's also the question of "needs tests", but as I pointed out in #6 we had (still have?) 0 test coverage of the drush commands, so I don't think we should be adding all new test plumbing just for this.
YMMV... ;)
Cheers,
-Derek
Comment #18
heddnLet's see if this works for folks.
Comment #19
dwwRemoving the CSV option seems out of scope. Is that included here by accident?
Comment #20
heddnI can remove that part into another issue. Drush itself supports the CSV feature natively with more features. But it can be another issue.
Comment #21
heddnComment #22
heddnNeeded a re-roll.
Comment #23
heddnI'll give this a few more days to wait for community feedback. Then I'll commit it if no one has adverse feedback.
This first
$expected
isn't needed. Can be fixed on commit.Comment #25
heddnThanks @dww for you contributions.
Comment #26
dwwThanks! Sorry I didn't get a chance to actually test this again for real. Appreciate you taking the time to finish this off.
Cheers,
-Derek