Hello all, it’s time for the weekly migration subsystem meeting. The meeting will take place in slack in various threads
This meeting:
➤ Is for core migrate maintainers and developers and anybody else in the community with an interest in migrations
➤ Usually happens every Thursday and alternates between 1400 and 2100 UTC.
➤ Is done on the #migration channel in Drupal Slack (see www.drupal.org/slack for information).
➤ Happens in threads, which you can follow to be notified of new replies even if you don’t comment in the thread. You may also join the meeting later and participate asynchronously!
➤ Has a public agenda anyone can add to. See the parent issue for an idea of the typical agenda.
➤*Transcript will be exported and posted* to the agenda issue. For anonymous comments, start with a :bust_in_silhouette: emoji. To take a comment or thread off the record, start with a :no_entry_sign: emoji.

Core migration issues

Next video meeting

2021-07-01 - The hope is that most or all of the maintainers will attend. We will try to focus on longer-term goals than in the weekly meeting.

Agenda Items

Add your items here.

0️⃣ Who is here today? What was your favorite DrupalCon session? (Shout outs welcome!)

dinarcon :wave: hello.
marvil07 Hi! I am leaning towards the format change more than a session :slightly_smiling_face: , i.e. I am grateful to have more time separated for contributions durign the week.
alison Hi! Alison here - I didn't get to attend sessions, but I enjoyed and appreciated the migration BoF!I also enjoyed a "paragraphs + layout builder together" roundtable at the Higher Ed summit.(I'm only slightly here, shot #2 today, very exciting and happy -- and exhausting :zzz: ) (edited)
quietone Hi
anmolgoyal74 Hi
gaurav mahlawat Hello :wave:
Kunal Kapoor Hi :wave:
Matroskeen Hello, Ivan is here (catching up)

1️⃣ What should we talk about today? Suggest topics here and I will add threads. I will also check for comments on the issue for today's meeting.

marvil07 State of migrate_tools/drush migrate commands as in https://gitlab.com/drupalspoons/migrate_tools/-/issues/118
marvil07 Opinions on #3210257: Improve migrate messages retrieval are welcome.Opened in the context of implementing idlist for mmsg at drush
dinarcon Not necessarily a topic to discuss, but something to point out. Migrate Plus, Migrate Tools, Migrate Source CSV, Migrate Upgrade, and Migrate Source UI issue queues are back on Drupal.org. (edited)
dinarcon It is worth noting that Migrate plus and Migrate tools still have DrupalSpoons projects as there are open PRs there. Some issues only exists there too.
quietone Looking for a review of a blocker, #3193189: Get only translations for localized vocabularies d6/TermLocalizedTranslation.php

2️⃣ Action items. To be added later.

quietone NW: #3190815: Source count caching broken: impossible to enable source count caching for SqlBase-based source plugins (plus, unneeded cache I/O) @quietone
benjifisher Update Drush and Migrate Tools. See the "Next Steps" at https://gitlab.com/drupalspoons/migrate_tools/-/issues/118#note_551989125.
benjifisher Migrating into Layout Builder: we had several suggestions in 1️⃣0️⃣. Can anyone produce a proof of concept?
benjifisher NR, blocker: #3193189: Get only translations for localized vocabularies d6/TermLocalizedTranslation.php. I would volunteer, but I may not get to it this week.
benjifisher NR: #2571235: [regression] Roles should depend on objects that are building the granted permissions. @benjifisher

3️⃣ Statistics

benjifisher https://docs.google.com/spreadsheets/d/1o0Rjlc1vnnLP5bM5P-SMMyGzqn7258hi...
benjifisher Fixed since last week's meeting: 1 (not counting the issue for the meeting).
benjifisher RTBC: 2, 1 of which is Major.
benjifisher NR: 31, including 3 Major and 1 that has not been updated in more than three months.
benjifisher I made an effort to deal with the NRs that have been waiting the longest.

4️⃣ How can I help? Comment in this thread if you are looking for ways to help. Give us some idea of what you would like to do: documentation, code review, testing, project management, ...

