Review main Merged Breaking

65549[!!!][FEATURE] Improve ValidatorTask

Oli Bartsch CR +2 V +2 Expert +1371 −423 updated 09/22/20, 10:09

Commit message

The ext:linkvalidator ValidatorTask has been improved. Therefore
the task was switched from marker based templates to FluidEmail.

The mail content was extended for a proper list of broken links
along with all necessary information such as record id, page id,
and so on. This allows editors now to easily access the records
with broken links without having to visit the backend module first.

Because of heavy refactoring and introduction of a new PSR-14
event, extension authors are now able to fully customize the mail
content and the configuration (such as to, from, subject) dynamically
(e.g. adding another recipient only on production context).

Both the task and its field provider got added strict types. The
task however currently still needs some type casts for backwards
compatibilty as the tasks state is stored as serialized string in
the database.

The whole link analyzing process was moved into the dedicated class
`LinkAnalyzerResult`.

A new field `languages` is introduced which allows to restrict
the report to the defined languages which is handy if different
tasks should be used (e.g. editors responsible for only one
localization).

Review

  • Code review CR +2 Done
    • Daniel Goerz +2
    • Sybille Peters +1
  • Verified V +2 Done
    • Daniel Goerz +2
    • Sybille Peters +1
    • TYPO3com +1 CI

Issues 1

Files 15

Review log 2745

