Review main Merged

76637[TASK] Replace static property caches in RootlineUtility

Stefan Bürk CR +2 V +2 Normal +38 −53 updated 11/17/22, 08:57

Commit message

RootlineUtility uses a multi-staged cacheing logic. This
contains the use of a dedicated rootline-cache, but also
two static class internal caches. Static property caches
are a horrable nightmare when it comes to keep proper
clean state between test executions, beside it's a not
really needed state on a non-static class.

This change aims to replace the static property caches
in RootlineUtility with the core runtime cache. Thus
making the static properties obsolete, but keeping it
until testing-framework can deal with the absence of
the static properties. Remove them!

`RootlineUtility::purgeCaches()` calls are replaced now
with core runtime cache flush calls using tags to avoid
flushing other unrelated runtime cache entries. This makes
this method obsolete. This method was declared @internal,
eliminate it!

Additionally, default `$rootlineField` merging with the
`$GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields']`
is moved from RootlineUtility constructor to the only
method using it, namely `getRecordArray`. In the same
we changed it from static to non-static, as there is no
need anymore for having it static.

"typo3/testing-framework" has been made aware of these
changes and deals with absent of these properties and
method, but keep doing the guarding steps if they are
still exists.

See: https://github.com/TYPO3/testing-framework/pull/423

> composer u typo3/testing-framework

Review

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

Issues 1

Files 6

Review log 1826

Show 1 earlier messages
  1. Stefan Bürk uploaded patch set 1 11/16/22, 01:21

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

  2. Stefan Bürk uploaded patch set 2 11/16/22, 01:38

  3. core-ci voted on patch set 2 V +1 11/16/22, 02:02 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33790

  4. Stefan Bürk uploaded patch set 3 11/16/22, 02:30

  5. core-ci voted on patch set 3 V +1 11/16/22, 02:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33793

  6. Stefan Bürk uploaded patch set 4 11/16/22, 02:59

  7. core-ci voted on patch set 4 V +1 11/16/22, 03:10 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33794

  8. Stefan Bürk uploaded patch set 5 11/16/22, 03:54

  9. core-ci voted on patch set 5 V -1 11/16/22, 04:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33796

  10. Stefan Bürk uploaded patch set 6 11/16/22, 04:06

  11. core-ci voted on patch set 6 V +1 11/16/22, 04:14 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33799

  12. Christian Kuhn commented on patch set 6 11/16/22, 15:49

    RootlineUtility.php:161

    i'd say there is little point in clearing runtime cache by tag at all: in case entries needs to be cleared during one request at all, one would probably simply clear the entire cache. what do you think?
  13. Stefan Bürk commented on patch set 6 11/16/22, 17:16

    RootlineUtility.php:161 Reply

    First implementation was without tag. But after core classes used the old purgeCaches() to clear explicitly only the RootlineUtility caches, I thought it *might* be code to differenciate it using tags. See for example https://review.typo3.org/c/Packages/TYPO3.CMS/+/76637/6/typo3/sysext/core/Classes/DataHandling/SlugHelper.php#b370 or https://review.typo3.org/c/Packages/TYPO3.CMS/+/76637/6/typo3/sysext/core/Classes/Routing/SiteMatcher.php#b76 Thus I'm not really sure about this.
  14. Christian Kuhn commented on patch set 6 11/16/22, 17:51

    RootlineUtility.php:161 Reply

    i see. thx. mmh. need to give this some thaught.
  15. Stefan Bürk commented on patch set 6 11/16/22, 18:03

    RootlineUtility.php:161 Reply

    Sure, take your time.
  16. Christian Kuhn commented on patch set 6 11/17/22, 07:43

    RootlineUtility.php:161 Reply

    you're right. the usages indicate we should be able to flush by tag, that's the safer bet. let's reduce to one tag, though and mark the constant internal.
  17. Christian Kuhn uploaded patch set 7 11/17/22, 07:48

  18. Christian Kuhn updated the commit message in patch set 8 11/17/22, 07:49

  19. core-ci voted on patch set 8 V +1 11/17/22, 07:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33842

  20. core-ci voted on patch set 7 V +1 11/17/22, 08:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/33841

  21. Christian Kuhn voted on patch set 8 V +1 CR +1 11/17/22, 08:07

  22. Benni Mack commented on patch set 8 11/17/22, 08:46

    very nice one. In the future, I hope to have a 2-level cache in our CF, so we can get rid of the explicit runtime cache flushing.
  23. Benni Mack voted on patch set 8 V +1 CR +1 11/17/22, 08:46

  24. Stefan Bürk voted on patch set 8 V +2 CR +2 11/17/22, 08:57

  25. Stefan Bürk merged patch set 9 11/17/22, 08:57