Review main Merged

72395[BUGFIX] Make file processing configuration serializable

Roman Büchler CR +2 V +2 Normal +188 −3 updated 11/19/22, 16:49

Commit message

This allows to use the mask property from the TypoScript
imgResource function again.

Review

  • Code review CR +2 Done
    • Nikita Hovratov +2
    • Christian Kuhn +1
  • Verified V +2 Done
    • Nikita Hovratov +2
    • Christian Kuhn +1
    • core-ci +1 CI

Issues 1

Files 7

Review log 68102

Show 5077 earlier messages
  1. Roman Büchler uploaded patch set 1 11/30/21, 08:08

  2. core-ci voted on patch set 1 V -1 11/30/21, 08:10 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20181

  3. Roman Büchler uploaded patch set 2 11/30/21, 08:39

  4. core-ci voted on patch set 2 V +1 11/30/21, 08:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20182

  5. Georg Ringer voted on patch set 2 V +1 CR +1 11/30/21, 08:57

  6. Oliver Hader commented on patch set 2 CR -1 11/30/21, 09:03

    Implementing serialization and denying deserialization at the same time does not seem to make sense. I guess(!) it would make sense to focus on the particular part when a ProcessedFiles is part other data that is serialized and exclude/handle ProcessedFile there explicitly...
  7. Oliver Hader commented on patch set 2 11/30/21, 09:06

    ProcessedFileTest.php:44

    e.g. use real backend user object instead of mocking it ``` $this->setUpBackendUserFromFixture(1); Bootstrap::initializeLanguageObject(); ```

    ProcessedFileTest.php:56

    FunctionalTestCase::pathsToProvideInTestInstance allows to provide files in a test scenario, no need to copy files around (unless it is a task to be tested, which does not seem the case here).
  8. Oliver Hader commented on patch set 2 11/30/21, 09:13

    Besides that, changing the way ProcessedFiles are serialized (in repository class) leads to changed SHA1 hashes - thus, every ProcessedFile will be regenerated with a different hash...
  9. Oliver Hader commented on patch set 2 11/30/21, 09:19

    ProcessedFile.php:146

    Side-note: Since this can only be solved by changing the implementation (the logic), it is actually a \LogicException (https://www.php.net/manual/en/class.logicexception.php)
  10. Helmut Hummel commented on patch set 2 11/30/21, 09:25

    Reply

    > I guess(!) it would make sense to focus on the particular part when a ProcessedFiles is part other data that is serialized and exclude/handle ProcessedFile there explicitly... Yeah, the file object must not be serialized at all.

    ProcessedFileTest.php:80

    This never worked, since the initial creation of FAL. I tried to look into this a bit several times, but this isn't easily solvable unfortunately.
  11. Roman Büchler uploaded patch set 3 12/04/21, 08:36

  12. core-ci voted on patch set 3 V -1 12/04/21, 08:38 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20542

  13. Roman Büchler uploaded patch set 4 12/04/21, 08:41

  14. core-ci voted on patch set 4 V -1 12/04/21, 08:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20543

  15. Roman Büchler uploaded patch set 5 12/04/21, 08:52

  16. core-ci voted on patch set 5 V -1 12/04/21, 08:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20544

  17. Roman Büchler uploaded patch set 6 12/04/21, 08:57

  18. core-ci voted on patch set 6 V -1 12/04/21, 08:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20545

  19. Roman Büchler uploaded patch set 7 12/04/21, 09:02

  20. core-ci voted on patch set 7 V +1 12/04/21, 09:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20546

  21. Roman Büchler commented on patch set 7 12/10/21, 06:48

    Reply

    Actually this shouldn't cause problems since the SHA1 hashes just change when a configuration contains a maskImages element which is not the case since it results in an exception.

    Reply

    The consideration do disallow deserialization was based on the understanding that we mainly serialize to get the image signature (used to find out whether an image has to be generated). As far as I see serialization from an array that might contain an instance from ProcessedFile takes place in ProcessedFileRepository, ProcessedFile and AbstractTask. What is the reason a file object shouldn't be serialized? Would it be better to substitue the serialization in the above mentioned classes by using a service method or a trait?
    > Patch Set 2: Verified+1 > > Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20182 Thank you for all the inputs! I couldn't find a better solution. What do you think about the latest change, could that be applied? Eventough it is not perfect it would avoid the exception and the mask function from imgresource could be used. As well it shouldn't impact existing image processing.

    ProcessedFile.php:146 Reply

    Ack

    ProcessedFileTest.php:44 Reply

    Ack

    ProcessedFileTest.php:56 Reply

    Ack

    ProcessedFileTest.php:80 Reply

    I found as well that adaption is further needed in LocalCropScaleMaskHelper. A seperate ticket to address it could be opened once the serialization gets solved.
  22. Roman Büchler commented on patch set 7 01/12/22, 19:26

    Hi Oliver, Gregor I am not sure if there is some action required from my side or what I could do to get this issue solved... do you have any hint? Best greetings, Roman
  23. Roman Büchler uploaded patch set 8 05/16/22, 07:36

  24. core-ci voted on patch set 8 V -1 05/16/22, 07:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27246

  25. Roman Büchler uploaded patch set 9 05/16/22, 07:46

  26. core-ci voted on patch set 9 V -1 05/16/22, 07:55 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27247

  27. Roman Büchler uploaded patch set 10 05/16/22, 08:07

  28. core-ci voted on patch set 10 V +1 05/16/22, 08:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27248

  29. Roman Büchler uploaded patch set 11 05/17/22, 07:21

  30. core-ci voted on patch set 11 V +1 05/17/22, 07:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27277

  31. Roman Büchler commented on patch set 11 05/18/22, 06:01

    Reply

    Done
    What about patch set 11?

    ProcessedFileTest.php:80 Reply

    Done
  32. Roman Büchler uploaded patch set 12 05/21/22, 05:21

  33. core-ci voted on patch set 12 V -1 05/21/22, 05:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27365

  34. Roman Büchler uploaded patch set 13 05/21/22, 05:41

  35. core-ci voted on patch set 13 V +1 05/21/22, 05:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27366

  36. Oliver Klee commented on patch set 13 05/21/22, 08:48

    ConfigurationServiceTest.php:28

    Nice-to-have: You can add annotations to test cases to mark for PHPUnit which class(es) the tests are about. This helps make the code coverage more precise. /** * @covers \TYPO3\CMS\Core\Resource\Service\ConfigurationService */ Please note that this needs to be the FQCN plus the leading backslash (for the benefit of human readers). Ditto for the other testcase.
  37. Roman Büchler uploaded patch set 14 05/21/22, 09:03

  38. core-ci voted on patch set 14 V -1 05/21/22, 09:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27369

  39. Oliver Klee commented on patch set 14 05/21/22, 09:19

    ProcessedFileTest.php:49

    Sorry, my bad for not mentioning this: Please only add the @covers annotation to the test classes, not to test methods, and only for covering classes, not for covering methods (as this is not recommended: https://phpunit.readthedocs.io/en/9.5/annotations.html#covers)
  40. Roman Büchler uploaded patch set 15 05/21/22, 09:21

  41. core-ci voted on patch set 15 V +1 05/21/22, 09:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27370

  42. Roman Büchler commented on patch set 15 05/21/22, 09:38

    See patchset 15

    ProcessedFileTest.php:49 Reply

    Thank you!

    ConfigurationServiceTest.php:28 Reply

    Done
  43. Oliver Klee commented on patch set 15 05/21/22, 12:10

    ConfigurationService.php:3

    strict missing
  44. Roman Büchler uploaded patch set 16 05/21/22, 12:18

  45. core-ci voted on patch set 16 V +1 05/21/22, 12:26 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27374

  46. Roman Büchler commented on patch set 16 05/21/22, 12:30

    ConfigurationService.php:3 Reply

    Done
  47. Oliver Klee updated the commit message in patch set 17 05/21/22, 13:27

  48. core-ci voted on patch set 17 V +1 05/21/22, 13:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27375

  49. Oliver Klee wrote 06/10/22, 21:43

    Removed cc Oliver Klee.
  50. Oliver Klee commented on patch set 17 06/11/22, 10:32

    ProcessedFileTest.php:27

    We should also have this here additionally: @covers \TYPO3\CMS\Core\Resource\Service\ConfigurationService

    ConfigurationServiceTest.php:30

    This can be a unit test instead as we don't need the functional test things here.
  51. Oliver Klee commented on patch set 17 06/11/22, 10:33

    ConfigurationService.php:23

    We should have a short description as the first sentence explaining what this is.
  52. Roman Büchler uploaded patch set 18 06/20/22, 06:34

  53. Roman Büchler uploaded patch set 19 06/20/22, 06:44

  54. Roman Büchler uploaded patch set 20 06/20/22, 07:21

  55. Roman Büchler commented on patch set 20 06/20/22, 07:32

    ConfigurationService.php:23 Reply

    Done

    ProcessedFileTest.php:27 Reply

    Done

    ConfigurationServiceTest.php:30 Reply

    Done
  56. core-ci voted on patch set 18 V -1 06/20/22, 07:35 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28235

  57. Roman Büchler uploaded patch set 21 06/20/22, 07:41

  58. core-ci voted on patch set 19 V -1 06/20/22, 07:45 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28236

  59. core-ci voted on patch set 21 V -1 06/20/22, 07:48 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28238

  60. Roman Büchler uploaded patch set 22 06/20/22, 07:52

  61. core-ci voted on patch set 22 V -1 06/20/22, 08:00 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28239

  62. Roman Büchler uploaded patch set 23 06/20/22, 08:03

  63. core-ci voted on patch set 23 V +1 06/20/22, 08:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28240

  64. core-ci voted on patch set 20 V -1 06/20/22, 08:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28237

  65. Roman Büchler uploaded patch set 24 06/20/22, 08:34

  66. core-ci voted on patch set 24 V +1 06/20/22, 08:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28242

  67. Simon Schaufelberger voted on patch set 24 CR +1 06/23/22, 02:01

  68. Simon Schaufelberger rebased onto patch set 25 07/07/22, 01:12

  69. Simon Schaufelberger voted on patch set 25 V +1 CR +1 07/07/22, 01:12

  70. core-ci voted on patch set 25 V +1 07/07/22, 01:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/28696

  71. Oliver Klee commented on patch set 25 CR -1 11/08/22, 11:30

    We'll need to resolve the merge conflicts and rebase.
  72. Roman Büchler uploaded patch set 26 11/08/22, 17:33

  73. core-ci voted on patch set 26 V -1 11/08/22, 17:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33326

  74. Roman Büchler uploaded patch set 27 11/08/22, 19:22

  75. core-ci voted on patch set 27 V +1 11/08/22, 19:32 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33343

  76. Roman Büchler commented on patch set 27 11/12/22, 12:28

    This is now up to date again. Would somebody be available to review it?
  77. Oliver Klee commented on patch set 28 11/12/22, 14:49

    Published edit on patch set 27.
  1. core-ci voted on patch set 28 V +1 11/12/22, 14:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33637

  2. Andreas Kienast voted on patch set 28 CR +1 11/15/22, 07:16

  3. Simon Schaufelberger commented on patch set 28 11/15/22, 08:29

    ConfigurationService.php:33

    I have never seen a link to documentation in the source code so far. Can this stay or should it be removed since documentation might change any time.

    ConfigurationServiceTest.php:30

    We are actually just trying to get rid of prophecy. Can you replace it with a mock object?
  4. Roman Büchler uploaded patch set 29 11/15/22, 09:16

  5. core-ci voted on patch set 29 V +1 11/15/22, 09:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33741

  6. Roman Büchler commented on patch set 29 11/15/22, 09:30

    Thank you for the feedback. Just removed the link to the ts manual and replaced prophecy with mock.

    ConfigurationService.php:33 Reply

    Done

    ConfigurationServiceTest.php:30 Reply

    Done
  7. Simon Schaufelberger voted on patch set 29 CR +1 11/16/22, 00:57

  8. Anja Leichsenring voted on patch set 29 CR +2 11/17/22, 17:03

  9. Anja Leichsenring voted on patch set 29 CR 0 11/17/22, 17:03

  10. Anja Leichsenring commented on patch set 29 11/17/22, 17:09

    10.4 should IMO not be a target for this change. It is neither critical nor security relevant.
  11. Oliver Klee updated the commit message in patch set 30 11/17/22, 17:23

  12. Oliver Klee commented on patch set 30 11/17/22, 17:23

    Reply

    Done.
  13. core-ci voted on patch set 30 V +1 11/17/22, 17:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33882

  14. Christian Kuhn commented on patch set 30 11/19/22, 11:41

  15. Stefan Bürk rebased onto patch set 31 11/19/22, 12:47

  16. core-ci voted on patch set 31 V +1 11/19/22, 12:54 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33954

  17. Christian Kuhn uploaded patch set 32 11/19/22, 16:05

  18. core-ci voted on patch set 32 V +1 11/19/22, 16:13 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33961

  19. Nikita Hovratov uploaded patch set 33 11/19/22, 16:15

  20. Nikita Hovratov uploaded patch set 34 11/19/22, 16:17

  21. core-ci voted on patch set 34 V +1 11/19/22, 16:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33963

  22. core-ci voted on patch set 33 V +1 11/19/22, 16:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33962

  23. Christian Kuhn voted on patch set 34 V +1 CR +1 11/19/22, 16:49

  24. Nikita Hovratov voted on patch set 34 V +2 CR +2 11/19/22, 16:49

  25. Nikita Hovratov merged patch set 35 11/19/22, 16:49