Problem/Motivation
This is a followup to #2936365: Migrate UI - allow modules to declare the state of their migrations that is the result of a UX meeting about the Review Page, See2936365-#101.
This is simple and straightforward. How do we all miss it? The Review page should use the human readable module name not the module machine name.
Proposed resolution
Change the Review form to have three columns in each list of modules: 'Drupal 7 module name', 'Drupal 7 machine name', and 'Drupal 8'. Sort by the first column.
The history
The original plan was to use the human readable module name in the UI but in #22 Gábor Hojtsy pointed out that some of the names don't 'match' the module_name, for example, "Views translation" is i18nviews. That will make it harder for people to find the source module. In that comment it was suggested to either
(1) add the project name from the module's info data in parenthesis or as a tooltip
(2) add the machine name of the module in parenthesis or as a tooltip
Option 2 is implemented as per #54. The option with the tooltip is used because the form "i18nviews (Views translation)" was a lot of text on the page and distracting. Unfortunately, there is not a screenshot of that version.
And that changed at DrupalSouth 2019 to adding a third column with the machine name. See #76. The result is three columns, 'Drupal 7 module name', 'Drupal 7 machine name', and 'Drupal 8'.
Remaining tasks
- Add one or more followup(s) for the out of scope changes.
Completed tasks
- Usability review: see #84.
- Remove out of scope changes from the RTBC patch in #105.
User interface changes
Yes, a 'nicer' Review page:
Before
After
Comment | File | Size | Author |
---|---|---|---|
#144 | 3024682-144.patch | 35.21 KB | quietone |
#144 | interdiff-139-144.txt | 696 bytes | quietone |
#139 | 3024682-139-interdiff.txt | 2.61 KB | kim.pepper |
#139 | 3024682-139.patch | 35.21 KB | kim.pepper |
Comments
Comment #2
quietone CreditAttribution: quietone as a volunteer commentedComment #3
Gábor HojtsyI don't know if its straightforward for modules not on the system because unless their human name is provided in some migrate file (additionally to their machine name), we'll not be able to pull the human name from anywhere, unless we also build in an update XML reader in this that tries to pull that project info down to get the human name.
Comment #5
quietone CreditAttribution: quietone as a volunteer commentedAlthough this is postponed I wanted to see if the human readable names were available.
I found that they are in the D6 system data which the Review form already has. This works locally as seen in the screenshot in the IS. Not running tests because they need to be updated to find the human readable module name not the machine name.
Comment #6
quietone CreditAttribution: quietone as a volunteer commentedNo longer postponed and here is a new patch. No interdiff because the ReviewForm has changed too much.
Comment #8
quietone CreditAttribution: quietone as a volunteer commentedReworked to sort the will and will not be upgrade by the module name and not the machine name. And updated all the UI tests but I've probably still have some wrong.
Comment #9
quietone CreditAttribution: quietone as a volunteer commentedAdd large screenshots.
Comment #11
quietone CreditAttribution: quietone as a volunteer commentedSort the module lists in the tests and correct some typos.
Comment #13
quietone CreditAttribution: quietone as a volunteer commentedSome more typos and help is not installed in the D6 test fixture so it is remained from the will be list.
Comment #15
Gábor Hojtsy#2936365: Migrate UI - allow modules to declare the state of their migrations landed, so not anymore postponed.
Comment #16
quietone CreditAttribution: quietone as a volunteer commentedAdjust the sorting in the available and missing lists. Having weird results with the d6 and d7 MultilingualReviewPageTests and the Help module. When the d6 test runs Help is listed in the will not be list, but if I add 'Help' to the list for testing it no longer appears in the will not be list. That makes not sense at all.
Comment #18
quietone CreditAttribution: quietone as a volunteer commentedAh, silly me I forgot there was an extra check in the Multilingual tests using the Help module, which doesn't have any migrations. The test was removing the module machine name, 'help', from the list of available migration whereas now it needs to remove the module name, 'Help".
Comment #19
quietone CreditAttribution: quietone as a volunteer commentedJust cleaning up.
Comment #20
quietone CreditAttribution: quietone as a volunteer commentedChange some variable names to be more meaningful.
Comment #21
quietone CreditAttribution: quietone as a volunteer commentedAll done for now. This is ready for a review.
Comment #22
Gábor HojtsyLooks good to me except:
I really like the human readable names on the UI. However this list shows a possible major weakness of the approach, namely that module machine names like "i18nviews" turn to be "Views translation" on the UI, so there is not necessarily a match. Will users be able to trace down these names to the projects they are in? This is not a standalone module but part of a bigger project.
Two possible ideas to solve this:
(1) add the project name from the module's info data in parenthesis or as a tooltip
(2) add the machine name of the module in parenthesis or as a tooltip
I think in some cases the two will be the same (project and module) or very similar (machine name and module). In other cases though the difference will be crucial to know. Therefore the tooltip idea. I don't know if we have a programatic way to tell if there is a "significant difference".
Comment #23
quietone CreditAttribution: quietone as a volunteer commentedRight now I like option 1 above.
The is also the option of grouping the module names by Package, as is done at /admin/modules. Suggested by webchick in migrate maintainers meeting today. And I like this idea too.
Comment #24
webchickI'm blocked on multiple fronts getting into a D8 environment right now to check it, but I would say that in general, the primary interface through which users learn/know about modules is the Modules page, so as close to what it does as we can get here, the better, most likely.
Comment #25
webchickI thought about this a bit more overnight... The D8 branch of https://www.drupal.org/project/upgrade_status module has about the same problem area it's trying to surface, and has much more recently been designed by an actual designer, and reviewed by the UX team.
It just has the alphabetical list of module names. No package, no machine name in parentheticals, etc.
So maybe we should do the simplest thing that can possibly work here, and use human-readable name, falling back to machine name in case things are not found.
#22 is a valid point, but it's also valid for Upgrade Status and the Modules page as well. So maybe we should file an issue to fix it in core (or not), bring it to the UX team, and apply whatever pattern later, once it lands.
Comment #26
Gábor HojtsyUpgrade Status does actually roll up all modules to a package level, eg. showing d.o project names instead of submodules one by one. It also attempts to do the same for custom module projects where there are submodules. This is because projects are what have d.o destinations, maintainers to work with, etc. You can only update them altogether.
Comment #27
webchickOh, fair point. Let's do that then. :)
Comment #28
quietone CreditAttribution: quietone as a volunteer commented@webchick, Sorry, do exactly what? I am not sure what you are suggesting be done here.
Comment #29
quietone CreditAttribution: quietone as a volunteer commentedIt is not clear to me that the UI is supposed to look like. Are the modules to be grouped by project? I think so, I am just not sure. And, if that is the case, I have tried that to see what it was like and I don't know enough about forms to make it work.
Comment #30
mikelutzI think the point Gabor was making was that upgrade status groups by composer level package, which makes sense for upgrade status, but probably not for migrate, so lets go ahead and implement #22 - 1
Comment #31
quietone CreditAttribution: quietone as a volunteer commentedI haven't run all the tests locally but let's try this. The interdiff fails so just a diff this time.
And there is a new screenshot in the IS but it doesn't show the text on hover. That doesn't work for me.
Comment #33
quietone CreditAttribution: quietone as a volunteer commentedThis should fix the test and then we have #22-1 implemented.
Comment #34
quietone CreditAttribution: quietone as a volunteer commentedOh foo, I wasn't working from HEAD. And it needed a reroll.
Comment #35
mikelutzLooking good. Setting to NW for one super nit, sorry!
Often we will provide a BC layer for constructor changes, despite it not being required per BC policy. I don't think it's necessary here, as I don't see anyone having a reason to extend this form class.
super nit: extra space added before the comma
Comment #36
quietone CreditAttribution: quietone as a volunteer commentedthanks mikelutz
1. agree
2. fixed. Plus removed an unused variable.
Comment #37
mikelutzLooks good to me. Thanks!
Comment #38
webchickCould we get a screenshot please? :D
Comment #39
quietone CreditAttribution: quietone as a volunteer commentedA new screenshot is now in the IS, but none of the screenshot tools I used would show the text displayed when hovering on a source module name. So I took a photo with my phone, hope that helps.
Comment #40
quietone CreditAttribution: quietone as a volunteer commentedAdd some detail to the IS
Comment #41
webchickI'm really sorry, this keeps totally dropping off my radar for some reason... And wow, award for biggest effort that had to go into a screenshot goes to...! :)
I want pull this back a little. Here's the modules page:
Here's the core Update Manager:
Here's the Upgrade Status module (D8 version; shown because it has had much more recent design love):
Notice that in each case, the site operator is shown the human-readable version of the module's name. The only exception is that if you expand a details element on the Modules page, in tiny, tiny font, you can also see the machine name there, too.
In none of these examples are we making machine name the primary identifier, and also in none of those does a tooltip appear on hover to reveal more information. (Actually, the URLs will appear at the bottom of your browser when hovering over links in Update/Upgrade Status, so maybe that's not quite true.)
In each instance, one could argue that it can be helpful to find the module's machine name, but yet in each instance we do not show it, or at least certainly not obviously show it.
We can argue that this is not useful, and that we should adopt a nomenclature instead of "Module name [machine_name]" or a tooltip on hover that exposes the machine name or something else, and use that pattern everywhere, but we currently do not use that pattern, and I don't believe we should start a new one in this issue. (Happy to discuss in a follow-up, though.)
So, I'd really prefer for us to go back to the original request, which was extremely simple, and literally just using the module's human-readable names wherever possible. (Obviously this won't work for custom modules and the like which would fall back to machine_name)
If I'm missing something obvious—which is QUITE possible, since as I stated before, this issue unfortunately keeps dropping off my radar—I'm happy to discuss it.
Comment #42
webchickOopsie. Missed a spot.
Comment #43
webchick"Needs review" for discussion.
Comment #44
quietone CreditAttribution: quietone as a volunteer commentedThanks for the feedback, webchick. All good points.
My two cents is that I have a preference for human readable name. And I'd like to use the existing page but be able to group the submodules with the modules. That way, if they see that, say, Internationalization is not going to upgrade they can expand that section and see what sub module will and will not be upgraded and make an informed decision. That would also mean that there would not be two sections (the current will be and will not be upgraded), just one long list. And that in itself may be a problem when the user just wants to see what will not be upgraded. Hah, I'm going in circles. I'll follow along for now, my skills and interest with UI 'stuff' is limited.
Comment #45
webchickWe could handle that bit like Upgrade Status module does (https://www.drupal.org/files/project-images/UpgradeStatus8UI.png), which is:
1) A full table of all modules in alphabetical order (could indeed group sub-modules under package if you'd like; Update Status module does that: https://www.drupal.org/files/issues/2019-10-09/d8-update-manager.png)
2) Colour + icon the table rows according to their statuses
3) Allow filtering the table to show only rows with a problem
Comment #46
webchick...all of which, however, is light years more complicated than just switching to the human-readable label! ;)
Comment #47
quietone CreditAttribution: quietone as a volunteer commentedRight, when I installed upgrade status I got errors about git something or other and I didn't pursue it further. It looks like I should try again.
Comment #49
quietone CreditAttribution: quietone as a volunteer commentedWorking on the list in #45.
There is still a lot to do here but I've done:
45.1 All modules in alpha order.
45.2 Colour + icon the table rows according to their statuses
Next I want to figure out how to group sub-modules under a package.
Comment #50
quietone CreditAttribution: quietone as a volunteer commented#45.1 This now groups sub modules together. If all the modules in a package are 'will be upgraded' then the details are not opened. Only packages with modules that 'will not upgrade' will be opened when then page loads.
#45.2 Each module row has color and an icon. Note that for no particular reason I switched to having 3 columns, which Upgrade Status has, instead of the previous 2 columns. The icon is now at the far right in the status column. Do we want 2 or 3 columns?
#45.3 TODO
The patch needs cleanup as I just copied the upgrade_status.admin.theme.css to migrate_drupal_ui. I guess there are entries there that can be removed and it probably what is needed should probably move to the existing upgrade-analysis-report-tables.css. Is that right?
The filtering needs to be added and I am not sure how to do that here. I've added a filter to form once, long ago in D6. Will someone please provide some direction.
There are two screenshots, one with an expanded section and one without. I added a count of the modules that will not upgrade to the title as I was playing around and that got left in the patch. I didn't intend to leave it in.
Comment #52
quietone CreditAttribution: quietone as a volunteer commentedAll but one of the failures is because the assertions on the review page fail. I don't see the point of fixing that until we have agreement on the layout of the page. The other failing test is Drupal\KernelTests\Core\Theme\StableLibraryOverrideTest which is because of copying the file from Upgrade Status module and my lack of knowledge in that area.
In, other words please feedback on the Review Form.
Comment #53
quietone CreditAttribution: quietone as a volunteer commentedComment #54
webchickWow! This looks really great, but is also a bit WAY overkill for what we need here, I think?
Is there any way to make this issue just "use human-friendly module names on the Migrate UI" (as it was originally written) and split off "and also make the styling 10,000% better and match the Upgrade Status module" to a separate follow-up? I think these changes look great, but we probably need to spend some time properly evaluating them, and in the meantime we hold up a sensible fix.
The issue summary mentions the concern in #22 that if we do just that, then we're removing useful information, so as a compromise, how about we invert the logic of #36, and show the human-readable version by default and the machine name on hover?
Comment #55
quietone CreditAttribution: quietone as a volunteer commented@webchick, will do.
There is no interdiff since I started with the patch in 20 and there was rerolling involved.
Screenshot with hover
Screenshot showing sorting
There is more to do here but I have to leave now to catch a bus. And I made the patch quickly so -- could be silly errors.
Comment #57
quietone CreditAttribution: quietone as a volunteer commentedCreated followup #3088215: Use styling from Upgrade Status module on Review form. Updated IS. And a new patch which hopefully fixes the tests.
Comment #59
quietone CreditAttribution: quietone as a volunteer commentedFound and fixed an error in the sorting (it was still sorting by machine name) and this should fix the tests. New screenshot here to prove the sorting is correct.
Screenshot of alpha sort working
Comment #61
quietone CreditAttribution: quietone as a volunteer commentedJust some typos in the project names.
Comment #63
quietone CreditAttribution: quietone as a volunteer commentedFull of typos today.
Comment #64
quietone CreditAttribution: quietone as a volunteer commentedFinally, tests are passing. This IS is updated and the followup made, so this is ready for review.
Comment #65
benjifisherI am just starting to look at this issue. Since the patch in #36 was RTBC and similar to the current patch (except that machine name and label are switched) I decided to start by comparing the two.
Almost all of these comments are either small nits or out of scope. On the plus side, the nits should be easy to fix and I will not argue if you choose not to fix anything out of scope.
This patch adds
use
statements in alphabetical order, which is the usual practice. I noticed that the patch in #36 also fixed some of the existinguse
statements, which were out of order. This is out of scope for this issue, but I will be even happier if you make the same fix again.Since
$this->state
is already set in the parent constructor, there is no need to do it again. I do not see$this->pluginManager
declared or used anywhere. I do see$this->migrationPluginManager
declared and assigned in the parent constructor. I think both of those lines should be removed.Another out-of-scope problem that you can choose to fix or not:
$this->migrationState = $migrationState;
should really be$this->migrationState = $migration_state;
. (Class properties should all be lowerCamelCase. Other variables can be either lowerCamelCase or snake_case, but should be consistent within afile.) If you choose to fix this, then also adjust the doc block and the declaration.$config_factory
$migration_plugin_manager
$state
$tempstore_private
After this patch, the order of variables in the child constructor is
$state
$migration_plugin_manager
$tempstore_private
$migrationState
$config_factory
$module_handler
Usually, when we extend a constructor, we keep the original parameters and add new ones on the end. Is there any reason not to do that here? Again, I will not argue if you say that this is out of scope.
Since we are targeting Drupal 8.8 (or maybe 8.9) we can finally use PHP 7:
$source_module_name = $data['name'] ?: $source_module;
What do you think of doing it this way (and staying under 80 characters)?
Or perhaps
I will continue to look at this issue. I want to look at the patch as a whole, not just compare it to the one from #36, and I should have a look at the tests.
What do you recommend for manual testing? Can I grab one of the database fixtures used in the tests, enable the module, and be in business?
Comment #66
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thanks for the review.
Yes, using the database fixtures used in the tests is fine. Be aware that your local D8 site will have different modules enabled and the state of the modules on the ReviewForm will not be identical to the test.
There is also a Generating database fixtures for D8 Migrate tests , which I haven't checked for ages.
Comment #67
quietone CreditAttribution: quietone as a volunteer commentedFixes for #65 1 -> 5. Yes, 1 and 2 may be out of scope but I've been wanting to tidy that up for a while.
Comment #68
joachim CreditAttribution: joachim commentedThe first line docblock and the method name don't really seem to match. Typically a method called sortFoo will be a callback for a PHP sort method. This seems to do more than that. In particular, its input and output are fairly different.
Comment #69
quietone CreditAttribution: quietone as a volunteer commented@joachim, thanks for the reminder. I wanted to come back to this just for that and I completely forgot.
This should be an improvement.
Comment #70
quietone CreditAttribution: quietone as a volunteer commentedThis is a blocker to a prettier review form, #3088215: Use styling from Upgrade Status module on Review form
Comment #71
benjifisherI have finished reviewing the patch, including the tests. I have just a few more requests, mostly to the documentation blocks.
Since this variable is not set in the constructor, it would be helpful to mention where it is set:
buildForm()
.Drupal\migrate_drupal\MigrationState
:Why do we have one function that is just a wrapper for another function? Then, in the doc block of
buildUpgradeState()
,That should be
'menu' => 'menu_link_content','menu_ui','system'
, right?If I have this right, then I will open an issue (and tag it for Novice) to fix the documentation. Maybe a second issue to get rid of one of the functions.
It will help if the
@param
comment includes "as returned by MigrationState::getUpgradeStates() and if the@return
comment explicitly mentions the keyssource
anddestination
. Or maybe the@param
comment should be something like "Keys are machine names of modules on the source site. Values are lists of machine names of modules on the destination site, in CSV format." That would clarify that this function is not changing the CSV format of the inner values.It is a little confusing that
getAvailablePaths()
used to be an array of machine names and is now an array of "friendly" names. Can you update the doc block in MigrateUpgradeTestBase to make this explicit? I guess also update the doc block ofgetMissingPaths()
.I know this is just context, but this looks like a typo. It should be
migrate_state_not_finished_test
, right? Please fix it here and in the D7 version as well.I also did some manual testing. For the record, the instructions in #66 were not quite right. If the database key (in
settings.php
) isd7_dump
, then the correct command isphp core/scripts/db-tools import --database=d7_dump core/modules/migrate_drupal/tests/fixtures/drupal7.php
.Here are my screenshots. They show the correct labels and the sorting. The hover effect also works, although I did not work as hard as @quietone.
Comment #72
quietone CreditAttribution: quietone as a volunteer commentedThanks for the review!
Fixes for 1, 3, 4 and 5 from#71.
#71.2 - I don't recall why that wrapper is there and I have skimmed the original issue and didn't see anything in the discussion. The only difference is the visibility. Yes, the docbloc is incorrect and suitable for a novice issue.
Comment #73
benjifisher@quietone, thanks for the fixes! I think this looks good.
Comment #74
alexpottI don't think we should change the key from being the extension machine name. There's no guarantee that the human readable form of the module name is suitable for an array key or is unique. We can still key by the machine name and then do a sort by a key in the each element of the array. Also the tooltip is useful but I think for accessibility doesn't it need to say what it is?
Comment #75
quietone CreditAttribution: quietone as a volunteer commentedWorking on this now
Comment #76
quietone CreditAttribution: quietone as a volunteer commentedFixes for #74
At Drupal South 2019, I spoke to Tessa Penny a product designer from Service NSW at DrupalSouth who recommended display the machine_name in a third column. And later dpi helped with the sorting of algo and I learned about spaceship, which came in with Php 7.0.
Screenshot showing sorting by human readable name and new column for machine name.
Comment #77
quietone CreditAttribution: quietone as a volunteer commentedComment #78
rooby CreditAttribution: rooby commentedThe patch in #76 addresses the issues raised in #74.
No new issues from me.
Back to RTBC.
Comment #79
quietone CreditAttribution: quietone as a volunteer commentedUpdate IS with latest screenshot
Comment #80
quietone CreditAttribution: quietone as a volunteer commented@rooby, thanks for the vote of confidence. However, this needs a usability review before that.
Comment #81
heddnDo we need to put the D8 module machine name in parens after them?
Comment #82
quietone CreditAttribution: quietone as a volunteer commentedNice question. And begs another question, how does having the machine name of the D8 module help the upgrader? Wouldn't they simply want to install or uninstall a D8 module? And for that the human readable name is sufficient.
Comment #83
benjifisherI am changing the screenshots in the issue summary from links to embedded images, and moving them to the "User interface changes" section.
Comment #84
benjifisherUsability review
We discussed this issue today: Drupal Usability Meeting - 2019-12-12.
We agreed that the third column is a good way to provide the extra information, although there are some accessibility concerns. Since we already have the follow-up issue #3088215: Use styling from Upgrade Status module on Review form for a more complete overhaul, we decided that we should use this incremental improvement for now.
I am removing the "Needs usability review" tag. Since this issue was RTBC before #80 pointed out that the review was pending, I am setting the status back to RTBC. (I have not personally reviewed the changes since #74.)
Comment #85
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thanks for taking this to the usability meeting.
I agree!
Comment #87
quietone CreditAttribution: quietone as a volunteer commentedTest failure was unrelated to this patch. Retested and back to green
Comment #88
quietone CreditAttribution: quietone as a volunteer commentedComment #89
quietone CreditAttribution: quietone as a volunteer commentedForgot to set to NW
Comment #90
sokru CreditAttribution: sokru as a volunteer commentedReroll from #76.
Comment #92
quietone CreditAttribution: quietone as a volunteer commented@sokru, thank you for the reroll.
Next time please add a diff, not an interdiff, was provided. There are instructions for that on Rerolling patches. Since I am working on the failing test I've made the diff.
Comment #93
quietone CreditAttribution: quietone as a volunteer commentedAnd fix the test of the Review page.
Comment #94
benjifisherThe link in #92 ("Rerolling patches") is broken. There is a comment on https://www.drupal.org/patch/reroll suggesting a diff (not an interdiff) for rerolls, and that comment was added to the body of https://www.drupal.org/documentation/git/interdiff#reroll
Comment #95
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thanks for the correction.
Comment #96
quietone CreditAttribution: quietone as a volunteer commentedworking on a reroll but having trouble running the functional tests locally. Let's see what the testbot finds.
Comment #98
quietone CreditAttribution: quietone as a volunteer commentedJust fix the failing test. It is just a test of the review page, so remove the entity counts left over from copy/paste and change the filename.
Comment #99
benjifisherI am reviewing this today.
I already see one little nit to pick, but nothing serious so far.
Comment #100
benjifisher@quietone, thanks for the continued work on this! I reviewed the patch, especially the changes since my review in #73.
As usual, I apologize for the minor complaints. I will make up for that by giving a prompt review of an updated patch.
We no longer need the key in the
foreach
loop. If we remove$source_module =>
, then we should probably adjust the comment.I also wonder whether it is worth using
'#type' => 'html_tag'
. We could get the same markup using#prefix
and#suffix
, and then the three entries for each row would be more consistent. If you like it better the way it is, or think this is out of scope, then I will not argue.Same comments here (key is not needed,
'#type' => 'html_tag'
could be simplified).Can we make a few changes to the doc block? I like the Oxford comma, and I think that the core committers mostly agree, so please add a comma after "put into a CSV format". Consider shortening "A migration state array" to "An array". For the
@return
comment, use "source module machine name" in the first sentence and consider using list format for the three keys of the array.Please change the variable name from
$source_machine_name_name
to$source_module_name
or explain why you think the current name is better.Either
return strcmp($a['source_module_name'], $b['source_module_name']);
orreturn $a['source_module_name'] <=> $b['source_module_name'];
.I guess it is out of scope, and I do not want to get bogged down in arguing over whether it should be "is" or "was", but "is was" is clearly wrong.
I just want to note that we are not adding modules to the list (specifically Block translation). We are changing the order of the list, since it used to be sorted by machine name and is now being sorted by label. I already checked this when I reviewed the patch in #72.
I am a little confused about the history of this test. The interdiff attached to #98 and the comment there suggest that this is a modified version of NoMultilingualTest.php, which was removed in #2966856: Hide and disable Drupal Migrate Multilingual. Can you clarify this?
Is there any reason not to sort the list of modules? It is easier to spot duplicates in a sorted list, so that can help prevent errors down the line. It is also easier to check whether a particular module is on the list.
Comment #101
quietone CreditAttribution: quietone as a volunteer commentedThanks for the review.
Fixes for the review in #99.
1, 2 - Fixed. Is that the correct use of #prefix and #suffix?
3. Arg, I don't like the serial comma but it is in the style-guide and I have changed the comment.
4. Comment adjusted to match the actual output of the method, which is like this:
)
5. Fixed
6. Fixed
7. No changed needed
8. Yes, it started out as d7/NoMultilingualTest which included testing of the review page as well as testing the entity counts post upgrade. It seems worthwhile to keep the test of the review page and the test was renamed to NoMultilingualReviewPageTest.php.
9. I prefer them sorted too. They are sorted now.
Comment #103
quietone CreditAttribution: quietone as a volunteer commentedOh, I forgot to change the assertions on the review page to search for a div and not a span.
Comment #104
benjifisher@quietone, thanks for the prompt update! I am afraid that we need a few fixes for the fixes. :-(
Thanks for looking up the usage of the serial/Oxford comma. I did not realize it was official.
and
You asked whether this is the right way to use
#prefix
and#suffix
. The first one should be something like this. Note that I removed spaces around=
inside the tag; I think that is the standard. Also, you can use<span>
instead of<div>
and revert the changes to the test from #101 to #103. (If you do that, then it will save me the trouble of another round of manual testing since we are changing the markup.)Now that the render array is more consistent, I notice a different inconsistency:
We can get rid of one level of nesting for
'source_machine_name'
, right?There is something missing after "Each array of", or we can remove "of", and there is an extra "the" before "the destination module". I was wrong (part of #100.3) to say that the first sentence should end with "source module machine name".
Thanks for clarifying the history of the test (#100.8).
Comment #105
quietone CreditAttribution: quietone as a volunteer commentedAnd here are fixes for #1-3 above.
@benjifisher, thanks for the code for #1.
Comment #107
benjifisherRegarding
#prefix
and#suffix
, I guess I fell into the trap of "if I know this, then everyone must know this". If I taught you something new, then that is my good deed for the day!The updates in #101 and #105 fix all the issues I found in #101 and #104, so back to RTBC. The changes to the test in #103 were reverted: see #104.1.
The testbot disagrees, but the failure is on an unrelated test: https://www.drupal.org/pift-ci-job/1637535
Let's give it another chance.
Comment #108
jungle1586018408 - 1586014808 = 1 hour, BTW
Comment #110
xjmThis patch seems to contain a lot more than what's necessary to fix the scope described in the title and IS. Can we update the IS and/or the title, and rein in the out-of-scope changes a bit? (They can be moved to related issues.) Thanks!
Comment #111
quietone CreditAttribution: quietone as a volunteer commentedI reviewed the patch and search the issue for all references to 'scope' to identify what can be removed and then reverted those changes.
Comment #113
sokru CreditAttribution: sokru as a volunteer commentedUpdated summary with fresh screenshots based on patch on #105.
Comment #114
quietone CreditAttribution: quietone as a volunteer commentedsokru, thanks for updating the screenshots but they need to be on a later patch. There are changes in #111 that directly effect the output. Of course, we need to have it passing tests first as well.
As for the tests, I only ran on locallly, d6/NoMultilingualReviewPageTest.php, and it passes locally. I don't know why.
This patch fixes the coding standard and and a void return.
Comment #116
quietone CreditAttribution: quietone as a volunteer commentedThis might fix it. Unfortunately, my local site is broken somehow and tests on 9.1.x HEAD are failing so I can't test this myself.
Comment #117
quietone CreditAttribution: quietone as a volunteer commentedA follow up has been made to work on the out of scope changes that have been removed, #3133183: Various fixes to ReviewForm constructor.
Comment #118
sokru CreditAttribution: sokru as a volunteer commentedUpdated screenshots from patch 116 to summary. Wonder if the column header be "Drupal 9" instead of "Drupal 8" ?
Comment #119
quietone CreditAttribution: quietone as a volunteer commented@sokru, Yes, it should now be Drupal 9. Thank you for noticing that!
This patch uses \Drupal::VERSION to get the major version of the destination site.
A follow up is need to change 'Drupal 8' in MigrateUpgradeExecuteTestBase, MigrateUpgradeFormStepsTest, IdConflictTest, NodeClassicTest.
Comment #120
quietone CreditAttribution: quietone as a volunteer commentedOn the other hand, that recent change may be considered out of scope too. In that case, use the patch in #116.
Comment #121
benjifisherI compared
ReviewForm.php
in (9.1.x with the patch from #116) to 9.1.x and to (8.9.x with the patch from #105). I also looked at the patch in #119. I still owe you a review of the tests.I see just one problem with the patch in #116, and I am setting the status to NW for this:
We should add the new
@param
comment without removing the one for$config_factory
.I think all of us agree that writing patches is more fun than creating and updating issues here on d.o. What @xjm is reminding us, in #110, is that we have to keep the final reviewer in mind. Think of it as a single-responsibility principle for issues, or think of it as keeping your commits/patches atomic. Each issue should do just one thing.
Follow-up issues (all related to
ReviewForm.php
)use
statements alphabetically.snake_case
for parameters andlowerCamelCase
for properties.@param
comments in the same order as the function declaration.buildForm()
by using'#prefix'
and'#suffix'
.Perhaps (1) and (2) can be combined. Also, (2) will require corresponding changes to the
create()
method.I have a few suggestions for improving the change in #119, but I will save them for the to-be-created issue.
Comment #122
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thanks, I missed that deletion.
This patch fixes #121. Still to do is create the new issues.
Comment #123
quietone CreditAttribution: quietone as a volunteer commented#121.1 Sort use statements alphabetically.
There is an issue for setting a policy for this but it is still active, https://www.drupal.org/project/coding_standards/issues/1624564 and there is at least one issue https://www.drupal.org/project/drupal/issues/2885792 sert to won't fix, so let's skip this one.
#121.4 Update "Drupal 8" in comments, table header, and elsewhere so that is shows the correct version.
This is #3133305: Use \Drupal::VERSION to get the version in Migrate UI rather than hardcoding it
Comment #124
quietone CreditAttribution: quietone as a volunteer commentedRight, another mistake in my life. Ignore the patch in #122, I started from #119 instead of #116. This one is based on #116.
Comment #125
quietone CreditAttribution: quietone as a volunteer commentedAnd a final followup, #3134308: Change 'is was' to 'is' in comments
Comment #126
quietone CreditAttribution: quietone as a volunteer commentedAll followup are made, I think.
Comment #127
benjifisherThanks for the patch in #124, fixing the problem I noticed in #121.
I reviewed the changes in the tests. Other than metadata (line counts and commit hashes) the only differences between #105 and #124 are
void
to thesetUp()
method.Of these, (1) removes an out-of-scope change and (2) is required now that the patch targets 9.1.x (and is an update to code added by this patch, not existing code).
I am adding the followup issues as related issues.
I would still like to see followups for #121.2 and #121.3, but I will not hold up this issue for those. Maybe we can discuss at the Migrate API meeting on Slack today.
I am setting the status back to RTBC.
Comment #128
quietone CreditAttribution: quietone as a volunteer commented@benjifisher, thanks!
The followup are made. Here is a summary:
From #121
1. Sort use statements alphabetically. - No follow up See #123.1
2. Various fixes to the constructor: #3133183: Various fixes to ReviewForm constructor
3. Simplify buildForm() by using '#prefix' and '#suffix'. #3134300: Simplify ReviewForm::buildForm() and the resulting markup
4. Update "Drupal 8" in comments, table header, and elsewhere so that is shows the correct version. #3133305: Use \Drupal::VERSION to get the version in Migrate UI rather than hardcoding it
And from #125
#3134308: Change 'is was' to 'is' in comments
Comment #129
benjifisher@quietone:
I just realized that. I was about to say ...
I missed the new child issues related to #121.2, #121.3, and #121.5. There is no need to list that last one as both related and a child issue.
Comment #130
xjmThanks, just a few more small things.
We can almost always be more specific than
array
in data type documentation, e.g. is itstring[]
?array[]
?string[][]
? The more specific, the better.We should add BC for this (make the new parameter optional and defaulted to NULL, and trigger a deprecation error and set it from
\Drupal
if NULL is passed).Looks out of scope.
Nit: human-readable.
This still looks out of scope. Unless it's meant to indicate that the data is being changed from the machine names to the UI labels? If so, that's not clear here. I'd make it more specific, i.e., "An array of the human-readable names (UI labels) of the modules that will be upgraded.
Also, nit: "source modules names" isn't quite grammatical.
Technically fixing "sate" to "state" is also not in scope, but OK I guess since it's part of and directly relevant to the hunk being updated.
Comment #131
quietone CreditAttribution: quietone as a volunteer commentedAddressing all points in #130.
1. The first '@var array' listed is for the return value from MigrationConfigurationTrait::getSystemData and is in agreement with the doc block for that method, '* @return array', therefor that has not been changed here. The second point, `@return array` has been modified.
2. The ReviewForm is @internal, does that still require adding BC? I did a code search and found no instances of the ReviewForm being extended. In fact, I would be surprised if it was used somewhere.
3. Reverted
4. Fixed
5. Reverted
6. No change required.
Comment #132
larowlanThis has been on my list for a long time, apologies to @quietone for how long it has taken me to look at it in detail.
It looks really good to me, and I applaud your persistence @quietone for sticking with an issue that on the surface seems straight forward, but yet somehow we're at comment #132.
There's only one thing that I have a question about here, and I might be wrong -
Does this need to be translatable? i.e. should it be
$this->t('Core')
.Also, we can continue here, which would avoid the else and therefore reduce some complexity (less indentation etc) - but don't worry about that unless we need to add translation support here.
Comment #133
benjifisherThe patch needs a reroll now that #3133305: Use \Drupal::VERSION to get the version in Migrate UI rather than hardcoding it has landed, so back to NW. I guess that means we should also address #132.
Comment #134
quietone CreditAttribution: quietone as a volunteer commentedAnd here is the reroll with a bonus of new screenshots.
#132. It could be but it is in a list of destination modules name so I would think we would want to translate all of the module names and not just the one 'Core'. And, at least for me, the module human readable names are not translated on the Extend page. So, leave it as is?
Comment #135
quietone CreditAttribution: quietone as a volunteer commented@larowlan, NP, I mean to thank you in my comment above but I got sidetracked. Thanks for the positive review, it is a welcome coming out of lockdown present! Cheers.
Comment #136
benjifisherFollow-up to #130.1:
@param array
can also be changed to@param string[]
. Back to NW for this.I just noticed the stray "of" in the second sentence of the
@return
comment. Please fix that, too.I am not sure how the BC policy applies to
@internal
classes as discussed in #130.2 and #131.This patch fixes #130.3 and #130.4.
I do not have time right now to review the changes to the test classes. I also have not thought about #132.
Comment #137
quietone CreditAttribution: quietone as a volunteer commented1. I'm not sure about changing ' * @param array $migration_state' because that value is the returned value from \Drupal\migrate_drupal\MigrationState::getUpgradeStates() which the docs show is an array, `* @return array`.
The stray 'of' has been removed.
2. I couldn't find anything in the docs about this either.
4. Fortunately, the only changes here since the last RTBC are to comments.
Comment #138
quietone CreditAttribution: quietone as a volunteer commentedNR for testing
Comment #139
kim.pepperThis addresses #130.2 by adding BC to the constructor.
Comment #140
benjifisherLooking at the interdiff, #139 also type hints the interface, which is good. I am sorry I missed that.
The patch also rearranges some of the
use
statements, which might be considered out of scope. Before the request in #110 to "rein in the out-of-scope changes a bit", the patches were alphabetizing theuse
statements.I will have a closer look after I get some sleep.
Comment #141
kim.pepper@benjifisher replacing one import with another means we are changing those lines. I don't think that is out of scope.
Comment #142
quietone CreditAttribution: quietone as a volunteer commented@kim.pepper, thank you.
Comment #143
benjifisherI have reservations about a few point (details below). I will be happy to re-review an updated patch that addresses any of them. For now, I will update the status to RTBC and let a core committer decide whether any of these points are serious enough to require another round of revisions.
The patch in #139 adds ModuleHandlerInterface. The earlier patches added ModuleHandler instead. Either way, it is tempting to sort the later
use
statements but this could be considered out of scope. I do not object to this change, and #110 was not specific about which out-of-scope changes should be "reined in".I reviewed the Drupal 8 and 9 backwards compatibility and internal API policy (backend). Even for internal classes, we should provide deprecation notices unless there is a reason not to. Even if the class were not internal, the form would be considered internal since it is a page controller. (It is not clear to me whether that exception applies to all forms or just the ones used as controllers.)
Since there is not a reason to skip the deprecation notice, we should have one here. +1 for the thanks in #142.
I looked for a standard deprecation notice and did not find one. What I do not like about this one is that I do not see what "will be required" applies to. I looked for similar examples and did not find many. Then I checked out the 8.9.x branch, and found many more deprecation notices. ;) These are very similar:
Note that there was a little too much copy/paste there.
That is close enough that I will not set the issue back to NW for this, but I will be happy to re-review if someone wants to update the notice. I like this one:
I still think the
@param
should be changed tostring[][]
. It does not matter where the parameter comes from when this function is called. Conceivably, that could change: the doc block of this function should specify the parameters that this function expects.But I have already asked for that change once. If you want a definitive opinion from a core committer, then I will not get in the way.
I checked the functional tests, comparing to the patch in #124. I confirmed what @quietone said in #137, that the only changes are to the comments, removing
@group legacy
. That change comes from #3134459: Remove @group legacy from migrate tests, and this patch does not add any new instances of that annotation.Comment #144
quietone CreditAttribution: quietone as a volunteer commented#143. 3. You are correct, I was wrong. And I double checked the input and it is really string[] anyway. So making that change now.
Comment #145
benjifisher@quietone:
Thanks. That resolves one of my reservations. Yes, it should be
string[]
and notstring[][]
.Back to RTBC.
Comment #146
larowlanUpdating issue credits
Comment #148
larowlan🎉 Committed d4c3b72 and pushed to 9.1.x. Thanks!
Published the change record
Comment #149
benjifisherI just added #3137713: [D8 only] Update deprecation notices in NodeNewComments constructor (novice issue) to fix the little copy/paste issue that I mentioned in #143.2.