Review main Merged

85384[TASK] Tame extbase ConfigurationManager

Christian Kuhn CR +2 V +2 Expert +515 −1433 updated 08/08/24, 17:20

Commit message

The extbase ConfigurationManager is - even after various
refactoring loops - still an anti pattern: This is a
stateful singleton initialized by extbase bootstrap with
state, and it can be injected into arbitrary classes.

This patch still does not solve the root of this issue:
It is still unclear on how to solve it.

The patch however now makes the two "worker" classes
stateless: Both the "concrete" implementation classes
FrontendConfigurationManager and BackendConfigurationManager.
This strategy bundles the ConfigurationManager flaws into
one class now. The patch also moves an access to
$GLOBALS['TYPO3_REQUEST'] out of __construct(), which
allows us to deprecate this call with an upcoming patch.

Note there is also TYPO3\CMS\Extbase\Service\ExtensionService,
which is *another* stateful injectable singleton, that works
on ConfigurationManager - #messDoesNotEndHere

Review

  • Code review CR +2 Done
    • Christian Kuhn +2
    • Garvin Hicking +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Christian Kuhn +2
    • Garvin Hicking +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 19

Review log 2440

Show 915 earlier messages
  1. Christian Kuhn uploaded patch set 1 07/25/24, 16:40

  2. core-ci voted on patch set 1 V -1 07/25/24, 16:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62201

  3. Christian Kuhn uploaded patch set 2 V -1 07/25/24, 17:36

  4. Christian Kuhn uploaded patch set 3 07/25/24, 17:41

  5. Christian Kuhn uploaded patch set 4 07/25/24, 17:41

  6. core-ci voted on patch set 2 V -1 07/25/24, 17:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62202

  7. Christian Kuhn uploaded patch set 5 07/25/24, 17:45

  8. Christian Kuhn uploaded patch set 6 07/25/24, 18:04

  9. core-ci voted on patch set 4 V -1 07/25/24, 18:05 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62204

  10. Christian Kuhn uploaded patch set 7 07/25/24, 18:05

  11. core-ci voted on patch set 5 V -1 07/25/24, 18:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62209

  12. core-ci voted on patch set 6 V -1 07/25/24, 18:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62211

  13. core-ci voted on patch set 7 V -1 07/25/24, 18:23 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62212

  14. Christian Kuhn uploaded patch set 8 V -1 07/25/24, 18:52

  15. Christian Kuhn rebased onto patch set 9 07/25/24, 18:54

  1. core-ci voted on patch set 8 V -1 07/25/24, 19:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62217

  2. core-ci voted on patch set 9 V -1 07/25/24, 19:11 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62218

  3. Christian Kuhn uploaded patch set 10 V -1 07/25/24, 19:36

  4. core-ci voted on patch set 10 V -1 07/25/24, 19:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62223

  5. Christian Kuhn uploaded patch set 11 V -1 07/25/24, 19:49

  6. core-ci voted on patch set 11 V -1 07/25/24, 19:58 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62224

  7. Christian Kuhn uploaded patch set 12 V -1 07/25/24, 20:16

  8. core-ci voted on patch set 12 V -1 07/25/24, 20:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62225

  9. Christian Kuhn rebased onto patch set 13 V -1 07/30/24, 13:14

  10. core-ci voted on patch set 13 V -1 07/30/24, 13:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62445

  11. core-ci commented on patch set 13 07/30/24, 13:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62445

  12. Christian Kuhn uploaded patch set 14 V -1 07/30/24, 15:24

  13. core-ci voted on patch set 14 V +1 07/30/24, 15:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62456

  14. Christian Kuhn uploaded patch set 15 V +1 07/31/24, 12:18

  15. core-ci voted on patch set 15 V +1 07/31/24, 12:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/62533

  16. Garvin Hicking commented on patch set 15 07/31/24, 13:06

    for later discussion: - change of position of FrontendSimulatorUtility::simulateFrontendEnvironment intentional, side-effects? - removal of FrontendConfigurationManagerTests - I'd be in favor in documenting this in an Important RST: Method argument changes, removal of initializeConcreteConfigurationManager, private methods. I'd argue potentially people use this bootstrapping in middlewares or CLI (which creates other problems, but this is what it is in reality atm), and they need to be aware to watch out for it. Yes, I know it's @internal, but... @reality ;) The RST could also be a good opportunity to again state "avoid Extbase in CLI/Middlewares". There still is no proper documentation (to my knowledge) on why to avoid it, how to avoid it to my knowledge, and with this patch it get's more pressing to have. People do enjoy to use their repositories and domain models and do their custom Extbase+ConfigManager bootstrapping. Overall impression: Looking good, this moves things forwards!

    BackendConfigurationManager.php:88

    Adapt phpdoc arguments for the new ones, at least to indicate what $configuration is (has some redudancy with the 'native' $extensionName/pluginName arguments)?

    BackendConfigurationManager.php:152

    Doesn't really need adressing, but: This part is exactly identical to the same block above; couldn't we refactor this to the getCurrentPageId() method directly, or an intermediate function like 'getCachedCurrentPageId'?
  17. Christian Kuhn commented on patch set 15 07/31/24, 16:28

    RenderFormValueViewHelperTest.php:30

    whoopsie
  18. Garvin Hicking commented on patch set 15 07/31/24, 21:52

    Reply

    I learned the dev-facing "wrapper" ConfigurationManager stays without a BC, so the "concrete" classes with changed arguments are definitely @internal only. So I see now that an important rst is not needed.
  19. Christian Kuhn commented on patch set 15 08/08/24, 15:43

    Reply

    > change of position of FrontendSimulatorUtility::simulateFrontendEnvironment intentional, side-effects? intentional, should be fine since $this->typoScriptService->convertPlainArrayToTypoScriptArray() does not need the simulator, only the cObj stuff needs it. > removal of FrontendConfigurationManagerTests These tests were working on protected methods heavily mocking subject internals. they in the end cover mainly a couple of array_merge() operations. I covered the public calls with a streamlined tests now, which already covers various of the former detail tests. That should be ok for now and if we really missed something, we may add dedicated tests later again that call public methods.

    BackendConfigurationManager.php:88 Reply

    Done

    BackendConfigurationManager.php:152 Reply

    Done

    RenderFormValueViewHelperTest.php:30 Reply

    Done
  20. Christian Kuhn uploaded patch set 16 V +1 08/08/24, 15:43

  21. core-ci voted on patch set 16 V +1 08/08/24, 15:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63061

  22. Stefan Bürk voted on patch set 16 CR +1 V +1 08/08/24, 16:47

  23. Garvin Hicking voted on patch set 16 CR +1 V +1 08/08/24, 17:16

  24. Christian Kuhn voted on patch set 16 CR +2 V +2 08/08/24, 17:20

  25. Christian Kuhn merged patch set 17 08/08/24, 17:20