tonytheferg figure out why statistics won't rollback. :rolling_on_the_floor_laughing:
tonytheferg oh, wait. WAYS TO help... :slightly_smiling_face: (edited)

5️⃣ Drush, Migrate Tools, etc.

benjifisher https://gitlab.com/drupalspoons/migrate_tools/-/issues/118
benjifisher @marvil07, what is the status of that issue?
marvil07 A comparison of migrate_tools and drush migrate commands is now available on the issue at gitlab.Suggested next steps were posted there too.A high level overview would be: we can probably deprecate migrate_tools drush commands after the small different edges are added into drush itself, or extended from within migrate_tools.The first of the changes for drush to bring a migrate_tools only functionality is almost-accepted now, see https://github.com/drush-ops/drush/pull/4728The idea of joining efforts seems to have resonated on drush maintainers.
benjifisher Do you need any help with that PR?
marvil07 At this point I think it is waiting for maintainer review, last round of changes was mainly code style, so it feels pretty close
marvil07 For more things pending to do I guess the closest to a checklist is at https://gitlab.com/drupalspoons/migrate_tools/-/issues/118#note_551989125

6️⃣ [regression] Roles should depend on objects that are building the granted permissions

benjifisher #2571235: [regression] Roles should depend on objects that are building the granted permissions (edited)
benjifisher @alexpott wants to get this issue done before #2953111: Only migrate role permissions that exist on the destination
alison I know it was just last week, but I totally forgot about the migration aspect of this issue... Thank you for bringing it up!
benjifisher I am reviewing the active issue. Only tests left to review, how hard can it be? :wink:
benjifisher That issue makes it so that any time you save a user role with bogus permissions, you will get a deprecation notice. It will turn into an exception in D10. But there is an ... exception ... for migrations: no deprecation notice, ...
benjifisher I think when we return to the postponed issue, we should make it so that migrations log a message when saving bogus permissions. Maybe provide an option (as in the current patch) to delete them instead.Always log, option to delete.
benjifisher Then we have to decide what we will do in D10.

7️⃣ Improve migrate messages retrieval

benjifisher #3210257: Improve migrate messages retrieval
marvil07 I ended up here in the context of drush mmsg --idlist implementation.For now the drush implementation is just skipping non-requested values, but it would be great to have an api to retrieve a set of items' messages, instead of all.
benjifisher E.g. for a source that has two source identifier keys like k1 and k2, where only three id map messages are wanted to be retrieved, the call would be similar to $id_map->getMessagesSubset([ ['k1' => 1, 'k2' => 1], ['k1' => 2, 'k2' => 1] ]).
benjifisher That would be 2 messages, not 3, right?
marvil07 indeed :stuck_out_tongue: feel free to add an extra one on the issue summary. I was trying to use 3 to make it clear that number_of_keys != number_of_requested_source_items
benjifisher One option is to look at the second argument, when it is not empty, and see whether it is an array of arrays. This has the advantage of not changing the API, but it feels hacky to me.In other words, I think you are right to propose a new method.
benjifisher OTOH, I am not sure it is worth the effort. If I dodrush migrate:message my_migration --idlist=1,2,3,4,5,6,7then what is the performance difference betweengetting one message at a timegetting all messages and filteringgetting just the messages for those IDs in a new method?
marvil07 I think it depends on the set of data on the messages  tables.E.g. In the normal case, using sql migrate ID map plugin, and with a messages table of 2k items, retriving and iterating over the set to show only some of them may have visible performance effect.
benjifisher may have visible performance effectNot good enough. If we are going to add to the API, we need to know we are solving a real problem, not a potential one.Adding to the API is not so bad when we have a base class corresponding to the interface. That is not the case here.
marvil07 I am sure of the performance impact, the may is about not having measured it clearly :sweat_smile: (edited)
benjifisher OTOH, we can add a public method to the class without adding it to the interface.If we do that, then when we use the new function we should either use the class (not the interface) for the type declaration or we should test method_exists() and provide a fallback implementation. I am not sure which is preferred.
marvil07 "getting one message at a time" => n queries + big memory usage if lots of them"getting all messages and filtering" => one query + big memory usage if lots of them (current approach in drush)"getting just the messages for those IDs in a new method?" => one query + a little memory as possible if lots of them
benjifisher Does the first option use more memory than the third?
marvil07 likely similar, n queries would be the difference, but right I would change the first as"getting one message at a time" => n queries + close to as litthel memory usagas possible if lots of messages
benjifisher If there are 10 or even 20 items, I want to know the difference between the first and third option.  I understand that in principle the third option is more efficient, but I want to know how significant the difference is.If this is an edge case and it only saves 3 seconds when there are 20 items, then it is not worth it.
marvil07 the database rountrips are the main difference on the 1st I think, so dependening on that you get an x factor to multiply by the amount of messages requested
benjifisher In real life, with 20 items, is that 0.3s or 3s or 30s?
marvil07 :straight_ruler: measures pending :slightly_smiling_face:Not sure if 20 is a good reference number, consider a drupal to drupal migration of a normal site, and nodes may be in hundreds and each of those can produce multiple messages.Not sure how to get the "usual number of nodes in a drupal site" statistic :sweat_smile:
benjifisher But we are talking about --idlist=... on the command line. Why is the total number of nodes relevant?
marvil07 Right, I was wrongly thinking on the 2nd case.Indeed, the improvement would be noticiable if the idlist is large.The change is in the spirit of "let us retrieve messages more naturally with an included filter" instead of workign around it. :bulb:

