Review main Merged

73191[FEATURE] Add composer package name to backend routes

Christian Kuhn CR +2 V +2 Normal +166 −10 updated 02/18/22, 13:06

Commit message

We have three files that define backend routes:

* Configuration/Backend/Routes.php
* Configuration/Backend/AjaxRoutes.php
* Configuration/Backend/Modules.php

Routes defined by these files now contain the
composer package name ('name' attribute in composer.json)
of the package that defined the route as option.

Backend modules now have a getPackageName()
method.

This is useful as shown with #96962 and will
likely find further usages in the future.

Review

  • Code review CR +2 Done
    • Benjamin Franzke +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benjamin Franzke +2
    • Oli Bartsch +1
    • core-ci +1 CI

Issues 3

Files 20

Review log 2740

Show 1015 earlier messages
  1. Christian Kuhn uploaded patch set 1 01/28/22, 13:59

  2. Christian Kuhn commented on patch set 1 CR -1 01/28/22, 13:59

    only half of the party ...
  3. core-ci voted on patch set 1 V -1 01/28/22, 14:01 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/22626

  4. Christian Kuhn uploaded patch set 2 02/17/22, 09:07

  5. core-ci voted on patch set 2 V -1 02/17/22, 09:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23777

  6. Benjamin Franzke commented on patch set 2 02/17/22, 09:19

    hehe, EMU:addModule is already empty by now :) so this comment can for sure be dropped
  7. Christian Kuhn uploaded patch set 3 02/17/22, 14:54

  8. Christian Kuhn commented on patch set 3 02/17/22, 14:55

    Reply

    yes. working on it. new patch already adds 'composerName' for modules, too.
  9. core-ci voted on patch set 3 V -1 02/17/22, 15:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23811

  10. Christian Kuhn commented on patch set 3 02/18/22, 07:44

    Reply

    Done
  11. Christian Kuhn uploaded patch set 4 02/18/22, 07:59

  12. Christian Kuhn uploaded patch set 5 02/18/22, 08:00

  13. core-ci voted on patch set 4 V -1 02/18/22, 08:12 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23855

  14. core-ci voted on patch set 5 V -1 02/18/22, 08:16 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23856

  15. Christian Kuhn uploaded patch set 6 02/18/22, 08:27

  1. Christian Kuhn uploaded patch set 7 02/18/22, 08:30

  2. core-ci voted on patch set 6 V +1 02/18/22, 08:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23859

  3. core-ci voted on patch set 7 V +1 02/18/22, 08:46 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23861

  4. Benni Mack commented on patch set 7 02/18/22, 10:01

    BaseModule.php:60

    getPackageName() feels more consistent to other places we use composer package names.

    ServiceProvider.php:43

    can't this be resolved by the composer manifest?
  5. Christian Kuhn commented on patch set 7 02/18/22, 10:09

    BaseModule.php:60 Reply

    Ack

    ServiceProvider.php:43 Reply

    no. this is due to the way ServiceProviders are solved: they need to set it (same solution as with 'getPackagePath()' above. Only PseudoServiceProviders can do that automatically (got that solution from Benjamin).
  6. Christian Kuhn uploaded patch set 8 02/18/22, 10:19

  7. Christian Kuhn updated the commit message in patch set 9 02/18/22, 10:20

  8. Oli Bartsch commented on patch set 9 CR -1 02/18/22, 10:24

    BaseModule.php:60

    I don't see the need to make this public API. Especially because we only need it for the getDefaultRouteOptions(). In case you insist on this method, it has to be declared in the interface.

    BaseModule.php:211

    Please secure this with a null coalescing operator and additionally cast to string, like done for the other values.

    ExtbaseModule.php:58

    I think we should just access this->composerName

    AbstractServiceProvider.php:100

    Will fail in case $definedRoutesInPackage is not an array

    AbstractServiceProvider.php:159

    Will fail in case $definedModulesInPackage is not an array

    Feature-96733-NewBackendModuleRegistrationAPI.rst:263

    Returns the composer package name of .. But please see my comment regarding this method in the BaseModule first.

    Feature-96961-BackendRoutesContainComposerName.rst:18

    Should we use the FQDN here, since Core defines different "Route" classes?
  9. Christian Kuhn commented on patch set 9 02/18/22, 10:31

    will take care of further notes with an additional push.

    BaseModule.php:211 Reply

    why? it's always set by the Services.

    AbstractServiceProvider.php:100 Reply

    yes. and it should fail if it is not an array.

    AbstractServiceProvider.php:159 Reply

    yes. and it should fail if that require does not return an array.
  10. core-ci voted on patch set 8 V -1 02/18/22, 10:33 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23865

  11. core-ci voted on patch set 9 V -1 02/18/22, 10:34 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23866

  12. Christian Kuhn commented on patch set 9 02/18/22, 10:42

    BaseModule.php:60 Reply

    Ack

    BaseModule.php:211 Reply

    i see no need for this, but i'll do it nevertheless.

    ExtbaseModule.php:58 Reply

    Done

    AbstractServiceProvider.php:100 Reply

    sanitized it.

    AbstractServiceProvider.php:159 Reply

    sanitized it.

    Feature-96733-NewBackendModuleRegistrationAPI.rst:263 Reply

    Done

    Feature-96961-BackendRoutesContainComposerName.rst:18 Reply

    Done
  13. Christian Kuhn uploaded patch set 10 02/18/22, 10:42

  14. core-ci voted on patch set 10 V +1 02/18/22, 10:50 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23867

  15. Benjamin Franzke commented on patch set 10 02/18/22, 11:55

    Module.php:42

    typo3/sysext/core/Classes/Package/AbstractServiceProvider.php provides absolutePackagePath for regular routes (which is good), that should be added in here as well, otherwise these routes will miss that information.
  16. Christian Kuhn rebased onto patch set 11 02/18/22, 11:56

  17. Oli Bartsch uploaded patch set 12 02/18/22, 12:05

  18. core-ci voted on patch set 11 V +1 02/18/22, 12:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23872

  19. Oli Bartsch uploaded patch set 13 02/18/22, 12:16

  20. Oli Bartsch commented on patch set 13 02/18/22, 12:16

    Module.php:42 Reply

    Done
  21. core-ci voted on patch set 12 V +1 02/18/22, 12:17 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23874

  22. core-ci voted on patch set 13 V +1 02/18/22, 12:24 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/23875

  23. Oli Bartsch voted on patch set 13 V +1 CR +1 02/18/22, 12:51

  24. Benjamin Franzke voted on patch set 13 V +2 CR +2 02/18/22, 13:06

  25. Benjamin Franzke merged patch set 14 02/18/22, 13:06