Problem/Motivation
If a migration is using a lookup with stubbing, and the creation of the stub row has a problem, then the message is saved to the migration you're running, but the message is confusing, because it will typically come from a process plugin that you had no idea was involved in your migration, and will refer to migration mapping properties that are in the lookup migration.
Steps to reproduce
Proposed resolution
Improve the message so it is clear that a stub was being created, to include the destination property and an error message from the initial MigrateSkipRowException.
Remaining tasks
Review
Commit
User interface changes
API changes
Data model changes
Release notes snippet
Comment | File | Size | Author |
---|---|---|---|
#20 | Screenshot 2024-02-29 at 10.48.00 AM.png | 244.82 KB | smustgrave |
Issue fork drupal-3197915
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
- 3197915-skip-row-messages changes, plain diff MR !6764
Comments
Comment #2
joachim CreditAttribution: joachim at TrainingCloud commentedAt the risk of muddying the waters around various issues about improving migrate messages, here's a quick patch which makes the stub message much clearer.
Comment #3
quietone CreditAttribution: quietone as a volunteer commentedThis will need modification when #2976098: MigrateExecutable should add details for the migration & destination property to exceptions that cause a row failure is committed.
Let's postpone on that.
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedNeeds a reroll.
Comment #6
karishmaamin CreditAttribution: karishmaamin at Specbee commentedRe-rolled patch against 9.3.x
Comment #7
quietone CreditAttribution: quietone as a volunteer commented@karishmaamin, Thanks for the reroll.
I forced an error when running MigrateNodeCompleteTest to see the logged message. It was this, which looks fine except for the case when the original MigrateSkipRowException does not contain an error message. Shall we add an if block and only output the ', with message' when there really is a message.
d7_field_instance:allowed_values: Migration lookup for destination '0' attempted to create a stub using migration d7_taxonomy_vocabulary, which resulted in a row skip, with message ''
Also, needs tests.
Comment #9
dsdeiz CreditAttribution: dsdeiz at Skvare commentedYeah, tried looking at this. Yeah, can I ask what is meant by this?
Comment #13
quietone CreditAttribution: quietone at PreviousNext commented@dsdeiz, Sorry, I do not recall what I did to force the error.
I took another look here and then went ahead and added the change I proposed in #7. I also updated \Drupal\Tests\migrate\Unit\process\MigrationLookupTest::testTransformWithStubbing to use a data provider with two cases for this change.
Comment #14
quietone CreditAttribution: quietone at PreviousNext commentedComment #16
quietone CreditAttribution: quietone at PreviousNext commentedComment #17
dwwThis came up as a random #bugsmash triage target, which is where the new life is coming from. Mostly looks fine. Added a few MR suggestions for some nits.
Comment #19
quietone CreditAttribution: quietone at PreviousNext commentedComment #20
smustgrave CreditAttribution: smustgrave at Mobomo commentedHad to run locally as I couldn't run the test-only feature.
Appears this has already gone through a few rounds of reviews and appears the feedback has been addressed.
Comment #21
longwaveAppears to be one out of scope change in the MR.
Comment #22
longwaveApplied my own suggestion to save time here.
Comment #23
Ghost of Drupal PastComment #26
longwaveCommitted and pushed to 11.x and 10.3.x. Did not backport cleanly to 10.2.x, this is only a minor improvement so not sure it is worth backporting there.