8️⃣ The issue queues for Migrate Plus, Migrate Tools, Migrate Source CSV, Migrate Upgrade, and Migrate Source UI are back on Drupal.org.

benjifisher By popular demand. Thanks, @heddn! Cc @damienmckenna
benjifisher There are still some open MRs on DrupalSpoons. Can we get those wrapped up? For example, there are 5 open MRs here: https://gitlab.com/drupalspoons/migrate_tools/-/merge_requests
marvil07 Thanks so much for this! :thankful:It will help a lot to make contributions to those project more visible on the drupal.org credit system.
benjifisher It is also easier to move an issue from core to one of these modules or vice versa.
benjifisher There are 11 open MRs here: https://gitlab.com/drupalspoons/migrate_plus/-/merge_requests
dinarcon Some PRs might come from patches in Drupal.org, but there are some that were only created in DrupalSpoons indeed
marvil07 Right, I think I have added some MRs there that do not have an equivalend d.o issue in the last months.
heddn I tried to merge as many of them as were ready
heddn but some have feedback that needs addressed
quietone @heddn, thanks for moving the projects back. I recall you saying you liked some of the functionality that drupalspoons has.
Matroskeen On that note, I’d like to propose the following change to Migrate Plus, that I wanted to add to Drupal core :rainbow-sheep:#3195568: [PP-1] Support recursive discovery for migration plugins#comment-14070112 (edited)

9️⃣ Add a migration source plugin for JSON:API

benjifisher #3150949: Add a migration source plugin for JSON:API
benjifisher This is marked NR, but I think it is really NW. We have to decide whether using a new library will help significantly or if we can handle pagination  and such ourselves.

1️⃣0️⃣ Migrating into Layout Builder

