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
Before screenshot

After
Showing 3 columns sorted but source module human readable name

CommentFileSizeAuthor
#144 3024682-144.patch35.21 KBquietone
#144 interdiff-139-144.txt696 bytesquietone
#139 3024682-139-interdiff.txt2.61 KBkim.pepper
#139 3024682-139.patch35.21 KBkim.pepper
#137 3024682-136.patch34.53 KBquietone
#137 interdiff-134-136.txt898 bytesquietone
#134 After.png18.32 KBquietone
#134 Before.png14.46 KBquietone
#134 3024682-134.patch34.53 KBquietone
#134 diff-131-134.txt346 bytesquietone
#131 3024682-131.patch34.42 KBquietone
#131 interdiff-124-131.txt2.11 KBquietone
#124 3024682-124.patch35.48 KBquietone
#124 interdiff-116-124.txt715 bytesquietone
#122 3024682-122.patch36.44 KBquietone
#122 interdiff-119-122.txt715 bytesquietone
#119 3024682-119.patch36.55 KBquietone
#119 intertdiff-116-119.txt2.18 KBquietone
#118 3024682-116-before.png93.7 KBsokru
#118 3024682-116-after.png114.23 KBsokru
#116 3024682-116.patch35.6 KBquietone
#116 interdiff-114-116.patch726 bytesquietone
#114 3024682-114.patch35.6 KBquietone
#114 interdiff-111-114.txt1.41 KBquietone
#113 3024682-after.png126.54 KBsokru
#113 3024682-before.png103.15 KBsokru
#111 3024682-111.patch35.59 KBquietone
#111 interdiff-105-111.txt5.41 KBquietone
#105 3024682-105.patch37.2 KBquietone
#105 interdiff-103-105.txt4.72 KBquietone
#103 3024682-103.patch38.96 KBquietone
#103 interdiff-101-103.txt2.09 KBquietone
#101 interdiff-98-101.txt6.45 KBquietone
#101 3024682-101.patch37.17 KBquietone
#98 3024682-98.patch36.75 KBquietone
#98 interdiff-96-98.txt10.35 KBquietone
#96 3024682-96.patch38.48 KBquietone
#96 diff-93-96.txt9.21 KBquietone
#93 3024682-93.patch35.01 KBquietone
#93 interdiff-90-93.txt582 bytesquietone
#92 diff-76-90.txt266 bytesquietone
#90 3024682-90.patch35.04 KBsokru
#76 Screenshot from 2019-11-27 15-36-09.png29.79 KBquietone
#76 3024682-76.patch35.02 KBquietone
#76 interdiff-72-76.txt4.9 KBquietone
#72 3024682-72.patch33.78 KBquietone
#72 interdiff-69-72.txt3.49 KBquietone
#71 yes-upgraded.png86.83 KBbenjifisher
#71 not-upgraded.png88 KBbenjifisher
#69 interdiff-67-69.txt3.09 KBquietone
#69 3024682-69.patch32.19 KBquietone
#67 3024682-67.patch31.99 KBquietone
#67 interdiff-63-67.txt4.3 KBquietone
#63 interdiff-59-62.txt485 bytesquietone
#63 3024682-63.patch31.12 KBquietone
#61 3024682-61.patch31.12 KBquietone
#61 interdiff-59-62.txt714 bytesquietone
#59 Screenshot from 2019-10-17 00-39-31.png23.31 KBquietone
#59 3024682-59.patch31.12 KBquietone
#59 interdiff-57-59.txt5.82 KBquietone
#57 3024682-57.patch30.97 KBquietone
#57 interdiff-55-57.txt2.63 KBquietone
#57 20191016_162336.png297 KBquietone
#55 Screenshot from 2019-10-16 16-27-29.png8.15 KBquietone
#55 20191016_162336.png297 KBquietone
#55 diff-20-55.txt7.57 KBquietone
#55 3024682-55.patch30.97 KBquietone
#50 Screenshot from 2019-10-15 14-29-59.png7.26 KBquietone
#50 3024682-50.patch23.47 KBquietone
#50 Screenshot from 2019-10-15 14-14-25.png35.27 KBquietone
#49 Screenshot from 2019-10-14 12-22-26.png25.36 KBquietone
#42 d8-modules-page.png245.97 KBwebchick
#41 d8-update-manager.png309.32 KBwebchick
#39 Screenshot from 2019-09-28 17-53-38.png48.66 KBquietone
#39 Screenshot from 2019-09-28 18-12-06.png309.86 KBquietone
#36 3024682-36.patch8.24 KBquietone
#36 interdiff-35-36.txt1.41 KBquietone
#34 3024682-35.patch9.1 KBquietone
#34 diff-31-35.txt4.8 KBquietone
#33 interdiff-31-33.txt889 bytesquietone
#33 3024682-33.patch8.86 KBquietone
#31 Screenshot from 2019-09-22 20-47-48.png22.24 KBquietone
#31 diff-20-31.txt27.49 KBquietone
#31 3024682-31.patch9.33 KBquietone
#20 3024682-20.patch29.56 KBquietone
#20 interdiff-19-20.txt2.09 KBquietone
#13 interdiff-11-13.txt2.65 KBquietone
#11 3024682-11.patch28.63 KBquietone
#19 3024682-19.patch29.54 KBquietone
#11 interdiff-8-11.txt15.27 KBquietone
#19 interdiff-18-19.txt4.03 KBquietone
#9 Selection_003.png38.69 KBquietone
#18 3024682-18.patch30 KBquietone
#18 interdiff-15-18.txt3.75 KBquietone
#9 Selection_004.png37.79 KBquietone
#6 Selection_002.png7.77 KBquietone
#6 3024682-6.patch5.86 KBquietone
#8 3024682-8.patch23.17 KBquietone
#8 interdiff-6-8.txt21.4 KBquietone
#16 interdiff-13-15.txt10.94 KBquietone
#13 3024682-13.patch28.61 KBquietone
#16 3024682-15.patch28.76 KBquietone
#5 3024682-5.patch2.75 KBquietone
#5 Selection_011.png32.98 KBquietone
#6 Selection_001.png15.75 KBquietone
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

