Problem/Motivation
Document and rename the 'migration' process plugin because its name is not intuitive and we need better docs.
Proposed resolution
Rename to 'migration_lookup'.
Remaining tasks
User interface changes
API changes
Data model changes
| Comment | File | Size | Author |
|---|---|---|---|
| #60 | interdiff-2845486.txt | 664 bytes | catch |
| #60 | 2845486-59.patch | 42.75 KB | catch |
| #56 | 2845486-56.patch | 42.82 KB | ohthehugemanatee |
| #55 | interdiff_44-55.txt | 2.76 KB | heddn |
| #55 | 2845486-55.txt | 42.82 KB | heddn |
Comments
Comment #2
quietone commentedComment #3
phenaproximaSelf-assigning for review.
Comment #5
heddnComment #6
joachim commented+1 to the name change.
Missing descriptions.
Put quote marks on the name of the migration 'users'. Or better, give it a more distinctive name, such as users_migration. That avoids it also looking like a DB table name.
Comment #7
joachim commentedActually, now I think about it, the change of a plugin name should really happen in a separate issue from documentation. One is quite a dramatic change that should be clearly signposted in git logs and release notes; the other is fairly uncontentious.
Comment #8
heddnBased on #2824610-15: Rename DedupeBase/DedupeEntity process plugins to MakeUnique and add documentation we've been doing renames inside of the docs issue.
Comment #9
jofitzChanges in response to @joachim's code review in #6.
@todo: process plugin rename.
Comment #10
jofitzSetting back to Needs Work to rename the process plugin.
Comment #11
quietone commentedEmphasize the rename, similar to #2824610: Rename DedupeBase/DedupeEntity process plugins to MakeUnique and add documentation.
Comment #12
jofitzDoes anyone have any suggestions for the new name of this plugin? Reading through the documentation here's the best I can come up with:
If we can settle on a name then I am happy to make the change and push this one through - it has been sitting around too long for such a basic change.
Comment #13
mikeryanreference_lookup? relationship_lookup? Or, migration_lookup from the issue summary? I think the key point is that the source value is used to perform a lookup against the results of another migration...
Comment #14
quietone commentedYes, migration_lookup is the way to go.
Comment #15
jofitzComment #17
jofitzLet's pretend we didn't see that #embarrassed
Comment #18
mikeryanThanks, here's my first round of feedback:
I'd say "Looks up" rather than "Calculates".
It's not the migration_lookup plugin that maintains the relationship, but it is that plugin which leverages the information. So, swap "migration_lookup process" and "migration process".
, or a single migration ID.
no_stub should also be documented here.
Everything after "uid:" needs to be indented.
It would be a clearer demonstration of the use case to have different source_ids for the different migrations.
s/migration_lookup/migration_lookup plugin/
"the" before "migration list".
Should add something like "using the stub_id configuration key".
Let's take the source_ids out of this example.
Indentation.
...
Do we need these scenarios? Everything we need already has documentation.
We should copy rather than rename (thus having near-duplicate tests) so the BC layer is tested.
Comment #19
quietone commentedFixed
1, 2, 3. (but I liked the single first. ), 6, 7, 10 and 12.
TODO
4, 5 (changed the text but not the example), 8, 9 and 11
Comment #20
quietone commentedNeeds work for #18: 4, 5 (changed the text but not the example), 8, 9 and 11.
Comment #21
gaurav.kapoor commentedComment #22
gaurav.kapoor commentedFixed
Comment #23
phenaproximaI'm digging this extensive documentation. Great work. Migration lookup is very hard to explain (lots of facets to it) and you've all done a beautiful job. I have a few complaints:
Nit: I believe these two lines should be flush with each other.
Should be "For example, on the source site, a given user account may have an ID of 123..."
'id' should be 'ID', and 'ids' should be 'IDs'.
IDs
Can this be "Identifies the migration which will be used to create any stub entities"?
Can this be "'migration' can be a list of migration IDs"?
IDs
The end of this sentence is really unclear. Off the top of my head I'm not sure how to rephrase it, but I think it is confusing as-is. It sounds important, but is hard to grok.
Should be "...the migration you wish to use..."
I think we should remove everything after the final comma ("entities, overriding..."). The word "overriding" muddies the clarity of the sentence.
Let's remove the last sentence and put a colon after "use no_stub". As far as developers need be concerned, no_stub is a boolean value.
"drupal" should be capitalized.
Ditto.
Comment #24
yogeshmpawarComment #25
jofitzSorry @Yogesh Pawar, I've already done this one. Perhaps I should've self-assigned.
Comment #26
jofitzWell, I screwed that up! Here's the actual patch.
Comment #27
yogeshmpawarIt's okay @Jo Fitzgerald no problem.
Comment #28
yogeshmpawarI think you missed one thing #23.1 so added updated patch with interdiff.
Comment #29
jofitzAww, I should've mentioned that I'd discussed that with @phenaproxima in IRC and we'd decided to not make that change. Oh well, it's there now and you have made your contribution. Everyone's happy :)
Comment #31
mikeryanSome of my feedback in #18 has not been addressed:
no_stub should also be listed here.
The source keys here should be different (otherwise this would be unnecessary).
Again, is there a purpose to these scenarios, which don't seem to add anything to the other examples we have?
Comment #32
jofitzComment #33
mikeryanThe patch itself is RTBC as far as I'm concerned. Just one more thing - let's have a change record for this.
Comment #34
heddnAdded a CR.
Comment #36
phenaproximaDrupal CI is temperamental on this fine day, but that is no reason for it to impugn so fine a patch. Back to RTBC.
Comment #37
quietone commentedSorry to do this.
In item 12 of comment #18, mikeryan says,
And then I posted a patch which should have included that, but it didn't. This patch fixes restores that test.
Comment #38
quietone commentedLooks odd to see an empty interdiff. But it is correct. Instead of moving MigrationTest to MigrationLookupTest, and having one test, this patch did a copy of MigrationTest to MigrationLookupTest, leaving two tests. Migration test is the original and MigrationLookup is the new.
But, I just realized that MigrationTest needs to have deprecation added to it.
Comment #39
quietone commentedOh fudge, the patch is wrong.
Comment #40
quietone commentedActually, no it was ok. I am clearly more stressed about missing my holiday that I thought. Anyway, lets try again. This patch adds deprecation notices for MigrationTest. However, I am at the airport and learned that our flight is delayed, such that we miss our connecting flight. Maybe more mistakes are here!
Comment #41
heddnSome small nits. Tagging novice for the docs updates.
Nit: missing a slash between process\MigrationLookupTest
"Most" provides a value judgement that doesn't add value and isn't necessarily true. Let's avoid that dilemma and remove it entirely.
It isn't clear that these lines refer to the code example above it.
Comment #42
shabana.navas commentedApplied changes from comments in #41.
Comment #43
heddnSuper small nit, but could we get all these lines to line up with the 80 character limit? With the clean-up of the comment, there is plenty of space to re-flow the text.
Comment #44
gaurav.kapoor commentedComment #45
heddnComment #46
phenaproximaComment #47
catchThis looks great to me. When phenaproxima verbally described the issue I got confused by 'migration ' as in "migration migration process plugin", so "migration lookup process plugin" is a lot easier to figure out.
DrupalCS isn't happy though:
Comment #48
heddnComment #49
phenaproximaLooks good. Back to RTBC assuming Drupal CI passes.
Comment #51
phenaproximaComment #52
phenaproximaComment #53
ohthehugemanatee commentedHad to re-roll core/modules/migrate/tests/src/Unit/process/MigrationLookupTest.php to account for changes in d66aaae6c77cca28eb0cec31588c00c7778d9d55 . Interdiff is ugly and not usable.
Comment #54
ohthehugemanatee commentedComment #55
heddnOK, I think I mucked that patch up a bit in #48. Let's try this. Interdiff against 44.
Comment #56
ohthehugemanatee commentedRenamed that patch to .patch
Comment #57
ohthehugemanatee commentedThis should really only be RTBC when the patch goes green.
Comment #58
heddnIt came back green.
Comment #59
jofitzComment #60
catchOn renaming in the docs issue, it's a bit tricky because renaming would mean updating some documentation, but actually writing the full documentation relies on the rename (at least in these two cases) - so we'd have two patches with a direct dependency. On the other hand it's made this patch a bit harder to review since the diff is quite large. So not sure what's best with that.
There was still one phpcs violation in the patch, I think it's just this stray line but since the annotation is used by phpunit, uploading a patch just in case rather than directly fixing on commit. Leaving RTBC will commit once this comes back green.
Comment #62
catchCommitted/pushed to 8.4.x and cherry-picked to 8.3.x. Thanks!
Comment #64
heddnTagging for mention in 8.4.0 release notes.
Comment #65
xjmThe change record should be sufficient to capture the API improvement here since it has BC, but we'll include a bullet in the release notes for these and other Migrate and Migrate Drupal API improvements. Thanks!
Comment #66
xjmAh, looks like this one was also backported to 8.3.x.