benjifisher @chrisfromredfin gave a session at DrupalCon, and has sample code here (now with GPL): https://github.com/chrisfromredfin/dcon21-milb
benjifisher Session page: https://events.drupal.org/northamerica2021/sessions/migrating-layout-bui...
benjifisher I think we could add a process plugin based on that code.There is an issue to add a destination plugin for LB, but I think that a process plugin is what we really want.
marvil07 One alternative path could be to create a destination plugin for Section and SectionComponent, since they are not entities.With that I think that it may be possible to do the rest via normal yaml migrations.
marvil07 e.g. block content creation could be just another migration
benjifisher What sort of source are you thinking of? Beware the 1-to-many problem.Any reason not to start with the process plugin?
marvil07 the use case he presented, i.e. content in html into one section at layout builder.Going with the destination feels more natural, and also tries to avoid the 1 source to N destination problem at the cost of more migration YAMLs
benjifisher Even if you have a destination plugin for Section and SectionComponent, you still need a process plugin for the Layout field, right?
marvil07 could it be constructed as in the paragraphs case?
benjifisher Please explain what you mean.
marvil07 The output at https://github.com/chrisfromredfin/dcon21-milb/blob/main/web/modules/cus... may be build manually, to produce the expected https://github.com/chrisfromredfin/dcon21-milb/blob/665e8f546f5f99a13253...…]36
benjifisher So you think we do not need a process plugin, justprocess: layout_builder__layout: - plugin: get ...Or maybe callback plugin with callable: [Section:class, 'fromArray'] ?
marvil07 something similar to that, I have not implemented one yet :sweat_smile:  but sounds highly similar to the paragraphs case, where the right array can be build as passed to the entity reference revisions field with the paragraph
benjifisher Like['target_id' => 123, 'target_revision_id' => 456]
benjifisher We need a proof of concept.
Matroskeen I’ll thrown in my two cents, because I was doing migration to Layout Builder recently.I decided to make it as destination plugin because of the following reasons:In my case, content blocks were created in a bunch of other migrations, so I had to go over those block migrations, do the lookup and attach blocks as layout builder components; I’m not sure if I could achieve this by using process plugin;I also wanted to have a rollback just for the layout builder sections;Is it possible that might have two plugins?process plugin for simple cases (i.e. migrating body content as layout builder component).destination plugin for more complex cases?But, even with the simple approach, we need to created content_block first.It means, the first migration should be:node -> content_blockAnd then another one would be:node -> layout builder sections

1️⃣1️⃣ Source count caching broken: ...

benjifisher #3190815: Source count caching broken: impossible to enable source count caching for SqlBase-based source plugins (plus, unneeded cache I/O)
benjifisher This needs an update after my review in #51, #52.
quietone I've assigned this to myself to work on
benjifisher Thanks! My first priority is 6️⃣, but this issue is close to the top of my list.
benjifisher On second thought, I did this first since it is so much easier. I marked it RTBC, but it would still be good to add an @var comment.

1️⃣2️⃣ Wrap up

benjifisher Thanks for participating! I will update 2️⃣. Please continue to add comments in the threads. In 1-7 days, we will post a transcript for today's meeting.
marvil07 @benjifisher Thanks a lot for facilitating the meeting :thankful:

Participants:

dinarcon, marvil07, alison, quietone, anmolgoyal74, gaurav mahlawat, Kunal Kapoor, Matroskeen, benjifisher, tonytheferg, heddn

Comments

benjifisher created an issue. See original summary.

benjifisher’s picture

Issue summary: View changes

Let's discuss #2953111: Only migrate role permissions that exist on the destination at this meeting.

In Comment #67 on that issue, @alexpott says,

[What] We need is something that will run once a complete set of migrations is finished. What I think would work best is if there was some role cleanup migration that always depends on all the existing migrations - this step will remove any permissions which doesn't exist at this point. So I think we leave the existing role migration as it is but somehow introduce another migration whose sole purpose is to fix the permissions and run after all other migrations have finished.

However I don't think we can do this until we've landed #2571235: [regression] Roles should depend on objects that are building the granted permissions - since that'll mean all this step will need to do is to re-save the role without the migrating flag. While is #2571235 is outstanding and we're dealing with D6 and D7 data I think attempts to make this stricter are likely to run into hard to predict edge cases. If you look at user_role_change_permissions() works and \Drupal\user\Form\UserPermissionsForm::submitForm() it's like the system is designed to work with permissions that are not declared to the system.

benjifisher’s picture

Migrating into Layout Builder: there is some code we could use as a starting point for a process plugin at https://github.com/chrisfromredfin/dcon21-milb. At my request, Chris added GPL to the repository.

quietone credited dinarcon.

quietone credited heddn.

quietone credited marvil07.

quietone’s picture

Issue summary: View changes

quietone’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.