Closed (fixed)
Project:
Drupal core
Version:
8.7.x-dev
Component:
migration system
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
10 Oct 2015 at 23:36 UTC
Updated:
3 Jan 2019 at 18:04 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jhodgdonComment #3
quietone commentedHow's this?
Comment #4
jhodgdonI think this is probably OK, though not being an expert in migrate or migrate tests, I am not setting this to RTBC. From what I can tell though, the migration looks like it is probably mostly correct.
A few concerns:
- The transform to Boolean method -- it is only getting value FALSE if the value in the array is exactly === 0. I do not know that I would rely on that -- I don't think the Search module in D7 is quite that strict -- I think in D7 the search module gets the value of search_active_modules variable and just evaluates the array value to be either TRUE or FALSE using normal PHP evaluation, rather than checking === 0. So probably the migration should use the same logic?
- There may be contrib search modules that are part of search_active_modules. Are you planning to allow for those to be migrated, or does the contrib module have to take care of that?
- A few minor docs questions/suggestions/issues:
boolean => Boolean
Also I think I would say "search page status" not "search status".
This class is missing documentation.
I would document this as "Whether or not this module is enabled for search"
Comment #5
quietone commentedjhodgdon, thx for the review. Items 1-3 fixed.
Comment #6
jhodgdonI don't really see where most of my concerns in the previous comment were addressed in the patch... and I'm not convinced all the changes in the interdiff are actually in the new patch file.
Comment #7
quietone commentedOh, that was an oversight.
- The transform process -- That was based that on what is actually stored in the database and looking at the code in D7. But I see your point and have changed it.
- contrib search modules that are part of search_active_modules - Migrate is only responsible for migrating core modules, not contrib.
- A few minor docs questions/suggestions/issues - That's odd. I see the fixes in the patch. Not sure what to do about this one.
Comment #8
jhodgdonI took a careful look at the latest patch (didn't check the interdiff). There are still some issues:
This class still has no documentation. It has annotation, not documentation.
Oh, I just noticed this.
This is the right way to transform 'node' module to the default 'node_search' page config that the Node module provides in its config/install, and 'user' module to 'user_search', but it is NOT necessarily the correct thing to do for contrib modules.
Probably what you need to do is:
a) If it's 'node' or 'user', transform to node_search or user_search.
b) If it's anything else, do not migrate it. Let the contrib module migrate its own search page status.
It is quite likely that this will return NULL because the plugin ID may not actually exist.
I mean, you're OK for node and user because they're in core, but if a site used a contrib search module you may not be OK.
I am unable to review this method, because I have no idea what it is supposed to do, so I have no idea if it is correct?
This whole class seems really silly to me.
This transformer is just "if the property evaluates to TRUE it's TRUE, and if FALSE it's FALSE". ... You go to all this trouble to transform it using a class, when you could just put $status directly into the if() statement in SearchPageStatus::import() instead.
I don't get it?
Extra blank line at the top of this doc block.
Again, unable to review this getIds() method because I don't really know what it should be doing?
Probably you also need the 'user' module?
Test => Tests
No doc block?
no doc block?
No doc block?
Comment #9
quietone commented1. Fixed. The original comment referenced the source plugin not the destination plugin.
2-3. Solved by only selecting 'node' and 'user' from the variable in the source plugin.
4. It is just the schema for the column in the map table.
5. Removed the class.
6. Fixed.
7. It is just the schema for the column in the map table.
8. Several modules, including 'user' are installed by a parent, MigrateDrupalTestBase.
9. Fixed and changed the comment.
10-12. I've not had to add some of these doc blocks before. Can you refer me to the suitable page in the standards?
Thanks again.
Comment #10
jhodgdonRegarding doc blocks... See
https://www.drupal.org/node/1354
I guess we don't have a specific section about documenting member variables or member constants, but you can look at other classes in Drupal Core for examples. One that has both constants and member variables is in
core/lib/Drupal/Core/StringTranslation/PluralTranslatableMarkup.php
So, this patch is looking better! A few more things to address:
I think I would add something to this documentation block saying that this is only usable for the core Node and User search pages, not for contrib modules.
I realize it's only being called with those inputs, but that's off in some other class.
That @var comment belongs maybe one row down?
Also I think that I would add an in-code comment noting that this will only be certain to work for the core User and Node search page plugins, whose IDs happen to match this pattern.
Either that or at least add some more if() statements etc. to check if $search_page actually exists after trying to load it.
Nitpick: There should be a blank line between these two methods.
I thought you were getting rid of this class? Also I think there is a test for it lower down in the patch, which would also need to go away.
Why is this condition using an array and IN? It should just be using a string an = I think, for efficiency?
Either use @inheritdoc or document the variable. Not both.
Tests => Tests migrating
Comment #11
quietone commented1. Comment added.
2. Moved the comment one line down. But have not address the second point re adding a comment or if statements.
3. Fixed.
4. Oops, removed properly now.
5. Fixed.
6. Fixed.
7. Fixed.
Also, needs tests for the destination plugin.
Comment #12
quietone commentedComment #15
jhodgdonThanks! Looking better.
This documentation doesn't make sense to me.
My suggestion would be:
This plugin only works for the search page status of the core User and Node module plugins.
Just a reminder of my earlier review of this section:
a) Move the @var down one line.
b) Verify that $search_page was not NULL after the load.
c) Put in a code comment noting that this method of saying $id is equal to the module with _search appended is probably only valid for the search page plugins from core Node and User modules.
Note: I'm taking a vacation and will be away from Drupal-land for the next 3 weeks after today. Sorry for the inconvenience... I won't be reviewing patches on this issue again after today for a while.
Comment #16
quietone commentedFinally had the time to address the remaining issues and I think I have done that.
Also, I've since noticed that tests for the majority of destination plugins haven't been done. And while this is a gap it hasn't been preventing commits. I spoke to phenaproxima about this in general and he agreed is a gap, and pointed out that there are more important destination plugins that need tests. I've removed the 'needs tests' tag based on that.
Comment #17
quietone commentedForgot the patch. Here it is.
Comment #18
jhodgdonLooking good! I'm back from my trip...
We're down to coding standards nitpicks now. :)
Coding standards: for in-code comments, use // not /* even for multi-line comments, in the Drupal project.
Again, this @var shoudl go next to the variable it is documenting, not 3 lines up.
Comment #19
quietone commentedHey, thanks for you patience. Took 3 times but I think I've finally moved that @var.
Comment #20
jhodgdonThanks!
Almost! Please check out the comment standards at
https://www.drupal.org/node/1354#inline
- Comments should immediately precede the code they are documenting.
- No empty // lines
Comment #21
quietone commentedAnother installment.
Thanks for the link. It is still early days for me getting to know the standards and finding what I want in all that information. Theres a lot there, which is good. But, for example I can't find any thing that refers to empty comment lines.
Comment #22
jhodgdonYeah, we may not have written down a "no empty comment lines" standard, but if you look in Core, you won't see any. ;) It's pretty hard to have all of the conventions written down.
Anyway, this is looking good! It has tests, and is definitely doing the right thing regarding migrating D7 variables to D8 for Search module & associated Core modules.
Comment #23
quietone commentedWoohoo!
And definitely thank you to documenters. I wouldn't be able to do what I do without your work.
Comment #25
quietone commented'CI job missing'?
Comment #26
jhodgdonLet's just set it back to RTBC and see if that clears up.
Comment #27
alexpottThis seems to be assuming that the node module is enabled on the target site - it might not be...
Comment #28
quietone commented@alexpott, oh, didn't know that.
Added PrepareRow to the source plugin to get the status of the module, and added that value, module_exists, to the source. Then, use skip_on_empty in the process to skip if the module is not installed. Will that do?
Comment #29
quietone commentedComment #30
jhodgdonHm. I think this is right... but the tests are a bit strange now.
core/modules/search/tests/src/Unit/Plugin/migrate/source/d7/SearchPageStatusTest.php
This unit test I think verifies what the Source plugin does: that it correctly checks to see if the modules are turned on, and correctly checks to see if the D7 search_active_modules variable indicates the search page should be on or off.
core/modules/search/src/Tests/Migrate/d7/MigrateSearchPageStatusTest.php
This test is the same as it was before: it turns on both node/user modules, and it verifies that if the D7 search_active_modules variable says node search should be on and user search should be off, that the D8 plugin status ends up correct.
But we don't have a test that verifies that if the D7 search_active_modules variable said ON but the Node module is not installed, the plugin doesn't get turned on. It seems like we should?
Comment #31
quietone commentedOK, lets add a test for the situation when the node module is not installed. Some testing on D8 shows that when node is uninstalled search_page.node_search is deleted not disabled. The attached patch does the deletion and adds a new test.
Comment #32
jhodgdonLooks great! One very minor nitpick:
There seems to be some extra space on this line.
I think the rest is ready to go. Great work!
Comment #33
quietone commentedArg, I saw that and forgot to fix it. NetBeans does that and I've not looked into fixing it because I've been wanting to try PhpStorm.
Comment #34
jhodgdonLooks good then, thanks!
Comment #36
jhodgdontestbot glitch
Comment #38
jhodgdonComment #39
alexpottThis looks a bit fragile... what happens if the search page has no equivalent in D8?
Comment #40
jhodgdonThat won't happen. This only runs for modules 'node' and 'user', and the whole class is documented only to work for those.
Comment #41
alexpottI think it can happen. If for some reason node is not enabled on the target site but is on the source site then it is going to try to load it and it won't exist.
Comment #42
jhodgdonOK, let's see what happens in this process... As far as I can tell:
a) \Drupal\search\Plugin\migrate\source\d7\SearchPageStatus::initializeIterator()
==> Sets up node/user search pages for migration, if they are enabled on the source site (which means the modules and the search pages are both active in source site).
b) \Drupal\search\Plugin\migrate\source\d7\SearchPageStatus::prepareRow()
==> Runs a moduleExists check on the source site for node/user modules
c) \Drupal\search\Plugin\migrate\destination\d7\SearchPageStatus::import()
@alexpott is right -- this code is not quite correct.
If module node/user is not installed on the destination site, then the config item wouldn't exist either, SearchPage::load($id) would come up with a NULL, and $search_page->delete() would give you a PHP error. So probably just before $search_page->delete() it should verify that $search_page exists?
Another possibility is that the node/user module could be installed, but the user might have manually deleted the search page object before they ran the migrate. In this case... well I don't know what the standard response for that case would be for Migrate? Either you'd want to tell the person they've messed up the site and their search page config can't be migrated, or you'd want to create a new SearchPage with the default config (assuming that the page was enabled on the source site in the first place).
Anyway, agreed it still needs work.
Comment #43
quietone commentedYes, @alexpott is correct. And the testModuleExists method didn't update the search config entries so it wasn't caught. This will fix both problems. Search data is only migrated if the module is installed on both the source and destination sites. This makes it work the same as other migrations where data is migrated only if the module is installed on both sites. But, of course, in this case it is if both modules are installed. https://www.drupal.org/node/2350603.
Developing a 'standard response' to the various migrate scenarios is a work in progress. #2569771: [meta] Highlighting of source modules with no upgrade paths.
Comment #44
quietone commentedComment #45
jhodgdonOK... Reviewing the interdiff:
Oops. Copy/paste...
BlockedIP => SearchPageStatus
Nitpick: All of these @param docs lines need one more space of indentation (the docs lines following @param lines that is).
Again, I think here you also need to check that $search_page is not NULL. Just because the node/user module exists does not mean that the search page plugin that the module installed by default still exists. Admins can delete search pages.
[And do we also need to verify that the Search module exists? You can't even create search plugins if not. Oh, yeah, duh, this migrate plugin is under the search module, so I guess it will only exist if Search is installed. OK, don't worry about that. :)]
So I think what needs to be done here is something like:
Then you can proceed to enable/disable this page. Although probably there isn't much point in creating the search page if you're just going to disable it, so I guess maybe it would be better to do this:
Right?
Comment #46
quietone commentedThere is a another migration, search_page. which expects the searchpage to exist for writing the configuration values. Seems this work should merge with that.
Comment #47
jhodgdonOK, fair enough.
Comment #48
quietone commentedNew version which handles the search page configuration and status. This required changes to the migration of the d6 search rankings. Note that the creation of a search page, if needed, is handled by EntityConfigBase and the search status is handled by EntitySearchPage.
Schemas are added for the source plugins, is this the correct way to do that?
Well, lets see what the testbot finds.
Comment #50
quietone commentedHmm, those tests pass locally.
Comment #51
quietone commentedcopy/paste error.
Comment #52
jhodgdonI cannot review this patch...
I got hung up on a number of files that I have no idea about, so I can't really review them at all:
Once again....
You really CANNOT assume that SearchPage::load() returned a non-NULL value. You need to check the return value. What happened to the code in previous patches that verified this?????
I stopped reviewing there. What happened to the patch?
Comment #53
quietone commented2. OK. Then please explain what is happening in the parent import method, in EntityConfigBase. This saves to the entity without checking for NULL.
Comment #54
jhodgdonI have no idea about the parent method, but in *this* method, it is trying to load the entity given only the ID, and it is definitely possible that this particular search page doesn't exist.
Comment #55
jhodgdonI think it would be very easy to make a failing test that would crash due to this: just delete, for instance, the UserSearch page before running the migrate.
Comment #56
quietone commentedIs this test not sufficient? It deletes the user search page, then runs the migration and the search_page is successfully created.
Comment #57
jhodgdonI don't know what to tell you. How is this working? If you do a load on an ID that doesn't exist, you get a NULL result. Then if you try to access methods on the null object, how can it possibly not crash? I don't get it.
Comment #58
quietone commentedBecause getEntity, in #53, creates the storage and sets enforceIsNew.
Comment #59
jhodgdonOK. Back to #52 item 2.
This method is calling SearchPage::load(). If the requested search page ID doesn't exist, it definitely returns NULL, or at least that is what the documentation of Entity::load() says, which is what SearchPage::load() is.
If you have a NULL you cannot then call methods on it.
Why is this logic incorrect? #53 is not relevant to the code I am talking about.
Comment #60
quietone commentedComment #63
mitrpaka commented#51 needs re-roll
Comment #64
jofitzRe-roll.
Comment #65
jofitzComment #67
jofitzCorrect parameter types.
Comment #69
jofitzUpdate
$moduleUpgradePathsarray.Comment #70
jofitzComment #72
jofitzSetting back to "Needs review" - appears to have been a test-bot glitch. Now passing all tests.
Comment #73
mikeryanLet's take this obsolete file out, it's leftover from the days when migrations in core were configuration entities.
Also can be removed.
Comment #74
jofitzChanges in response to code review.
Comment #75
mikeryanComment #76
mikeryanNit: "setConfiguraion" (can be fixed on commit).
This looks good to me from a migration standpoint - I'd like someone more conversant with the search module to look it over, though, and give the RTBC if it looks good to them.
Comment #77
quietone commentedAssign to myself for review.
Comment #78
phenaproximaStealing from @quietone for review.
Comment #79
phenaproximaIf possible, I'd rather this used ContainerFactoryPluginInterface to inject this service.
Alternatively, could the source property module_exists be of any use here, rather than bother with the module handler?
Same here -- let's use the entity type manager (injected) to load the search page.
Should be setConfiguration().
Why did this get deleted? Is it just git being weird and mistaking a rename for a delete?
Why doesn't this define a source_provider?
Would it be useful to extend the Variable source plugin instead of sorta-reinventing it here?
Again, can this extend Variable?
Nit: Not indented properly.
If this is an ID, why isn't the status column mentioned in getIds()?
Why is this only happening for node? This definitely needs a comment.
Should be "Tests migration of search page status and settings."
Why would this be necessary? An assertEntity() method should *always* unconditionally assert that the entity exists.
Image style?
The $path parameter isn't documented.
Use assertSame().
Should be isset($expected_config), since this will be FALSE for an empty array, which may well be a valid configuration.
This should be rewritten on top of MigrateSqlSourceTestBase.
Ditto.
Comment #80
jofitz()added.'search', but the search module is not enabled in the D6 fixture so the test fails to run. How could this be fixed?'status'added togetIds().assertEntity()no longer used to check for absent entities, code refactored accordingly.assertIdentical()replaced withassertSame().isset()used as recommended.MigrateSqlSourceTestBase.MigrateSqlSourceTestBase.So just 4. & 10. remaining to address.
Comment #81
phenaproximaMuch better. Thanks, @Jo Fitzgerald! Two small things:
Forgive me if I'm not seeing it, but where is this used? Also, the type hint needs to be an interface, if one exists.
This is kind of a misleading comment. Should be "Constructs a new EntitySearchPage".
Kicking back to NW for #79.4 and #79.10.
Comment #82
jofitz79.4 The same MigrateProcessPlugin is used for migrations from D6 & D7 so d6/SearchConfigurationRankings.php is redundant - it probably should have been deleted as part of #2569245: [D7] Migrate search pages.
79.10 Comment added to clarify why rankings are only added for 'node' (it's because the variables are node_rank_* which are only relevant to node). Also tweaked the code to improve performance.
81.1 Removed redundant
$searchPage.81.2 Corrected comment.
Comment #83
phenaproximaOh, we are very nearly there. I like it. Nice work!
Correct me if I'm wrong, but couldn't we do
$rankings = array_map('unserialize', parent::values())here?Comment #84
jofitzWe couldn't do
$rankings = array_map('unserialize', parent::values()), but$rankings = parent::values();seems to work!Comment #85
phenaproximaGreat!
Comment #87
alexpottCommitted and pushed 0947fae to 8.4.x and 08e8437 to 8.3.x. Thanks!
Coding standards fixed on commit.
Comment #92
xjmUnfortunately, this broke HEAD. According to @tim.plunkett, it's due to conflicts with #2225717: Add config translation support to migrations and implement for Drupal 6 user profile fields which was also committed today. That issue seems way more valuable, so reverted this one.
Thanks!
Comment #93
tim.plunkettThe other issue expanded \Drupal\migrate\Plugin\migrate\destination\EntityConfigBase::__construct() to require
LanguageManagerInterface $language_manager, ConfigFactoryInterface $config_factory, see failures here:https://www.drupal.org/pift-ci-job/596762
Comment #94
jofitzAdded missing dependency injection.
Comment #95
phenaproximaLooks like the constructor is fixed and tests are happy, so...re-RTBC.
Comment #96
alexpottCommitted and pushed 8deb904 to 8.4.x and aa06720 to 8.3.x. Thanks!
Committed to 8.3.x as migrate is experimental.
Fixes on commit. Would have been nice if these had been rolled into #94.
Comment #100
alexpottThis issue cause a test fail due to sorting in PHP7 - array sorts can be non-deterministic. https://www.drupal.org/pift-ci-job/607300
Comment #101
alexpottThe random fail is happening because the order of the ranking configuration is not enforced by the NodeSearch plugin. We should file a separate issue to address this. In an ideal world we could just leverage #2361539: Config export key order is not predictable for sequences, add orderby property to config schema but that's not part of core yet.
Comment #102
jofitz#2361539: Config export key order is not predictable for sequences, add orderby property to config schema is now in so ... @alexpott how can we make use of it?
Comment #104
jofitzRe-rolled before addressing sorting issue.
Comment #106
quietone commentedHopefully, this will fix the tests. This includes code standard fixes.
Comment #108
quietone commentedFix the source_module declarations.
Comment #110
quietone commentedWith the source_module included in the annotation for the d6 source plugin, it is discovered that the search module is not enabled on the source. And that is good for the UI. I am not sure why it doesn't happen when 'source_module' is on the migration. But the better place for it is on the source plugin. So, lets keep it there and enable the search module in the source.
Comment #112
maxocub commentedNeeds reroll.
Comment #113
mohit1604 commentedrerolled :)
Comment #115
heddnComment #116
jofitzRe-rolled #110.
Comment #118
jofitzCorrected the test failure and coding standards errors.
Comment #119
heddnI don't see we need this destination at all. Let's map the data directly to pluginCollection, instead of having the technical debt of a new destination plugin.
Do we need to set the config without the setter then?
We cannot delete things without leaving a BC layer, deprecations and CR.
Does this mean we don't test migrating users as an active search? Seems odd we'd want to drop test coverage.
Comment #120
maxocub commentedI'll check what's left to be done here.
Comment #122
quietone commented119.1 This destination plugin is not new. What is being added here is an import method and a test in the updateEntity method. However, can you explain more what you would like to see here?
119.2 Do you mean for the user search? There isn't any configuration to load, there is nothing in the source.
119.3 Added deprecation of the d6 process plugin.
119.4 Yes, I suppose it does mean that we don't test migrating users as an active search. But technically, that isn't a loss of a test as these are new tests. That change has been around since the first patch and it is very possible I did that to test that both an active and an inactive search were migrated correctly.
Comment #123
maxocub commentedComment #124
heddnAssigning to myself for a re-review.
Comment #125
heddnStill needs a CR.
This entire import seems un-necessary. Parent should be able to load the previous, no?
Should we move the search migration ymls and split them into user and node module so we can use use normal requirements checks and not have this down in the destination plugin? Hmm, no. I don't think we can, because then the destination plugin might be missing and that would cause a fatal. And we don't want to check the destination from the source, so perhaps this is the best way to handle this. Could use some comments though, why.
Do a check if instance of ConfigurableSearchPluginBase instead?
This should be do-able without this php code. Normal process mapping should suffice, no?
On d6, do we always have node? Maybe a comment why/what we are doing here.
Why \ArrayIterator here but not in D6?
I don't think we need both of these values for the id, do we? Just the module seems enough.
Comment #126
heddnComment #127
quietone commented1. TODO
2. TODO
3. TODO
4. I recall ages ago trying that and it did not work and reluctantly made the destination plugin.
5. Yes, node is listed in the required modules in the UI and can't be uninstalled.
6. The d7 version needs to override Variable::initializeIterator() because values is already a index array with two elements and needs to avoid have that made a sub-array of index 0
7. Fixed
Comment #129
quietone commentedAh, I need to install php7.2. Now try that again.
Comment #130
quietone commentedAnother increment.
125.2. Comment added
125.3 Fixed
125.5 Comment added
Also fixed a typo and added 2 missing commas.
TODO
125.1
125.4
Change Record
Comment #131
quietone commented125.1. I'm not following this.
125.4 One would think it would but it doesn't seem so. The migration yml do set the status to true or false correctly but it doesn't get saved. This test patch removes that mentioned block of code from the destination plugin.
Comment #132
heddn125.1 you can safely ignore. I was ignoring the destination module check in there. c.f:
if ($this->moduleHandler->moduleExists($row->getDestinationProperty('module'))) {If this comes back green, then I think we can safely RTBC this thing.
Comment #134
quietone commentedOK.
Yes, I knew the test patch will fail. Setting the status in the process pipeline never worked here, it needs to be done after the search page is saved. Why? Sadly, I don't remember and I can't find it in the issue here either on online searches. How else can the search be enabled or disabled?
The failure is on this line where the user_search should be disabled.
$this->assertEntity('user_search', 'user');But, I did notice that the assertion has the expected/actual values swapped. This patch fixes that based on the working patch in #130.
Comment #135
quietone commentedStarted the CR. What needs to be said there?
Comment #136
heddnI don't think we want to remove this? It just got committed.
This should go into a CR and be linked to here.
Comment #137
quietone commented135.1 Ah, I had cruft around from another patch. Here is a new patch using the patch in #130 as a start. It includes the swapping around of the parameters in the assertion (see interdiff-130-134.txt). This includes updating the @deprecated and @trigger_error in d6/SearchConfigurationRankings to confirm to the deprecation policy for plugins.
135.2 Thx, updated CR.
Comment #138
quietone commentedChange record created.
Comment #139
heddnDoing all that extra work in the import method was bugging me. I tracked it down and here's an updated patch. That was the only blocker from me for RTBC.
Comment #140
phenaproximaSo technically, this is a backwards compatibility break because we are changing a plugin ID ('search_page' to 'd6_search_page'). We might need to add an alter hook which aliases search_page to d6_search_page.
Seems to me like _anything_ except 'node', and 'user' should be false, no?
If we return an empty array, will the row be correctly recorded as having been skipped/invalid? Or do we need to throw MigrateSkipRowException instead?
I think instanceof would be clearer here. Also, I'm not a fan of repeated calls to $entity->getPlugin(). Can we just call it one and reuse the return value?
I think "Common" is a weird word to use here. How about "BaseSearchConfigurationRankings" instead?
I think we need a link to the change record.
It's not clear why 'node' is hard-coded.
This is a really ambiguous description. How about "The module providing a search page"?
Not a huge fan of hard-coding this (would rather it was part of the plugin configuration), but we don't have to fix that right now.
Comment #141
heddnre 140.1: this isn't a BC break, because core only supports discovery via migrate_drupal_ui. And contrib uses things like migrate_upgrade or migrate_run, which doen't care about the source name. And if you make changes or depend on changes in the source plugin w/ migrate_upgrade you've grabbed a place in time copy of that yaml. In which case, you have a copy. And any changes to the name of the source plugin still don't matter.
TLDR; changing the name of a source plugin doesn't break BC. Nothing references it.
Comment #142
quietone commented@heddn, Sweet, much better. Glad you tracked that down.
Some of the easier ones.
140.3 - Returning [] or NULL has the same effect where the row is marked as a STATUS_FAILED. So, for now, removed the return. Not sure about throwing a skip row here.
140.4 Fixed
140.5 Fixed
140.6 Fixed
140.8 Fixed. Text changed in both source plugins
149.9 Sounds like a followup
TODO
140.2
140.3
140.7
Comment #143
heddnBack to NW for the todos in 142.
Comment #144
quietone commentedAnd some fixes for the remaining items
140.2 Changed tthe process to default to false
140.3 Changed to throwing a MigrateSkipRowException but that isn't handled the same way as during the process pipeline. So, changed it to a MigrateException, with settings the same as for MigrateSkipRowException.
140.7 Changed the comment for both the d6 and 7d source plugin.
Comment #145
heddnNit: this zero option isn't needed then.
But otherwise, this is ready.
Comment #146
quietone commentedYes, that should not be there.
Comment #147
phenaproximaThanks, @quietone.
Comment #148
gábor hojtsyLooks good. Only found these two, the second one is very minor :)
Is a named migration part of our API surface? If so, we should not be renaming it but add a new one and deprecate the old one.
Not just for node. (In the comment).
Comment #149
gábor hojtsySo looks like #148/1 was raised by @phenaproxima as well.
Comment #150
heddn#1 we discussed back in #141. It isn't part of the API. Do we need to make it more explicit somewhere?
#2 addressed here.
Comment #151
gábor hojtsy@heddn: what you are referring to is the change of the plugin ID, not the change of the migration name. The migration name is used in dependency declaration situations for example, and therefore any migrations that depended on this migration will then have a missing dependency, no?
Comment #152
heddnAll of the dependencies are also built at the same time as the rest of everything. Its like taking template and cloning it. However, mikelutz had a good point in Slack, we now let incremental migrations via the web UI and who knows what would happen for them. So NW and change back to the old name for the d6 migration is probably the easiest path forward.
Comment #153
quietone commentedAdding migrate critical tag
Comment #154
quietone commentedWhat is the next step here? I recall reading on Slack that the search plugin was to be deprecated which is a different solution than that given in #152. If so, I don't know how to do that.
Comment #155
heddnThe next step here is to remove the rename and keep its old name.
Comment #156
quietone commented@heddn, thanks.
This renames d6_search_page.yml back to search_page.yml and changes the id back to 'search_page'.
Comment #157
quietone commentedAs an after thought, should this have a comment in search_page.yml explaining that the name is retained for BC reasons?
Comment #158
heddnWe're good again now.
Comment #159
alexpottCommitted 566dce2 and pushed to 8.7.x. Thanks!
This looks ready now. Third time lucky.
Comment #161
tacituseu commentedThis introduced PostgreSQL failure:
- https://www.drupal.org/pift-ci-job/1147872
- https://www.drupal.org/pift-ci-job/1147909
Comment #162
alexpottSince this has been committed and reverted several times and there's nothing functionally wrong I'd be in favour of opening a follow-up issue and fixing this there.
Comment #163
heddnOpened #3021838: [PostgresSQL] Variable to config: search_active_modules.