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.
| benjifisher |
#2579361: Row->setSourceProperty() docs are misleading |
| benjifisher |
This is a documentation issue. The doc block is what will show up on api.drupal.org (a.d.o). Here is the current proposal: * The migration iterates over rows returned by the source plugin. This * method determines the next row which will be processed and imported into * the system. A row will be processed if it has not already been imported, or * the row needs an update, or it is above the highwater mark or the source * row has changed. A row is considered changed only if track_changes is set * on the source plugin and the source values for the row have changed since * the last import. When set to be processed the row is also marked frozen and * no further changes to the row source properties are allowed. * * The method tracks the source and destination IDs using the ID map plugin. |
| damienmckenna |
OMG, that explains so many problems I've ran into :exploding_head: |
| benjifisher |
I propose this: * The migration iterates over rows returned by the source plugin. This * method determines the next row that will be processed and imported into * the system. A row will be processed in any of these cases: * - the row has not already been imported * - the row needs an update * - the row is above the highwater mark * - the source row has changed * A row is considered changed only if track_changes is set * on the source plugin and the source values for the row have changed since * the last import. When set to be processed, the row is also marked frozen and * no further changes to the row source properties are allowed. * * The method tracks the source and destination IDs using the ID map plugin.Set off the cases as a bulleted list.Change "which" to "that".Add a comma.I did not re-wrap the text at the end. |
| benjifisher |
Context: this is the doc block for the SourcePluginBase::next() method. I think. Then Row::setSourceProperty() gets an @see reference to that, which shows up as a link on a.d.o. |
| benjifisher |
I added my proposal as a comment and set the issue to NW. |
| benjifisher |
#3189876: Add documentation for file source plugins |
| Matroskeen |
It turns out writing documentation is helpful, because it reveals some interesting things.It was found out that source_base_path constant is kind of “required”, because the d7_file plugin uses it, but I noticed many people are ignoring it in custom migrations. I posted a link to random blogpost, but I seen already several migrations with another strategy.Also, in my custom migrations I was using it differently. (edited) |
| Matroskeen |
I was going to revisit it again, but perhaps someone else can step in and clarify the usage of this constant? |
| benjifisher |
To the point about documentation: Jen Hodgdon maintains the user guide, and that leads her to notice various UX fails that need to be fixed. |
| benjifisher |
source_base_path is supposed to be the root of your source site, eitherthe file path to a local copythe URL to some other copy or the live site |
| benjifisher |
Then the base path, site/default/files by default, is added to source_base_path. |
| Matroskeen |
In my first custom migration, I put files into sites/default/files/migrate of my destination site.In this case source_base_path didn’t make a lot of sense :man-shrugging: (edited) |
| benjifisher |
This means that, for a local copy of the files, you are required to make a subdirectory like sites/default/files/ , which I find annoying. That is why we have #3159217: Be more flexible in where files are staged for migration |
| benjifisher |
x-post |
| Matroskeen |
It’s helpful, thanks.Just one more thing, do you know cases when this is possible?https://git.drupalcode.org/project/drupal/-/blob/9.2.x/core/modules/file... mean, the absolute path after replacing the schema. (edited) |
| benjifisher |
Sorry, I do not know. It does seem overly complicated, doesn't it? |
| Matroskeen |
It looks complicated and not obvious. That’s why I’m trying to bring enough information to document it properly. |
| quietone |
The source plugin test \Drupal\Tests\file\Kernel\Plugin\migrate\source\d7\FileTest has an example of an absolute path. The private path is '/home/lillian/subdomains/u2/u2-private-files', which means the source_base_path is '/'. |
Comments
Comment #7
quietone commentedComment #8
quietone commentedComment #9
benjifisher