Show 1120 earlier messages
  1. Oli Bartsch uploaded patch set 1 09/03/20, 18:15

  2. TYPO3com voted on patch set 1 V +1 09/03/20, 18:25 Completed build in 10m 40s on Thu, 3 Sep, 06:25 PM Test Summary: 73181 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5198

  3. Oli Bartsch uploaded patch set 2 09/04/20, 14:45

  4. Oli Bartsch wrote 09/04/20, 14:48

    Topic set to linkvalidator
  5. TYPO3com voted on patch set 2 V +1 09/04/20, 14:56 Completed build in 11m 15s on Fri, 4 Sep, 02:56 PM Test Summary: 73206 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5244

  6. Oli Bartsch uploaded patch set 3 09/07/20, 12:11

  7. TYPO3com voted on patch set 3 V +1 09/07/20, 12:22 Completed build in 10m 57s on Mon, 7 Sep, 12:22 PM Test Summary: 73224 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5321

  8. Oli Bartsch uploaded patch set 4 09/07/20, 22:43

  9. TYPO3com voted on patch set 4 V +1 09/07/20, 22:55 Completed build in 12m 30s on Mon, 7 Sep, 10:55 PM Test Summary: 73227 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5354

  10. Oli Bartsch uploaded patch set 5 09/08/20, 09:01

  11. TYPO3com voted on patch set 5 V +1 09/08/20, 09:12 Completed build in 10m 40s on Tue, 8 Sep, 09:12 AM Test Summary: 73226 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5357

  12. Oli Bartsch uploaded patch set 6 09/08/20, 10:01

  13. TYPO3com voted on patch set 6 V +1 09/08/20, 10:13 Completed build in 12m 00s on Tue, 8 Sep, 10:13 AM Test Summary: 73225 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5360

  14. Oli Bartsch uploaded patch set 7 09/08/20, 10:46

  15. TYPO3com voted on patch set 7 V +1 09/08/20, 10:58 Completed build in 11m 46s on Tue, 8 Sep, 10:58 AM Test Summary: 73233 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5363

  16. Oli Bartsch uploaded patch set 8 09/08/20, 18:02

  17. TYPO3com voted on patch set 8 V -1 09/08/20, 18:14 Completed build in 11m 20s on Tue, 8 Sep, 06:14 PM Test Summary: 73179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5376

  18. Oli Bartsch uploaded patch set 9 09/09/20, 07:21

  19. TYPO3com voted on patch set 9 V +1 09/09/20, 07:32 Completed build in 11m 21s on Wed, 9 Sep, 07:32 AM Test Summary: 73179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5382

  20. Daniel Goerz uploaded patch set 10 09/09/20, 07:47

  1. TYPO3com voted on patch set 10 V +1 09/09/20, 07:58 Completed build in 11m 28s on Wed, 9 Sep, 07:58 AM Test Summary: 73179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5385

  2. Oli Bartsch uploaded patch set 11 09/09/20, 08:15

  3. TYPO3com voted on patch set 11 V +1 09/09/20, 08:25 Completed build in 10m 33s on Wed, 9 Sep, 08:25 AM Test Summary: 73179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5387

  4. Oli Bartsch uploaded patch set 12 09/09/20, 16:04

  5. TYPO3com voted on patch set 12 V +1 09/09/20, 16:16 Completed build in 11m 04s on Wed, 9 Sep, 04:16 PM Test Summary: 73179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5418

  6. Oli Bartsch uploaded patch set 13 09/09/20, 22:44

  7. TYPO3com voted on patch set 13 V -1 09/09/20, 22:57 Completed build in 12m 39s on Wed, 9 Sep, 10:57 PM Test Summary: 73179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5455

  8. Oli Bartsch uploaded patch set 14 09/10/20, 08:52

  9. Oli Bartsch uploaded patch set 15 09/10/20, 10:18

  10. TYPO3com voted on patch set 15 V -1 09/10/20, 10:31 Completed build in 13m 19s on Thu, 10 Sep, 10:31 AM Test Summary: 1 of 73664 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5487

  11. TYPO3com commented on patch set 15 09/10/20, 11:00 Completed build in 13m 15s on Thu, 10 Sep, 11:00 AM Test Summary: 73178 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5490

  12. Oli Bartsch uploaded patch set 16 09/10/20, 11:10

  13. TYPO3com voted on patch set 16 V +1 09/10/20, 11:23 Completed build in 12m 31s on Thu, 10 Sep, 11:22 AM Test Summary: 73179 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5491

  14. Sybille Peters commented on patch set 16 V -1 09/16/20, 16:50

    These are the first 2 things I noticed: 1. I could not get it to work with depth "This page", but with depth = "1 level" it worked. This might be a one-off problem. I used basically the same settings as previously without the patch where it worked with "This page". 2. First impression is the list is not pretty. There is not enough padding between "Record type" and "Target". Only the ids are shown, not the page title or record header. I realize that there is not that much room and all should fit on one row per link. Some suggestions: - make the page uid a link to the page, e.t. https://domain/page - make the record uid a link to the record, e.g. https://domain/page#c1122 While (unless you have frontend editing) you can't edit in the frontend, it does give some more context. - switch order of Record, Page and Language to "Page", "Language", "Record" This is off the top of my hat, not every idea might have value. I have to think about this some more. I still plan to do a more full review the next few days.
  15. Oli Bartsch uploaded patch set 17 09/17/20, 12:07

  16. TYPO3com voted on patch set 17 V +1 09/17/20, 12:19 Completed build in 11m 49s on Thu, 17 Sep, 12:19 PM Test Summary: 73281 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5675

  17. Oli Bartsch commented on patch set 17 09/17/20, 12:36

    > Patch Set 16: Verified-1 > > These are the first 2 things I noticed: > > 1. I could not get it to work with depth "This page", but with depth = "1 level" it worked. This might be a one-off problem. I used basically the same settings as previously without the patch where it worked with "This page". > > 2. First impression is the list is not pretty. There is not enough padding between "Record type" and "Target". Only the ids are shown, not the page title or record header. > > I realize that there is not that much room and all should fit on one row per link. > > Some suggestions: > - make the page uid a link to the page, e.t. https://domain/page > - make the record uid a link to the record, e.g. https://domain/page#c1122 > > While (unless you have frontend editing) you can't edit in the frontend, it does give some more context. > > - switch order of Record, Page and Language to "Page", "Language", "Record" > > > This is off the top of my hat, not every idea might have value. I have to think about this some more. > > I still plan to do a more full review the next few days. Hi, thanks for your feedback. I adjusted the path according to your suggestions: 1. Fixed that. The current page was added manually to the `$pageList` but only if `$this->linkAnalyzer->extGetTreeList()` was not an empty string. However the result will always be an empty string if depth=0. The current page is now added prior to the check. 2. Added some styles for so called statistics to provide some padding. 3. There is, like mentioned by you, not that much space in the HTML version. I therefore added <span> tags for record id, page id and the target. They contain `title` and `aria-label` attributes with the corresponding record title / the full target url. 4. Added some notes to the HTML email explaining the Page column and the new possibility to get more information by e.g. hovering over the elements. 5. Switched the columns Page and Language as suggested. Adding links to the frontend will not work since tt_content is only one case. What to do with e.g. news records or alike. We furthermore can't assume that every content element has the `#cId` id set (especially custom content elements). Moreover the content element could be hidden so linking to the frontend would confuse rather than help. It's also possible that a record with a broken link is found in a folder with no associated site configuration. The good thing about this patch is that extension authors are now able to fully customize the report using either custom templates, the new PSR-14 event or both. In my opinion the current state is a solid default on which one can build additional features for custom needs.
  18. Daniel Goerz voted on patch set 17 CR +1 09/20/20, 17:16

  19. Sybille Peters commented on patch set 17 V +1 CR -1 09/21/20, 16:06

    Great work! This is a very useful improvement. I have a few nitpicks, I have not found anything severe. I tested basic functionality manually and running the new functional tests.
    typo: analyzing

    Breaking-29342-ImproveValidatorTask.rst:16

    typo: A Fluid template

    Breaking-29342-ImproveValidatorTask.rst:43

    This sounds like it is not possible to use a template at all. But it is possible, just slightly differently. I would maybe write something similar to: "It is no longer possible to set a custom marker based template file with `emailTemplateFile`. Instead, the new field `emailTemplateName` can be used to specify a Fluid template file, see Migration section below."

    Breaking-29342-ImproveValidatorTask.rst:64

    I think people might ask themselves, when exactly you MUST modify existing scheduler tasks. I think only, if a custom emailTemplateFile was set. Otherwise, it is not necessary to change the scheduler task. I would explicitly write something like that.

    Feature-29342-ImproveValidatorTask.rst:101

    typo: Whether

    ValidatorTask.php:556

    I think this behaviour is ok, but it would be cool if you could write a warning with the logging framework. Otherwise it may be a bit confusing. Especially since the default is used if the .html file exists, but the .txt does not.
  20. Oli Bartsch uploaded patch set 18 09/21/20, 17:31

  21. Oli Bartsch commented on patch set 18 09/21/20, 17:32

    Reply

    Done

    Breaking-29342-ImproveValidatorTask.rst:16 Reply

    Done

    Breaking-29342-ImproveValidatorTask.rst:43 Reply

    Done

    Breaking-29342-ImproveValidatorTask.rst:64 Reply

    Done

    Feature-29342-ImproveValidatorTask.rst:101 Reply

    Done

    ValidatorTask.php:556 Reply

    Done
  22. Sybille Peters voted on patch set 18 V +1 CR +1 09/21/20, 17:38

  23. TYPO3com voted on patch set 18 V +1 09/21/20, 17:43 Completed build in 12m 25s on Mon, 21 Sep, 05:43 PM Test Summary: 73664 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5794

  24. Daniel Goerz voted on patch set 18 V +2 CR +2 09/22/20, 10:09

  25. Daniel Goerz merged patch set 19 09/22/20, 10:09