Problem/Motivation
As identified in #2859304-101: Show field type migrations correctly in Migrate Drupal UI, point #8, the code currently loops through just the core profiles 'standard' & 'minimal', but this will not work when other profiles are involved.
The question is what should be done about profiles? The UI is module based and does not consider profiles.
In #72 alexpott suggests going back to first principles, using the following questions as a start.
a) What can a profile do? I think the answer is in D7 and D8 is everything a module can. So therefore it is possible for them to provide an upgrade path.
b) How should a profile be listed that has no need of an upgrade path (eg. minimal and standard and probably many others.
c) How should a profile be listed if it has an upgrade path with migrations
d) How should a profile be listed than has an impossible upgrade path like Views be listed.
e) There is also a question that @quietone brings up about what to do when the source profile is different from destination profile since Drupal is already installed at this point.
Summary of responses so far:
a) How would this look in the UI? Are all the modules still listed? Maybe the module name column could include the profile name. Just throwing out ideas.
b) With #2936365: Migrate UI - allow modules to declare the state of their migrations the state could be added to a migrate_drupal.yml file.
c) The UI should correctly show it as will or will not be upgraded.
d) With #2936365: Migrate UI - allow modules to declare the state of their migrations the state could be added to a migrate_drupal.yml file.
e) Some fancy logic to make a decision on the upgrade state? Seems tricky.
Proposed resolution
Don't show any profiles in the UI. This is by far the simplest solution.
Remaining tasks
Review and commit the patch.
User interface changes
If the Migrate Drupal UI was displaying any information about any available install profiles, it will no longer do that.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#70 | interdiff.txt | 2.63 KB | quietone |
#70 | 2918185-70.patch | 3.55 KB | quietone |
#60 | interdiff.txt | 797 bytes | quietone |
#60 | 2918185-60.patch | 2.27 KB | quietone |
#52 | 2918185-50.patch | 2.2 KB | starshaped |
Comments
Comment #2
phenaproximaMinor fix to the IS.
Comment #3
phenaproxima#2859304: Show field type migrations correctly in Migrate Drupal UI landed, so this is now active.
Comment #4
quietone CreditAttribution: quietone as a volunteer commentedA patch has arrived.
Comment #5
phenaproximaNice work, thanks @quietone! I think it needs a test, though :)
Comment #6
quietone CreditAttribution: quietone as a volunteer commentedYep it does. How about this?
Comment #7
phenaproximaWhoa, what? This looks like a remnant from a debugging session.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedOh my! Sorry about that.
Comment #9
heddnI think the test coverage looks good enough. Let's proceed to get this merged. And I confirmed by reviewing the parent issue that we only want this to land on 8.5.x. No cherry-pick.
Comment #10
phenaproximaCan we add additional assertions to prove that Standard and Minimal are also not present?
Even better, we could compile a list of all available profiles and assert that none of them are present.
Comment #11
quietone CreditAttribution: quietone as a volunteer commentedI don't see the advantage of testing for profiles that are not used in the test fixture. And how do we choose which profiles to include? Nonetheless, this patch adds a variable to list the install profiles and loops over that for the assertions. Currently, the list is limited to 'minimal' and 'standard'.
Comment #12
phenaproximaThe idea is that, if we ever introduce a change that causes core profiles to be listed when they shouldn't be, we'll catch it. Future proofing! :)
Interdiff looks good, back to RTBC.
Comment #13
heddnI'm not completely convinced we want to entirely disable profiles from providing an upgrade path. I was confused over in #2914974-74: Migrate UI - handle sources that do not need an upgrade, but what if instead of hiding profiles we just list them as not having an upgrade path? Or for that matter, themes?
Maybe I'm missing something?
Comment #14
quietone CreditAttribution: quietone as a volunteer commentedI do agree that documentation, on d.o and possibly the upgrade page itself, to clarify that install profiles and themes are not upgraded would be helpful. How about a new issue for that and return this to RTBC?
Comment #15
quietone CreditAttribution: quietone as a volunteer commentedNeeded a reroll.
Comment #16
phenaproximaI'll review this.
Comment #17
phenaproximaLooks good, except for one thing:
The doc commment should be expanded a bit to explain what this property is used for (@see lines would be helpful), and it probably does not need to be static or private. A simple protected should do, and $install_profiles should be camelCased. (And of course, any mention of self::$install_profiles should be changed to $this->installProfiles.)
Comment #18
phenaproxima:)
Comment #19
heddnTagging novice since the feedback here seems quite easy to do.
Comment #20
heddnComment #21
heddnComment #22
quietone CreditAttribution: quietone as a volunteer commentedComment #23
quietone CreditAttribution: quietone as a volunteer commentedExpanded comment added as requested in #17. This also needed a reroll and the interdiff is not included because it is larger than this small patch.
Comment #24
quietone CreditAttribution: quietone as a volunteer commentedComment #25
phenaproximaLooks good. Thanks!
Comment #26
larowlanthis looks good, there are some test profiles in core too - should we be checking they're not in the list too?
any reason not to use array_filter here?
nit, we're dealing with strings, let's use ===
Comment #27
phenaproximaI was going to point that out too, but I didn't see any real benefit to switching to array_filter() beyond the fact that it uses a closure. Ah well, it's no big deal either way.
Comment #28
quietone CreditAttribution: quietone as a volunteer commented1. No change due to response in #27
2. Fixed
Comment #29
phenaproximaThanks!
Comment #30
Gábor HojtsyFrom #26:
Comment #31
phenaproximaGood idea. Let's do it. We only need to check for one test profile ("testing" would be a good candidate).
Comment #32
quietone CreditAttribution: quietone as a volunteer commentedI found a list of profiles in core/profiles and added each of those to the the list.
Comment #33
phenaproximaI think we can ditch these. Just checking for 'testing' is enough.
Comment #34
quietone CreditAttribution: quietone as a volunteer commentedOkey dokey.
Comment #35
phenaproximaBring it!
Comment #36
larowlanAdding review credits
Comment #37
larowlanDoesn't apply after #2914974: Migrate UI - handle sources that do not need an upgrade - tagging as needs re-roll
Comment #38
phenaproximaThis oughta do it.
Comment #39
phenaproxima'Tis green. Sending back to RTBC since #38 is just a reroll.
Comment #41
alexpottRather than supplying a static list how about just checking to see if the list contains any profiles? That way we check all the things - even as we add a new profile (ie #2809635: Create experimental installation profile). Also this has the benefit of not just sticking random stuff in test class properties that are only used once.
Comment #42
alexpott@phenaproxima asked for more detail on #41.
For example the test could be:
Comment #43
jofitz CreditAttribution: jofitz at ComputerMinds commentedMade change suggested by @alexpott in #41/#42.
Comment #45
alexpottThe issue title "Allow dynamic discovery of profiles on MigrateUpgradeForm" and the code which is removing profiles don't seem to add up.
I guess we need an
if (isset($system_info[$avaiBLAHable]]) {
Comment #46
quietone CreditAttribution: quietone as a volunteer commentedAdd the isset as per #45.
Comment #47
quietone CreditAttribution: quietone as a volunteer commentedIs this a better title?
Comment #48
phenaproximaOkay, the change looks good and makes sense to me. Let's get this in.
Comment #49
phenaproximaWait a sec -- I just noticed that the patch in #46 has the test coverage, but is missing the actual change which was made in #43. Whoops!
Comment #50
phenaproximaThis can be cherry picked to 8.5.x. :)
Comment #51
phenaproximaOh, and this.
Comment #52
starshapedRerolled patch to include the change made in #43.
Comment #53
phenaproximaThanks, @starshaped! I'm happy with this. RTBC once Drupal CI passes it.
Comment #54
alexpottComment #55
alexpottSo in re-titling this issue to "Don't display install profiles in the Migrate UI" it made me think is there any reason why an install profile wouldn't have an migration. Yes the core one's don't but other profiles do way more. Also don't we have the same problem for modules that don't have anything at all to migrate?
Comment #56
quietone CreditAttribution: quietone as a volunteer commentedModules that do not have anything to migrate, e.g. help, overlay, has been addressed in #2914974: Migrate UI - handle sources that do not need an upgrade. There is now a list of such modules for Drupal 6 and Drupal7 and modules in that list will appear in the 'available' or 'to be upgraded' section of the review page. They are included there and not in a separate list for simplicity. Discussion on that can be found in #25 to #28 of #2914974: Migrate UI - handle sources that do not need an upgrade.
The intention is that other modules can add their modules to that list. That work, along with adding a 3rd category, incomplete, that other module can add to is being done in #2928147: Migrate UI - add 'incomplete' migration status.
I am not familiar enough with install profiles to discuss that, I'll leave that for others.
Comment #57
larowlanYeah, I think @alexpott is correct here, we should be able to use the extension discovery system here to check the path of the profile, and if its in core/profiles, exclude it, that way we don't exclude contrib-profiles.
Thanks!
Comment #58
quietone CreditAttribution: quietone as a volunteer commented@larowlan, thanks for explaining that. I didn't get that is what alexpott meant. I did some reading about extension discovery and I haven't learned how to do this. How does one get the path for the profile?
Comment #59
larowlanIn the interim, you should be able to use
drupal_get_path
because the new extension stuff is 8.6 only.Comment #60
quietone CreditAttribution: quietone as a volunteer commentedThanks. A bit confused by your comment since this issue is against 8.6.x. Nonetheless here is a version using drupal_get_path.
Comment #61
alexpott@quietone thanks for pointing me to #2914974: Migrate UI - handle sources that do not need an upgrade - looking at that my question is now why aren't we just adding standard and minimal to the lists held in
MigrateUpgradeForm::$noUpdatePaths
?Comment #62
quietone CreditAttribution: quietone as a volunteer commentedCan someone answer the question in #61? As I said in #56 I really don't know enough about install profiles to respond.
Nonetheless, I have an opinion. For me, adding an install profile to a list of modules is just wrong and might even cause confusion for some. If we wanted to add install profiles as an upgraded item, just like a module is an upgradeable item, that would require some more discussion in a new issue.
Comment #63
alexpott@quietone yeah install profiles are very icky but actually for the extension system install profiles are just a very special type of module and they can do everything a module can do and more. I agree install profiles represent an interesting challenge for migrate because it's not really possible to change an install profile on a site but putting them in a list of modules is definitely okay. That's exactly what is happening in everyone's
core.extension:module
configuration to install the install profile.Comment #64
quietone CreditAttribution: quietone as a volunteer commented@alexpott, thx. I still disagree with putting an install profile in a list of modules on the Migrate UI but that is fine and that is not what this issue is about.
Looking back I see that this question has not been answered.
I refrained from answering earlier but, oh, why not? Isn't it, in general, better to do this dynamically than have a static list? Might there be a new core profile in the future? And having worked on these UI patches, those lists were tedious to build and test. Anything that can be done to automate it is better.
Comment #65
alexpott@quietone I agree that maintaining the list is pain. For me I'd like to see the entire list go away and some solution that works for core & contrib is implemented - ie. #2932652: Migrate UI - handle extensions that can't be automatically upgraded. I think if we want to fix this quickly here hardcoding the profiles in the list is the way to go. Otherwise we should concentrate our efforts on #2932652: Migrate UI - handle extensions that can't be automatically upgraded and have a generic solution for this problem that is not core specific.
Comment #66
quietone CreditAttribution: quietone as a volunteer commented@alexpott, I think you are saying that handling profiles should be done in some generic way and should be discussed in #2932652: Migrate UI - handle extensions that can't be automatically upgraded. Is that right?
If so, do you prefer to a) keep the existing code
or b) hard code 'standard' and 'minimal' in the noUpgradePath list or c) or use this patch?
Comment #67
alexpott@quietone yep I think all of core's no upgrade path should use whatever is decided in #2932652: Migrate UI - handle extensions that can't be automatically upgraded - both modules and profiles.
But for now we should just maintain 1 list of things that don't have upgrade paths. So for this issue that is option b from #66 because then in #2932652: Migrate UI - handle extensions that can't be automatically upgraded we only have one place where we need to remove things.
Comment #68
quietone CreditAttribution: quietone as a volunteer commented@alexpott thanks for that explanation. I will make a new patch
Comment #69
quietone CreditAttribution: quietone as a volunteer commentedTagging
Comment #70
quietone CreditAttribution: quietone as a volunteer commented@alexpott, I was too quick to respond, I was so focused on working to understand what you meant that I missed the big picture. When an extension is added to noUpgradePaths it is treated as if it really does have a complete set of migrations. Then, if it is enabled on the source site it is included in the list of modules to be upgraded. Thus a core profile will appear in the list of modules to be upgraded.
Nonetheless, I worked up a patch, I don't know if it will pass all tests or not. During testing, 'standard', was still being displayed. I changed the loop to include a check if the extension was a profile that was installed on the destination and 'standard' no longer displays. But that isn't going to work either because it is looking at the profiles on the destination, not the source. If the source db has an install profile of 'minimal' and D8 is installed with standard then 'minimal' will be displayed in the list of modules to be upgraded.
It seems to me that the only way to remove the core install profiles from the display is to remove them from the array $system_data, built from the source db.
Comment #71
heddnSounds like we need more work based on the comment in #70.
Comment #72
alexpottI've got to admit this issue has been confusing me and I might have led it astray - sorry. @quietone wrote in #70
And I looked at the code in HEAD and saw
So we are doing that already Core profiles do not appear in the list atm.
I think we need to go back to first principles and ask:
a) What can a profile do? I think the answer is in D7 and D8 is everything a module can. So therefore it is possible for them to provide an upgrade path.
b) How should a profile be listed that has no need of an upgrade path (eg. minimal and standard and probably many others.
c) How should a profile be listed if it has an upgrade path with migrations
d) How should a profile be listed than has an impossible upgrade path like Views be listed.
e) There is also a question that @quietone brings up about what to do when the source profile is different from destination profile since Drupal is already installed at this point.
Also just thinking out loud - is this really a major task? I think the majority of UI based migrations with be D7 standard to D8 standard and that already works correctly.
Comment #73
quietone CreditAttribution: quietone as a volunteer commentedI agree that returning to first principles is a good idea here. In your points you
a) OK. Is there a list of modules that a profile installs somewhere useful?
b) If a profile installs a bunch of modules then it has an upgrade path. One that 'will be upgraded' if all the modules it installs have a complete set of migrations, otherwise it 'will not be upgraded'. A profile that does not install any modules would not have an upgrade path. I presume profiles can install themes, so what about those? They would not have an upgrade path because of the theme.
c) A good question. To answer that we need to think as someone who wants an easy couple of clicks upgrade. What is most important? I suggest it is a simple, 'will it work and if not, what do I do so I can upgrade'.
d) List such profiles in the will not be upgraded list.
e) Too difficult and too tired to process this case now.
Yes, not major.
Comment #74
quietone CreditAttribution: quietone as a volunteer commentedDoesn't need to be assigned to me.
Need as summary update for the conversation between myself and alexpott in the last few comments.
Comment #77
quietone CreditAttribution: quietone as a volunteer commentedIS updated.
When a site uses a profile how do you determine which modules are provided by the profile?
There is a patch here that, I suggest, is rerolled, once #2936365: Migrate UI - allow modules to declare the state of their migrations, and reviewed with the intention of committing. That way all profiles are not shown in the UI which provides consistency. But the larger questions in the IS still need to be addressed.