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.
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.
| benjifisher |
#2953111: Only migrate role permissions that exist on the destination |
| benjifisher |
We discussed this issue during the 2022-07-14 meeting: https://drupal.slack.com/archives/C226VLXBP/p1657807796502079. We added to that thread earlier today, but let's continue the discussion here. |
| quietone |
can you clarify which post-update function is being referred to in "The post-update function will not run." |
| benjifisher |
It is the one that removes invalid permissions. We added it in #2571235: [regression] Roles should depend on objects that are building the granted permissions, and I think it lives in the User module. I think you borrowed some code from that issue in this one (but maybe not the current patch). |
| benjifisher |
user_post_update_update_roles() |
| benjifisher |
Do not look for it in the 10.0.x branch. It has been removed. |
| quietone |
What is the nature of the :boom: in this scenario (from the other thread)
I guess the most realistic scenario is
- Install Drupal 9.3+. The post-update function will not run.
- Migrate users and roles from your D6/D7 site.
- There will be deprecation notices. They are hard to find. Maybe only the upgrade_status module exposes them.
- Upgrade to D10. :boom:
(I am off to get caffeine) |
| benjifisher |
I am assuming that Step 2 created some invalid permissions. That is why there are deprecation messages in Step 3. Once you upgrade to D10, those deprecation messages turn into uncaught exceptions, any time you try to save a role that has invalid permissions. :boom: means WSOD in this context. |
| benjifisher |
@alison: You commented on this issue too, a long time ago. |
| alison |
I did! But it wasn't in the context of migrations, I was having general issues with permissions and dependencies. I'm not in a position to jump back in, I'm afraid, but I have continued to follow the progress of this issue. |
| benjifisher |
It seems to me that when we decided, in #2571235, to trigger deprecation messages in D9 and throw an exception in D10, we set an expectation that the old way of doing things (migrating permissions before enabling the modules that provide them) would continue to work in D9.
If I cannot convince @alexpott of that, then we should take his suggestion and remove the special flag that lets migrations create invalid permissions. This is when we get around to providing a patch for 9.5. |
| benjifisher |
Or maybe someone will explain to me why I am wrong. |
| alison |
That's the dream. |
| alison |
Wait... |
| alison |
(jk) (don't mind me, just jumping in in an unhelpful way) |
| benjifisher |
In other words, Alex Pott suggests that we make the patch for 9.5 just like the one for 10.0. |
| benjifisher |
@alison: I understand: convincing me that I am wrong is a dream. Dream on! :wink: |
| quietone |
Wheather it is 9.5 and/or 10 we still need to add an update function to clean up any rouge permissions. Right? |
| benjifisher |
Yes, I think so.Also, we need a patch for 9.5 either way. |
| benjifisher |
This is what I asked near the top of the July meeting:
This issue changes behavior, with no option for keeping the old behavior. That is appropriate for D10, where you get a WSOD instead of deprecation messages if you try to save a role with invalid permissions.What about Drupal 9.5? Should wemake it just like D10provide an option to keep the old behavior
Alex Pott recommends the "just like D10" option. |
| quietone |
Right now, I disagree with doing this in 9.5 but alexpott has more experience. |
| quietone |
I'll add it to my list to add the update function, D10 first. Then make a n 9.5 patch. |
| benjifisher |
It is too bad that you, alexpott, and I are in such different timezones. Near-synchronous discussions between the three of us are hard. |
| benjifisher |
#3009349: Revert migrate_drupal source annotations to attributes conversion |
| quietone |
We have advertised that migration yml can add source_module so a source plugin can be used in migrate drupal land. This patch removes that and makes it necessary to have two versions of a source plugin, one for migrate and one for migrate_drupal. I do not like that. |
| quietone |
Instead, can we change \Drupal\migrate\Plugin\migrate\source\SourcePluginBase::getSourceModule to just check the configuration of the source plugin and move the all the checking for source_module to migrate drupal. |
| benjifisher |
I have not looked at the patch, but from your description, I do not like it, either. |
| benjifisher |
Your suggestion looks reasonable. |
| benjifisher |
I am taking a look now. |
| danflanagan8 |
I don’t like the drupal_embedded_data either, but I think I added it because of what we’re seeing in the failed tests on #33 |
| danflanagan8 |
Looks like I added drupal_embedded_data in comment #15. Maybe that’s helpful? |
| benjifisher |
Is it enough if I look at just the most recent patch? |
| benjifisher |
From the CR:
Before
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase::getSourceModule
After
\Drupal\migrate\Plugin\migrate_drupal\source\SourcePluginBase::getSourceModule
|
| benjifisher |
Shouldn't the last line be \Drupal\migrate_drupal\Plugin\migrate\source\SourcePluginBase::getSourceModule |
| quietone |
The lasted patch shows failures because the test can't find the source_module on the migration yaml in the block_content migrations which use embedded_data. |
| quietone |
That can be fixed by my proposal to allow Migrate to check for source_module in only the configuration in \Drupal\migrate\Plugin\migrate\source\SourcePluginBase::getSourceModule. |
| quietone |
That allows the source plugins in migrate land to work in migrate drupal land. |
| benjifisher |
So you want to keep getSourceModule() in the Migrate module, and the current patch moves it to Migrate Drupal (in a trait), right? |
| benjifisher |
That seems like a compromise. The goal of the issue is to remove from Migrate anything specific to Drupal sources. |
| benjifisher |
Do we really have a public class variable in the current code? And are we removing it directly (not deprecating) in the current patch?
+++ b/core/modules/migrate/src/Annotation/MigrateSource.php
@@ -40,19 +40,6 @@ class MigrateSource extends Plugin implements MultipleProviderAnnotationInterfac
...
- public $source_module;
|
| benjifisher |
I have not looked at annotation plugins much until now. |
Comments
Comment #5
quietone commentedComment #6
benjifisherI checked that the threads had the correct number of comments, and I reviewed the issue credits.
I fixed the formatting of the last entry in Thread #8: the
<code>block was messed up, and two comments were squashed.I am removing credit for @mikelutz (or at least, I am trying to remove it) since his only comment was in Thread #0.
Since I made those changes, I am leaving the issue at NR.
Comment #7
quietone commented@benjifisher, thanks for fixing the format, I confirmed that it is correct now. It is easy to miss those things. The credit has been adjusted too.
I am closing as Fixed.