Review main Merged

84383[BUGFIX] Improve and clean up Composer asset publishing

Garvin Hicking CR +2 V +2 Normal +144 −66 updated 06/20/24, 20:07

Commit message

The `PackageArtifactBuilder` takes care of publishing
`Resources/Public/...` directories of installed TYPO3 extensions
into the public directory.

In case this publishing fails, now a warning message is
presented, so that action can be taken.
Now also an info message is shown, when an extension does not
have a Resources/Public directory. This message is only shown
with increased verbosity, since this can be intentionally like so.

Further cleanup is preformed and code that does not apply any more
since composer installers v5 is required, is removed.

Last but not least, asset publishing is now decoupled into
a dedicated method, that receives installed packages as input
and returns resulting messages as output.

Future refactoring of the publishing code into a distinct
class is kept for a future change.

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Helmut Hummel +2
    • Garvin Hicking +1
    • Markus Klein +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Helmut Hummel +2
    • Garvin Hicking +1
    • core-ci +1 CI

Issues 1

Files 2

Review log 2841

Show 1116 earlier messages
  1. Garvin Hicking uploaded patch set 1 05/24/24, 11:40

  2. core-ci voted on patch set 1 V +1 05/24/24, 11:47 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58153

  3. Andreas Kienast commented on patch set 1 05/24/24, 12:08

    PackageArtifactBuilder.php:297

    Returning can be simplified to `return realpath($target) === realpath($junction)`, IMO no need for three `return` statements.

    PackageArtifactBuilder.php:322

    Can be simplified to `return realpath($target) === realpath($link)`;
  4. Garvin Hicking uploaded patch set 2 V +1 05/24/24, 12:15

    Fix return cognitive complexity
  5. Garvin Hicking commented on patch set 2 05/24/24, 12:15

    PackageArtifactBuilder.php:297 Reply

    Done

    PackageArtifactBuilder.php:322 Reply

    Done
  6. Andreas Kienast commented on patch set 2 05/24/24, 12:17

    PackageArtifactBuilder.php:308

    This return is superfluous.
  7. core-ci voted on patch set 2 V +1 05/24/24, 12:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58157

  8. Garvin Hicking uploaded patch set 3 V +1 05/24/24, 12:20

    Another return bites the dust
  9. Garvin Hicking commented on patch set 3 05/24/24, 12:20

    PackageArtifactBuilder.php:308 Reply

    Done
  10. core-ci voted on patch set 3 V +1 05/24/24, 12:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58158

  11. Helmut Hummel commented on patch set 3 CR -1 06/03/24, 08:40

    PackageArtifactBuilder.php:221

    the info here is obsolete imho. in any case please output all gathered warnings here

    PackageArtifactBuilder.php:271

    instead of tracking a bool, I suggest tracking the messages and output the messages in one place

    PackageArtifactBuilder.php:289

    try catch instead of if, see below

    PackageArtifactBuilder.php:297

    the method name does not reflect what the method does when returning bool. Please change to throw an exception instead. I suggest to create a new exception class for that.

    PackageArtifactBuilder.php:312

    same here
  12. Garvin Hicking uploaded patch set 4 CR -1 V +1 06/04/24, 08:23

    Use exceptions address code review
  13. Garvin Hicking commented on patch set 4 06/04/24, 08:25

    @typo3@helhum.io Thanks for your suggestions, I learned something here :-) Refactored this now to utilize exceptions (two of them - one for a symlink/junction failure, and one for the "publish resources" failure as such). The iteration is done on a new private property of the PackageArtifactBuilder; I think adding this as a property to the exception event is a bit of a hassle (with parent constructor calls), and IMO the output should possibly be created by evaluation of that property and note purely Exception "storage". What do you think?

    PackageArtifactBuilder.php:221 Reply

    Done

    PackageArtifactBuilder.php:271 Reply

    Done

    PackageArtifactBuilder.php:289 Reply

    Done

    PackageArtifactBuilder.php:297 Reply

    Done

    PackageArtifactBuilder.php:312 Reply

    Done
  14. core-ci voted on patch set 4 V -1 06/04/24, 08:29 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58668

  15. Garvin Hicking uploaded patch set 5 V -1 06/04/24, 09:50

    Fix duplicate exception code
  16. core-ci voted on patch set 5 V -1 06/04/24, 09:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58671

  1. Garvin Hicking uploaded patch set 6 V -1 06/04/24, 10:18

    Once more with exceptional feeling
  2. core-ci voted on patch set 6 V +1 06/04/24, 10:23 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58675

  3. Helmut Hummel uploaded patch set 7 V +1 06/04/24, 21:45

  4. core-ci voted on patch set 7 V -1 06/04/24, 21:51 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58701

  5. Garvin Hicking uploaded patch set 8 V -1 06/05/24, 07:27

    CGL minor rewording commit message update
  6. core-ci voted on patch set 8 V +1 06/05/24, 07:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58723

  7. Garvin Hicking uploaded patch set 9 V +1 06/05/24, 07:41

    Properly emit multiple warnings
  8. core-ci voted on patch set 9 V -1 06/05/24, 07:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58726

  9. Garvin Hicking uploaded patch set 10 V -1 06/05/24, 07:55

    CGL continued
  10. core-ci voted on patch set 10 V -1 06/05/24, 07:59 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58729

  11. Garvin Hicking uploaded patch set 11 V -1 06/05/24, 09:43

    DocBlock annotation fingers crossed
  12. core-ci voted on patch set 11 V +1 06/05/24, 09:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/58734

  13. Garvin Hicking commented on patch set 11 CR +1 V +1 06/05/24, 10:58

    Thanks a lot @typo3@helhum.io your rework makes sense to me (voting on "your implementation" ;). Tested this on my installation where I setup a few wrong directories and with missing write permissions. Couldn't test Windows Junctions though, but I believe that is left unchanged.
  14. Helmut Hummel commented on patch set 11 CR -1 06/15/24, 12:46

    Working on it right now
  15. Helmut Hummel commented on patch set 11 V -1 06/15/24, 12:56

    Symlinking is broken with this change. Will fix it
  16. Helmut Hummel uploaded patch set 12 CR +1 V +1 06/15/24, 15:56

  17. core-ci voted on patch set 12 V +1 06/15/24, 16:01 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59646

  18. Helmut Hummel voted on patch set 12 CR +1 V +1 06/15/24, 16:05

  19. Helmut Hummel uploaded patch set 13 CR +1 V +1 06/15/24, 20:55

  20. core-ci voted on patch set 13 V +1 06/15/24, 21:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/59656

  21. Markus Klein voted on patch set 13 CR +1 06/15/24, 21:10

  22. Garvin Hicking commented on patch set 13 CR +1 V +1 06/17/24, 12:48

    Since Helmut did a larger rewrite on this (much appreciated) I'm voting on the implementation. I've tested it and it seems to be more maintainable then the old solution, plus addresses the issue of the ticket. Thanks!
  23. Helmut Hummel voted on patch set 13 CR +2 V +2 06/19/24, 14:34

  24. Georg Ringer voted on patch set 13 CR +2 V +2 06/20/24, 20:07

  25. Georg Ringer merged patch set 14 06/20/24, 20:07