Review main Merged

89794[TASK] Use data object for TCA processing

Oli Bartsch CR +2 V +2 Hard +400 −357 updated 06/24/25, 15:28

Commit message

As a follow up for #106912 is the new data
object `TcaProcessingResult` introduced.

It is first used by the `TcaMigration` to
make the service "stateless", since this
now allows to remove the "reset messages"
functionality.

Review

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

Issues 2

Files 7

Review log 2633

Show 68 earlier messages
  1. Oli Bartsch uploaded patch set 1 06/23/25, 11:22

  2. Christian Kuhn commented on patch set 1 06/23/25, 11:33

    TcaProcessingContext.php:25

    i'd prefer to have readonly public properties to make the DO immutable. this would avoid accidentially unsetting previous messages. maybe have something like this: ? $newDO = $currentDO->withTca(); $newDO2 = $newDO->addMessage($message); this is similar to what psr-7 does with request, and could be useful in this case as well. what do you think?
  3. core-ci voted on patch set 1 V -1 06/23/25, 11:37 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80600

  4. Christian Kuhn commented on patch set 1 06/23/25, 11:49

    TcaProcessingContext.php:25 Reply

    ->withAdditionalMessage() instead of ->addMessage() probably.
  5. Oli Bartsch uploaded patch set 2 V -1 06/23/25, 12:29

  6. Oli Bartsch commented on patch set 2 06/23/25, 12:31

    TcaProcessingContext.php:25 Reply

    Don't quite get it. The idea of the DO is to be enriched. So why should we make it immutable then?
  7. core-ci voted on patch set 2 V +1 06/23/25, 12:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80605

  8. Oli Bartsch uploaded patch set 3 V +1 06/23/25, 13:11

  1. Oli Bartsch commented on patch set 3 06/23/25, 13:12

    TcaProcessingContext.php:25 Reply

    You might want to check current solution which uses the DO just as result, so it is immutable / readonly.
  2. core-ci voted on patch set 3 V +1 06/23/25, 13:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80614

  3. Christian Kuhn commented on patch set 3 CR -1 06/23/25, 13:35

    when you add a DO for this, we should harden it as much as we can, there is no true benefit otherwise. let's talk about his change in case you want to push this forward.
  4. Benjamin Franzke commented on patch set 3 06/23/25, 14:12

    TcaProcessingResult.php:20

    It is used by `TcaMigration` and the `migrate()` method, maybe `TcaMigrationResult` is a better fit?

    TcaProcessingResult.php:20

    Please mark `@internal`
  5. Oli Bartsch uploaded patch set 4 CR -1 V +1 06/23/25, 14:25

  6. core-ci voted on patch set 4 V +1 06/23/25, 14:41 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80628

  7. Oli Bartsch uploaded patch set 5 V +1 06/23/25, 14:48

  8. Oli Bartsch commented on patch set 4 06/23/25, 14:49

    TcaProcessingResult.php:20 Reply

    The idea is to keep this data object generic so it can be used for other tca processor services, e.g. TcaPreparation as well.

    TcaProcessingResult.php:20 Reply

    Done
  9. Oli Bartsch commented on patch set 5 06/23/25, 14:49

    TcaProcessingContext.php:25 Reply

    Done
  10. core-ci voted on patch set 5 V +1 06/23/25, 14:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80635

  11. Christian Kuhn commented on patch set 5 06/23/25, 19:08

    TcaProcessingResult.php:36

    @return string[] could be a useful annotation here.

    TcaProcessingResult.php:46

    let's make this withAdditionalMessage(string $message) to harden this (you for example can't submit an array with objects anymore), and it bows to the usage which (always?) only creates a new object with a single additional message.
  12. Stefan Bürk commented on patch set 5 06/23/25, 19:46

    TcaProcessingResult.php:46 Reply

    ``` withAdditionalMessages(string ...$messages): TcaProcessingResult ``` would be a good compromise .. type safe and can be used with an array of strings ... https://onlinephp.io/c/7eafa ``` withAdditionalMessages(...array_values($messages)) ```
  13. Oli Bartsch uploaded patch set 6 V +1 06/23/25, 20:53

  14. Oli Bartsch commented on patch set 5 06/23/25, 20:53

    TcaProcessingResult.php:36 Reply

    Done

    TcaProcessingResult.php:46 Reply

    Done
  15. core-ci voted on patch set 6 V +1 06/23/25, 21:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80662

  16. Christian Kuhn commented on patch set 6 06/23/25, 22:25

    TcaProcessingResult.php:46 Reply

    thx. great idea.
  17. Christian Kuhn commented on patch set 6 06/23/25, 22:26

    looks good to me now. i'll let it sink in for a day and will probably upvote soon.
  18. Stefan Bürk commented on patch set 6 06/24/25, 09:00

    TcaProcessingResult.php:46

    ```suggestion return new self($tca, $this->messages); ``` `new $this` looks weired .. but seems to work. Should we still change it to the more casual known `new self()` instead ?

    TcaProcessingResult.php:51

    ```suggestion return new self($this->tca, array_merge($this->messages, $messages)); ``` see comment above
  19. Oli Bartsch uploaded patch set 7 V +1 06/24/25, 09:13

  20. Oli Bartsch commented on patch set 7 06/24/25, 09:14

    TcaProcessingResult.php:46 Reply

    Done

    TcaProcessingResult.php:51 Reply

    Done
  21. core-ci voted on patch set 7 V +1 06/24/25, 09:27 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/80707

  22. Stefan Bürk voted on patch set 7 CR +1 V +1 06/24/25, 09:29

  23. Christian Kuhn voted on patch set 7 CR +1 V +1 06/24/25, 15:18

  24. Oli Bartsch voted on patch set 7 CR +2 V +2 06/24/25, 15:28

  25. Oli Bartsch merged patch set 8 06/24/25, 15:28