quietone created an issue. See original summary.

quietone’s picture

Issue summary: View changes
Status: Active » Postponed
Parent issue: #3024681: Migrate UI - allow install of modules in the will not be upgraded list »
Gábor Hojtsy’s picture

I 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.

Version: 8.7.x-dev » 8.8.x-dev

Drupal 8.7.0-alpha1 will be released the week of March 11, 2019, which means new developments and disruptive changes should now be targeted against the 8.8.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

quietone’s picture

Although 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.

quietone’s picture

Issue summary: View changes
Status: Postponed » Needs review
FileSize
5.86 KB
7.77 KB
15.75 KB

No longer postponed and here is a new patch. No interdiff because the ReviewForm has changed too much.

Status: Needs review » Needs work

The last submitted patch, 6: 3024682-6.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
21.4 KB
23.17 KB

Reworked 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.

quietone’s picture

Issue summary: View changes
FileSize
37.79 KB
38.69 KB

Add large screenshots.

Status: Needs review » Needs work

The last submitted patch, 8: 3024682-8.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
15.27 KB
28.63 KB

Sort the module lists in the tests and correct some typos.

Status: Needs review » Needs work

The last submitted patch, 11: 3024682-11.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
2.65 KB
28.61 KB

Some more typos and help is not installed in the D6 test fixture so it is remained from the will be list.

Status: Needs review » Needs work

The last submitted patch, 13: 3024682-13.patch, failed testing. View results

Gábor Hojtsy’s picture

quietone’s picture

Status: Needs work » Needs review
FileSize
28.76 KB
10.94 KB

Adjust 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.

Status: Needs review » Needs work

The last submitted patch, 16: 3024682-15.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
3.75 KB
30 KB

Ah, 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".

quietone’s picture

Just cleaning up.

quietone’s picture

Change some variable names to be more meaningful.

quietone’s picture

All done for now. This is ready for a review.

Gábor Hojtsy’s picture

Looks good to me except:

+++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php
@@ -148,18 +148,18 @@ protected function getAvailablePaths() {
-      'block',
-      'devel',
-      'devel_generate',
-      'devel_node_access',
-      'i18n',
-      'i18ncck',
-      'i18nstrings',
-      'i18ntaxonomy',
-      'i18nviews',
-      'locale',
+      'Block',
+      'CCK translation',
+      'Devel',
+      'Devel generate',
+      'Devel node access',
+      'Internationalization',
+      'Locale',
+      'String translation',
+      'Taxonomy translation',
+      'Views',
+      'Views translation',

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".

quietone’s picture

Status: Needs review » Needs work

Right 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.

webchick’s picture

I'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.

webchick’s picture

I 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.

Gábor Hojtsy’s picture

Upgrade 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.

webchick’s picture

Oh, fair point. Let's do that then. :)

quietone’s picture

@webchick, Sorry, do exactly what? I am not sure what you are suggesting be done here.

quietone’s picture

Status: Needs work » Needs review

It 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.

mikelutz’s picture

Status: Needs review » Needs work

I 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

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
9.33 KB
27.49 KB
22.24 KB

I 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.

Status: Needs review » Needs work

The last submitted patch, 31: 3024682-31.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
8.86 KB
889 bytes

This should fix the test and then we have #22-1 implemented.

quietone’s picture

mikelutz’s picture

Status: Needs review » Needs work

Looking good. Setting to NW for one super nit, sorry!

  1. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -57,10 +73,13 @@ class ReviewForm extends MigrateUpgradeFormBase {
    +  public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory, ModuleHandler $module_handler) {
         parent::__construct($config_factory, $migration_plugin_manager, $state, $tempstore_private);
         $this->migrationState = $migrationState;
    +    $this->moduleHandler = $module_handler;
    

    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.

  2. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -167,18 +190,21 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    +            '#value' => $source_module ,
    

    super nit: extra space added before the comma

quietone’s picture

Status: Needs work » Needs review
FileSize
1.41 KB
8.24 KB

thanks mikelutz
1. agree
2. fixed. Plus removed an unused variable.

mikelutz’s picture

Status: Needs review » Reviewed & tested by the community

Looks good to me. Thanks!

webchick’s picture

Issue tags: +Needs screenshots

Could we get a screenshot please? :D

quietone’s picture

Title: Migrate UI - use module name not machine name on Review Page » Migrate UI - display source module name in tooltip on Review Page
Issue summary: View changes
Issue tags: -Needs screenshots
FileSize
309.86 KB
48.66 KB

A 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.

quietone’s picture

Issue summary: View changes

Add some detail to the IS

webchick’s picture

FileSize
309.32 KB

I'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:

Modules page, showing human-readable labels; machine names hidden under a details element.

Here's the core Update Manager:

Update manager, showing human-readable labels

Here's the Upgrade Status module (D8 version; shown because it has had much more recent design love):

Upgrade Status, also showing human-readable labels

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.

webchick’s picture

FileSize
245.97 KB

Oopsie. Missed a spot.

webchick’s picture

Status: Reviewed & tested by the community » Needs review

"Needs review" for discussion.

quietone’s picture

Thanks 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.

webchick’s picture

We 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

webchick’s picture

...all of which, however, is light years more complicated than just switching to the human-readable label! ;)

quietone’s picture

Right, 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.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.0-alpha1 will be released the week of October 14th, 2019, which means new developments and disruptive changes should now be targeted against the 8.9.x-dev branch. (Any changes to 8.9.x will also be committed to 9.0.x in preparation for Drupal 9’s release, but some changes like significant feature additions will be deferred to 9.1.x.). For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

quietone’s picture

Title: Migrate UI - display source module name in tooltip on Review Page » Migrate UI - use module name not machine name on Review Page
FileSize
25.36 KB

Working 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.

quietone’s picture

#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.

Status: Needs review » Needs work

The last submitted patch, 50: 3024682-50.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review

All 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.

quietone’s picture

Issue summary: View changes
webchick’s picture

Wow! 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?

quietone’s picture

@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.

Status: Needs review » Needs work

The last submitted patch, 55: 3024682-55.patch, failed testing. View results

quietone’s picture

Title: Migrate UI - use module name not machine name on Review Page » Migrate UI - use human-friendly module names on the Review form
Issue summary: View changes
Status: Needs work » Needs review
FileSize
297 KB
2.63 KB
30.97 KB

Created followup #3088215: Use styling from Upgrade Status module on Review form. Updated IS. And a new patch which hopefully fixes the tests.

Status: Needs review » Needs work

The last submitted patch, 57: 3024682-57.patch, failed testing. View results

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
5.82 KB
31.12 KB
23.31 KB

Found 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

Status: Needs review » Needs work

The last submitted patch, 59: 3024682-59.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
714 bytes
31.12 KB

Just some typos in the project names.

Status: Needs review » Needs work

The last submitted patch, 61: 3024682-61.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
31.12 KB
485 bytes

Full of typos today.

quietone’s picture

Issue summary: View changes

Finally, tests are passing. This IS is updated and the followup made, so this is ready for review.

benjifisher’s picture

Status: Needs review » Needs work

I 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.

  1. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -3,6 +3,8 @@
     namespace Drupal\migrate_drupal_ui\Form;
     
     use Drupal\Core\Config\ConfigFactoryInterface;
    +use Drupal\Core\Extension\Exception\UnknownExtensionException;
    +use Drupal\Core\Extension\ModuleHandler;
        

    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 existing use 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.

  2. @@ -57,10 +73,15 @@ class ReviewForm extends MigrateUpgradeFormBase {
        *   Migration state service.
        * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
        *   The config factory service.
    +   * @param \Drupal\Core\Extension\ModuleHandler $module_handler
    +   *   The module handler service.
        */
    -  public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory) {
    +  public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory, ModuleHandler $module_handler) {
         parent::__construct($config_factory, $migration_plugin_manager, $state, $tempstore_private);
    +    $this->state = $state;
    +    $this->pluginManager = $migration_plugin_manager;
         $this->migrationState = $migrationState;
    +    $this->moduleHandler = $module_handler;
        

    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.

  3. Same snippet: in the parent constructor, the order of the variables is
    • $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.

  4. @@ -254,4 +280,49 @@ public function getConfirmText() {
    ...
    +  protected function sortByName(array $migration_state) {
    ...
    +      $source_module_name = $data['name'];
    +      if (empty($source_module_name)) {
    +        $source_module_name = $source_module;
    +      }
        

    Since we are targeting Drupal 8.8 (or maybe 8.9) we can finally use PHP 7:
    $source_module_name = $data['name'] ?: $source_module;

  5. @@ -254,4 +280,49 @@ public function getConfirmText() {
    ...
    +      $destination_module_names = implode(', ', $destination_module_names);
    +      $module_names[$source_module_name]['source'] = $source_module;
    +      $module_names[$source_module_name]['destination'] = $destination_module_names;
        

    What do you think of doing it this way (and staying under 80 characters)?

          $module_names[$source_module_name]['source'] = $source_module;
          $module_names[$source_module_name]['destination']
            = implode(', ', $destination_module_names);
        

    Or perhaps

          $module_names[$source_module_name] = [
            'source' => $source_module,
            'destination' => implode(', ', $destination_module_names),
          ];
        

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?

quietone’s picture

@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.

  1. install migrate_drupal_ui
  2. Create local db, d7_dump
  3. Grant access to the new db and make an entry in $databases in settings.php
  4. php core/scripts/db-tools --import --database=d7_dump core/modules/migrate_drupal/fixtures/drupal7.php
  5. navigate to /upgrade

There is also a Generating database fixtures for D8 Migrate tests , which I haven't checked for ages.

quietone’s picture

Status: Needs work » Needs review
FileSize
4.3 KB
31.99 KB

Fixes 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.

joachim’s picture

Status: Needs review » Needs work
+++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
@@ -254,4 +278,47 @@ public function getConfirmText() {
+   * Helper to convert the module machine_name to name.
...
+  protected function sortByName(array $migration_state) {

The 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.

quietone’s picture

Status: Needs work » Needs review
FileSize
32.19 KB
3.09 KB

@joachim, thanks for the reminder. I wanted to come back to this just for that and I completely forgot.

This should be an improvement.

quietone’s picture

Issue tags: +blocker

This is a blocker to a prettier review form, #3088215: Use styling from Upgrade Status module on Review form

benjifisher’s picture

Status: Needs review » Needs work
FileSize
88 KB
86.83 KB

I have finished reviewing the patch, including the tests. I have just a few more requests, mostly to the documentation blocks.

  1. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -45,22 +47,39 @@ class ReviewForm extends MigrateUpgradeFormBase {
    ...
    +  /**
    +   * Source system data.
    +   *
    +   * @var array
    +   */
    +  protected $systemData;
        

    Since this variable is not set in the constructor, it would be helpful to mention where it is set: buildForm().

  2. This is totally out of scope, but I had a look at Drupal\migrate_drupal\MigrationState:
      public function getUpgradeStates($version, array $source_system_data, array $migrations) {
        return $this->buildUpgradeState($version, $source_system_data, $migrations);
      }
        

    Why do we have one function that is just a wrapper for another function? Then, in the doc block of buildUpgradeState(),

       * @code
       * [
       *   'finished' => [
       *     'menu' => [
       *       'menu_link_content','menu_ui','system'
       *     ]
       *   ],
       * ]
       * @endcode
        

    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.

  3. @@ -254,4 +278,52 @@ public function getConfirmText() {
    ...
    +   * @param array $migration_state
    +   *   A migration state array using module machine names.
    +   *
    +   * @return array
    +   *   An array of module data, keyed and sorted by the source module name. Each
    +   *   array of source module data contains the destination modules names in a
    +   *   sorted CSV format and the source module machine name.
        

    It will help if the @param comment includes "as returned by MigrationState::getUpgradeStates() and if the @return comment explicitly mentions the keys source and destination. 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.

  4. @@ -86,7 +87,7 @@ public function testMigrateUpgradeReviewPage() {
    ...
         $available_paths = $this->getAvailablePaths();
    -    $available_paths = array_diff($available_paths, [$module]);
    +    $available_paths = array_diff($available_paths, [$module_name]);
        

    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 of getMissingPaths().

  5. +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php
    @@ -63,81 +63,81 @@ protected function getSourceBasePath() {
       protected function getAvailablePaths() {
         return [
           // Aggregator is set not_finished in migrate_sate_not_finished_test.
        

    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) is d7_dump, then the correct command is php 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.

screenshot showing modules that will not be upgraded


screenshot showing modules that will be upgraded

quietone’s picture

Status: Needs work » Needs review
FileSize
3.49 KB
33.78 KB

Thanks 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.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community

@quietone, thanks for the fixes! I think this looks good.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
+++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
@@ -254,4 +278,54 @@ public function getConfirmText() {
+      $output[$source_module_name] = [
+        'source' => $source_module,
+        'destination' => implode(', ', $destination_module_names),
+      ];

I 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?

quietone’s picture

Assigned: Unassigned » quietone
Issue tags: +DrupalSouth 2019

Working on this now

quietone’s picture

Fixes 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.

quietone’s picture

Status: Needs work » Needs review
rooby’s picture

Status: Needs review » Reviewed & tested by the community

The patch in #76 addresses the issues raised in #74.
No new issues from me.
Back to RTBC.

quietone’s picture

Assigned: quietone » Unassigned
Issue summary: View changes

Update IS with latest screenshot

quietone’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs usability review

@rooby, thanks for the vote of confidence. However, this needs a usability review before that.

heddn’s picture

Do we need to put the D8 module machine name in parens after them?

quietone’s picture

Nice 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.

benjifisher’s picture

Issue summary: View changes

I am changing the screenshots in the issue summary from links to embedded images, and moving them to the "User interface changes" section.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs usability review

Usability 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.)

quietone’s picture

@benjifisher, thanks for taking this to the usability meeting.

we should use this incremental improvement for now.

I agree!

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 76: 3024682-76.patch, failed testing. View results

quietone’s picture

Status: Needs work » Reviewed & tested by the community

Test failure was unrelated to this patch. Retested and back to green

quietone’s picture

Issue tags: +Needs reroll
quietone’s picture

Status: Reviewed & tested by the community » Needs work

Forgot to set to NW

sokru’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
35.04 KB

Reroll from #76.

Status: Needs review » Needs work

The last submitted patch, 90: 3024682-90.patch, failed testing. View results

quietone’s picture

FileSize
266 bytes

@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.

quietone’s picture

Status: Needs work » Needs review
FileSize
582 bytes
35.01 KB

And fix the test of the Review page.

benjifisher’s picture

The 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

quietone’s picture

@benjifisher, thanks for the correction.

quietone’s picture

working on a reroll but having trouble running the functional tests locally. Let's see what the testbot finds.

Status: Needs review » Needs work

The last submitted patch, 96: 3024682-96.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
10.35 KB
36.75 KB

Just 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.

benjifisher’s picture

Assigned: Unassigned » benjifisher

I am reviewing this today.

I already see one little nit to pick, but nothing serious so far.

benjifisher’s picture

Assigned: benjifisher » Unassigned
Status: Needs review » Needs work

@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.

  1.   +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
      @@ -119,22 +139,24 @@ public function buildForm(array $form, FormStateInterface $form_state) {
      ...
           if (isset($display[MigrationState::NOT_FINISHED])) {
      -      foreach ($display[MigrationState::NOT_FINISHED] as $source_module => $destination_modules) {
      +      $output = $this->prepareOutput($display[MigrationState::NOT_FINISHED]);
      +      foreach ($output as $source_module => $data) {
               $missing_count++;
               // Get the migration status for this $source_module, if a module of the
               // same name exists on the destination site.
               $missing_module_list['module_list'][] = [
      -          'source_module' => [
      +          'source_module_name' => [
                   '#type' => 'html_tag',
                   '#tag' => 'span',
      -            '#value' => $source_module,
      +            '#value' => $data['source_module_name'],

    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.

  2.   @@ -160,20 +187,22 @@ public function buildForm(array $form, FormStateInterface $form_state) {
      ...
           if (isset($display[MigrationState::FINISHED])) {
      -      foreach ($display[MigrationState::FINISHED] as $source_module => $destination_modules) {
      +      $output = $this->prepareOutput($display[MigrationState::FINISHED]);
      +      foreach ($output as $source_module => $data) {

    Same comments here (key is not needed, '#type' => 'html_tag' could be simplified).

  3.   @@ -254,4 +288,57 @@ public function getConfirmText() {
      ...
      +  /**
      +   * Prepare the migration state data for output.
      +   *
      +   * Each source and destination module_name is changed to the human readable
      +   * name, the destination modules are put into a CSV format and everything is
      +   * sorted.
      +   *
      +   * @param array $migration_state
      +   *   A migration state array where the 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.
      +   *
      +   * @return array
      +   *   An array of module data, keyed and sorted by the source module name. Each
      +   *   array of source module data contains the destination modules names in a
      +   *   sorted CSV format and the source module machine name.
      +   */

    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.

  4.   +    foreach ($migration_state as $source_machine_name => $destination_modules) {
      +      $data = unserialize($this->systemData['module'][$source_machine_name]['info']);
      +      $source_machine_name_name = $data['name'] ?: $source_machine_name;
      ...
      +      $output[$source_machine_name] = [
      +        'source_module_name' => $source_machine_name_name,

    Please change the variable name from $source_machine_name_name to $source_module_name or explain why you think the current name is better.

  5.   +    usort($output, function ($a, $b) {
      +      return strcmp($a['source_module_name'], $b['source_module_name']) <=> 0;
      +    });

    Either return strcmp($a['source_module_name'], $b['source_module_name']); or return $a['source_module_name'] <=> $b['source_module_name'];.

  6.   +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MultilingualReviewPageTestBase.php
      @@ -72,6 +72,7 @@ public function testMigrateUpgradeReviewPage() {
           // does not need any. Test with a module that is was in both Drupal 6 and
           // Drupal 7 core.
           $module = 'help';
      +    $module_name = 'Help';

    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.

  7.   +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d6/MultilingualReviewPageTest.php
      @@ -60,83 +60,82 @@ protected function getSourceBasePath() {
          */
         protected function getAvailablePaths() {
           return [
      -      // Aggregator is set not_finished in migrate_sate_not_finished_test.
      -      'aggregator',
      -      'blog',
      -      'blogapi',
      -      'book',
      ...
      +      'Aggregator',
      +      'Block translation',
      +      'Blog',
      +      'Blog API',
      +      'Book',

    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.

  8.   --- /dev/null
      +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/NoMultilingualReviewPageTest.php
      @@ -0,0 +1,179 @@

    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?

  9.   +  /**
      +   * {@inheritdoc}
      +   */
      +  public static $modules = [
      +    'file',
      +    'language',
      +    'content_translation',
      +    'config_translation',
      +    'migrate_drupal_ui',
      +    'telephone',
      +    'aggregator',
      +    'book',
      +    'forum',
      +    'statistics',
      +  ];

    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.

quietone’s picture

Status: Needs work » Needs review
FileSize
37.17 KB
6.45 KB

Thanks 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:

       [0] => Array
           (
               [source_module_name] => CCK translation
               [source_machine_name] => i18ncck
               [destination] => Configuration Translation
           )

       [1] => Array
           (
               [source_module_name] => Contact
               [source_machine_name] => contact
               [destination] =>

)

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.

Status: Needs review » Needs work

The last submitted patch, 101: 3024682-101.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
2.09 KB
38.96 KB

Oh, I forgot to change the assertions on the review page to search for a div and not a span.

benjifisher’s picture

Status: Needs review » Needs work

@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.

  1.   +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
      @@ -119,31 +139,31 @@ public function buildForm(array $form, FormStateInterface $form_state) {
      ...
      +          'source_module_name' => [
      +            '#prefix' => '<div class = "upgrade-analysis-report__status-icon upgrade-analysis-report__status-icon--error">',
      +            '#suffix' => $data['source_module_name'],
      +          ],

    and

      @@ -160,29 +180,29 @@ public function buildForm(array $form, FormStateInterface $form_state) {
      ...
      +          'source_module_name' => [
      +            '#prefix' => '<div class = "upgrade-analysis-report__status-icon upgrade-analysis-report__status-icon--checked">',
      +            '#suffix' => $data['source_module_name'],
      +          ],

    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.)

      'source_module_name' => [
        '#prefix' => '<div class="upgrade-analysis-report__status-icon upgrade-analysis-report__status-icon--error">',
        '#suffix' => '</div>',
        '#plain_text' => $data['source_module_name'],
      ],
  2. Now that the render array is more consistent, I notice a different inconsistency:

     +          'source_machine_name' => [
     +            'source_machine_name' => [
     +              '#plain_text' => $data['source_machine_name'],
                  ],
                ],
                'destination_module' => [
     -            '#plain_text' => $destination_modules,
     +            '#plain_text' => $data['destination'],

    We can get rid of one level of nesting for 'source_machine_name', right?

  3.   @@ -254,4 +274,57 @@ public function getConfirmText() {
      ...
      +   * @return array
      +   *   An indexed array of module data, sorted by the source module name. Each
      +   *   array of contains the source module name, the source module machine name,
      +   *   and the the destination module names in a sorted CSV format.
      +   */

    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".

  4. Thanks for clarifying the history of the test (#100.8).

quietone’s picture

Status: Needs work » Needs review
FileSize
4.72 KB
37.2 KB

And here are fixes for #1-3 above.

@benjifisher, thanks for the code for #1.

Status: Needs review » Needs work

The last submitted patch, 105: 3024682-105.patch, failed testing. View results

benjifisher’s picture

Status: Needs work » Reviewed & tested by the community

Regarding #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

There was 1 failure:

1) Drupal\Tests\node\Functional\NodeCreationTest::testAuthoredDate
Failed asserting that '1586018408' matches expected 1586014808.

/var/www/html/core/modules/node/tests/src/Functional/NodeCreationTest.php:201

Let's give it another chance.

jungle’s picture

1586018408 - 1586014808 = 1 hour, BTW

Version: 8.9.x-dev » 9.1.x-dev

Drupal 8.9.0-beta1 was released on March 20, 2020. 8.9.x is the final, long-term support (LTS) minor release of Drupal 8, which means new developments and disruptive changes should now be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

xjm’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

This 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!

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
Issue tags: -Needs issue summary update
FileSize
5.41 KB
35.59 KB

I reviewed the patch and search the issue for all references to 'scope' to identify what can be removed and then reverted those changes.

Status: Needs review » Needs work

The last submitted patch, 111: 3024682-111.patch, failed testing. View results
- codesniffer_fixes.patch Interdiff of automated coding standards fixes only.

sokru’s picture

Issue summary: View changes
FileSize
103.15 KB
126.54 KB

Updated summary with fresh screenshots based on patch on #105.

quietone’s picture

Status: Needs work » Needs review
FileSize
1.41 KB
35.6 KB

sokru, 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.

Status: Needs review » Needs work

The last submitted patch, 114: 3024682-114.patch, failed testing. View results

quietone’s picture

Status: Needs work » Needs review
FileSize
726 bytes
35.6 KB

This 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.

quietone’s picture

A follow up has been made to work on the out of scope changes that have been removed, #3133183: Various fixes to ReviewForm constructor.

sokru’s picture

Issue summary: View changes
FileSize
114.23 KB
93.7 KB

Updated screenshots from patch 116 to summary. Wonder if the column header be "Drupal 9" instead of "Drupal 8" ?

quietone’s picture

@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.

quietone’s picture

On the other hand, that recent change may be considered out of scope too. In that case, use the patch in #116.

benjifisher’s picture

Title: Migrate UI - use human-friendly module names on the Review form » Migrate UI - add human-friendly module names to the Review form
Issue summary: View changes
Status: Needs review » Needs work
Issue tags: +Needs followup

I 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:

@@ -55,12 +71,13 @@ class ReviewForm extends MigrateUpgradeFormBase {
...
-   * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
-   *   The config factory service.
+   * @param \Drupal\Core\Extension\ModuleHandler $module_handler
+   *   The module handler service.

We should add the new @param comment without removing the one for $config_factory.

  1. I am updating the title. The previous title was consistent with the original approach (replacing machine name with friendly name) as well as the current approach (using both in separate columns) but we may as well be specific.
  2. I am updating the remaining/completed tasks in the issue summary. In general, I do not think it is useful to list "Review" and "Commit" as steps there.
  3. I am adding the "Needs followup" issue tag. See the list below.
  4. The change in #119 is out of scope, so I am including it in the list of followup issues. As the "before" screenshot shows, the form already says "Drupal 8". That should be fixed, but it is not part of the current issue.

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.

  1. Sort use statements alphabetically.
  2. Various fixes to the constructor:
    1. Make order of parameters match the constructor in the parent class.
    2. Use snake_casefor parameters and lowerCamelCase for properties.
    3. Make @param comments in the same order as the function declaration.
  3. Simplify buildForm() by using '#prefix' and '#suffix'.
  4. Update "Drupal 8" in comments, table header, and elsewhere so that is shows the correct version.

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.

quietone’s picture

Status: Needs work » Needs review
FileSize
715 bytes
36.44 KB

@benjifisher, thanks, I missed that deletion.

This patch fixes #121. Still to do is create the new issues.

quietone’s picture

#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

quietone’s picture

Right, another mistake in my life. Ignore the patch in #122, I started from #119 instead of #116. This one is based on #116.

quietone’s picture

quietone’s picture

Issue tags: -Needs followup

All followup are made, I think.

benjifisher’s picture

Thanks 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

  1. Revert the change that is deferred to #3134308: Change 'is was' to 'is' in comments.
  2. Add return type void to the setUp() 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.

quietone’s picture

@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

benjifisher’s picture

@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.

xjm’s picture

Status: Reviewed & tested by the community » Needs work

Thanks, just a few more small things.

  1. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -44,6 +46,20 @@ class ReviewForm extends MigrateUpgradeFormBase {
    +   * @var array
    
    @@ -254,4 +284,58 @@ public function getConfirmText() {
    +   * @param array $migration_state
    ...
    +   * @return array
    

    We can almost always be more specific than array in data type documentation, e.g. is it string[]? array[]?string[][]? The more specific, the better.

  2. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -57,10 +73,13 @@ class ReviewForm extends MigrateUpgradeFormBase {
    -  public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory) {
    +  public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory, ModuleHandler $module_handler) {
    

    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).

  3. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -119,22 +139,24 @@ public function buildForm(array $form, FormStateInterface $form_state) {
    -        // Get the migration status for this $source_module, if a module of the
    +        // Get the migration status for each source module, if a module of the
    

    Looks out of scope.

  4. +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
    @@ -254,4 +284,58 @@ public function getConfirmText() {
    +   * Each source and destination module_name is changed to the human readable
    

    Nit: human-readable.

  5. +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/MigrateUpgradeTestBase.php
    @@ -145,7 +145,7 @@ protected function assertUpgradePaths(WebAssert $session, array $available_paths
        *
        * @return string[]
    -   *   An array of available upgrade paths.
    +   *   An array of source modules names that will be upgraded.
        */
       abstract protected function getAvailablePaths();
     
    @@ -153,7 +153,7 @@ protected function assertUpgradePaths(WebAssert $session, array $available_paths
    
    @@ -153,7 +153,7 @@ protected function assertUpgradePaths(WebAssert $session, array $available_paths
        * Gets the missing upgrade paths.
        *
        * @return string[]
    -   *   An array of missing upgrade paths.
    +   *   An array of source modules names that will not upgraded.
        */
    

    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.

  6. +++ b/core/modules/migrate_drupal_ui/tests/src/Functional/d7/MultilingualReviewPageTest.php
    @@ -140,39 +140,39 @@ protected function getAvailablePaths() {
    -      // Action is set not_finished in migrate_sate_not_finished_test.
    -      // Aggregator is set not_finished in migrate_sate_not_finished_test.
    ...
    -      // Block is set not_finished in migrate_sate_not_finished_test.
    ...
    +      // Action is set not_finished in migrate_state_not_finished_test.
    +      // Aggregator is set not_finished in migrate_state_not_finished_test.
    ...
    +      // Block is set not_finished in migrate_state_not_finished_test.
    

    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.

quietone’s picture

Status: Needs work » Needs review
FileSize
2.11 KB
34.42 KB

Addressing 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.

larowlan’s picture

This 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 -

+++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
@@ -254,4 +284,58 @@ public function getConfirmText() {
+            $destination_module_names[] = 'Core';

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.

benjifisher’s picture

Status: Needs review » Needs work

The 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.

quietone’s picture

Issue summary: View changes
Status: Needs work » Needs review
FileSize
346 bytes
34.53 KB
14.46 KB
18.32 KB

And 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?

quietone’s picture

@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.

benjifisher’s picture

Status: Needs review » Needs work
  1.   +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
      @@ -254,4 +284,58 @@ public function getConfirmText() {
      ...
      +   * @param array $migration_state
      +   *   An array where the 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.
      +   *
      +   * @return string[][]
      +   *   An indexed array of arrays that contain module data, sorted by the source
      +   *   module name. Each sub-array of contains the source module name, the
      +   *   source module machine name, and the the destination module names in a
      +   *   sorted CSV format.
      +   */
      +  protected function prepareOutput(array $migration_state) {

    Follow-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.

  2. I am not sure how the BC policy applies to @internal classes as discussed in #130.2 and #131.

  3. This patch fixes #130.3 and #130.4.

  4. I do not have time right now to review the changes to the test classes. I also have not thought about #132.

quietone’s picture

1. 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.

quietone’s picture

Status: Needs work » Needs review

NR for testing

kim.pepper’s picture

FileSize
35.21 KB
2.61 KB

This addresses #130.2 by adding BC to the constructor.

benjifisher’s picture

Status: Needs review » Needs work

Looking 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 the use statements.

I will have a closer look after I get some sleep.

kim.pepper’s picture

@benjifisher replacing one import with another means we are changing those lines. I don't think that is out of scope.

quietone’s picture

Status: Needs work » Needs review

@kim.pepper, thank you.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community

I 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.

  1.   +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
      @@ -3,12 +3,14 @@
       namespace Drupal\migrate_drupal_ui\Form;
    
       use Drupal\Core\Config\ConfigFactoryInterface;
      +use Drupal\Core\Extension\Exception\UnknownExtensionException;
      +use Drupal\Core\Extension\ModuleHandlerInterface;
       use Drupal\Core\Form\FormStateInterface;
       use Drupal\Core\State\StateInterface;
       use Drupal\Core\TempStore\PrivateTempStoreFactory;
      -use Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch;
      -use Drupal\migrate_drupal\MigrationState;
       use Drupal\migrate\Plugin\MigrationPluginManagerInterface;
      +use Drupal\migrate_drupal\MigrationState;
      +use Drupal\migrate_drupal_ui\Batch\MigrateUpgradeImportBatch;

    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".

  2. 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.

     +++ b/core/modules/migrate_drupal_ui/src/Form/ReviewForm.php
     @@ -57,10 +73,17 @@ class ReviewForm extends MigrateUpgradeFormBase {
     -  public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory) {
     +  public function __construct(StateInterface $state, MigrationPluginManagerInterface $migration_plugin_manager, PrivateTempStoreFactory $tempstore_private, MigrationState $migrationState, ConfigFactoryInterface $config_factory, ModuleHandlerInterface $module_handler = NULL) {
          parent::__construct($config_factory, $migration_plugin_manager, $state, $tempstore_private);
          $this->migrationState = $migrationState;
     +    if (!$module_handler) {
     +      @trigger_error('Calling ' . __METHOD__ . ' without the $module_handler argument is deprecated in drupal:9.1.0 and will be required in drupal:10.0.0. See https://www.drupal.org/node/3136769', E_USER_DEPRECATED);
     +      $module_handler = \Drupal::service('module_handler');
     +    }
     +    $this->moduleHandler = $module_handler;

    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:

     public function __construct(array $configuration, $plugin_id, $plugin_definition, Connection $database, EntityTypeManagerInterface $entity_type_manager = NULL, EntityFieldManagerInterface $entity_field_manager = NULL) {
       parent::__construct($configuration, $plugin_id, $plugin_definition);
       $this->database = $database;
       if (!$entity_type_manager) {
         @trigger_error("Not passing the entity type manager to the NodeNewComments constructor is deprecated in drupal:8.8.0 and will be required in drupal 9.0.0. @see https://www.drupal.org/node/3047897");
         $entity_type_manager = \Drupal::entityTypeManager();
       }
       if (!$entity_field_manager) {
         @trigger_error("Not passing the entity type manager to the NodeNewComments constructor is deprecated in drupal:8.8.0 and will be required in drupal 9.0.0. @see https://www.drupal.org/node/3047897");
         $entity_field_manager = \Drupal::service('entity_field.manager');
       }

    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:

     if (!$file_system) {
       @trigger_error('Calling FileSystemForm::__construct() without the $file_system argument is deprecated in drupal:8.8.0. The $file_system argument will be required in drupal:9.0.0. See https://www.drupal.org/node/3039255', E_USER_DEPRECATED);
       $file_system = \Drupal::service('file_system');
     }
  3.   @@ -254,4 +288,58 @@ public function getConfirmText() {
           return $this->t('Perform upgrade');
         }
    
      +  /**
      +   * Prepare the migration state data for output.
      +   *
      +   * Each source and destination module_name is changed to the human-readable
      +   * name, the destination modules are put into a CSV format, and everything is
      +   * sorted.
      +   *
      +   * @param array $migration_state
      +   *   An array where the 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.
      +   *
      +   * @return string[][]
      +   *   An indexed array of arrays that contain module data, sorted by the source
      +   *   module name. Each sub-array contains the source module name, the source
      +   *   module machine name, and the the destination module names in a sorted CSV
      +   *   format.
      +   */
      +  protected function prepareOutput(array $migration_state) {

    I still think the @param should be changed to string[][]. 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.

  4. 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.

quietone’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
696 bytes
35.21 KB

#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.

benjifisher’s picture

Status: Needs review » Reviewed & tested by the community

@quietone:

Thanks. That resolves one of my reservations. Yes, it should be string[] and not string[][].

Back to RTBC.

larowlan’s picture

Updating issue credits

  • larowlan committed d4c3b72 on 9.1.x
    Issue #3024682 by quietone, sokru, kim.pepper, benjifisher, webchick,...
larowlan’s picture

Status: Reviewed & tested by the community » Fixed

🎉 Committed d4c3b72 and pushed to 9.1.x. Thanks!

Published the change record

benjifisher’s picture

I 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.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.