Review main Merged Breaking

66079[!!!][TASK] Request processing chain must return a response object

Alexander Schnitzler CR +2 V +2 Normal +111 −74 updated 10/23/20, 12:38

Commit message

This patch introduces a proper request/response handling chain. That
means, that Extbase no longer creates a response object early, passes
it through the request handler and dispatcher into the controller and
expects it to be altered there.

Instead, request handlers, the dispatcher and controllers only get
passed a request object and controllers are then responsible for
creating and returning a response.

This change is preparatory work for the introduction of PSR-7 responses
in Extbase. Those responses are immutable and can no longer passed by
reference through the stack. Instead, the controller must return the
desired response along with its state down the stack while remaining
unaltered.

This patch is considered breaking because it changes several method
signatures of public classes and interfaces.

Still, it is quite unlikely to be struck by this change when using
the public api of Extbase and not overriding classes such as the
ActionController.

Review

  • Code review CR +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
  • Verified V +2 Done
    • Benni Mack +2
    • Oli Bartsch +1
    • TYPO3com +1 CI

Issues 1

Files 17

Review log 2433

Show 48 earlier messages
  1. Alexander Schnitzler uploaded patch set 1 10/08/20, 06:20

  2. Alexander Schnitzler uploaded patch set 2 10/08/20, 06:33

  3. TYPO3com voted on patch set 1 V -1 10/08/20, 06:37 Completed build in 16m 21s on Thu, 8 Oct, 06:37 AM Test Summary: 1 of 65838 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6347

  4. TYPO3com voted on patch set 2 V -1 10/08/20, 06:51 Completed build in 17m 31s on Thu, 8 Oct, 06:51 AM Test Summary: 58 of 74273 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6348

  5. Alexander Schnitzler uploaded patch set 3 10/08/20, 07:01

  6. TYPO3com voted on patch set 3 V -1 10/08/20, 07:17 Completed build in 15m 41s on Thu, 8 Oct, 07:17 AM Test Summary: 7 of 74273 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6349

  7. Alexander Schnitzler uploaded patch set 4 10/08/20, 07:32

  8. TYPO3com voted on patch set 4 V +1 10/08/20, 07:48 Completed build in 15m 39s on Thu, 8 Oct, 07:48 AM Test Summary: 73788 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6351

  1. Alexander Schnitzler wrote 10/08/20, 07:52

    Topic set to extbase
  2. Alexander Schnitzler wrote 10/08/20, 07:52

    Hashtag added: PSR-7
  3. Alexander Schnitzler uploaded patch set 5 10/08/20, 09:35

  4. TYPO3com voted on patch set 5 V +1 10/08/20, 09:46 Completed build in 11m 40s on Thu, 8 Oct, 09:46 AM Test Summary: 73788 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6354

  5. Alexander Schnitzler commented on patch set 5 10/08/20, 09:47

    This change is ready for review.
  6. Benni Mack uploaded patch set 6 10/12/20, 14:43

  7. TYPO3com voted on patch set 6 V +1 10/12/20, 14:56 Completed build in 12m 52s on Mon, 12 Oct, 02:56 PM Test Summary: 73728 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6447

  8. Alexander Schnitzler uploaded patch set 7 10/20/20, 12:59

  9. TYPO3com voted on patch set 7 V +1 10/20/20, 13:12 Completed build in 13m 06s on Tue, 20 Oct, 01:12 PM Test Summary: 73479 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6692

  10. Alexander Schnitzler commented on patch set 7 CR -1 10/20/20, 13:15

    Breaking-92513-StopActionExceptionRequiresAResponseObjectAsConstructorArgument.rst:12

    - nor -> now. - it's not the first argument any more since one of the recent patch sets.
  11. Benni Mack commented on patch set 7 10/20/20, 13:42

    ActionController.php:416

    do we need these three lines? Response should have setRequest() at any time now.
  12. Alexander Schnitzler commented on patch set 7 10/20/20, 14:41

    ActionController.php:416 Reply Unresolved

  13. Benni Mack commented on patch set 7 10/20/20, 19:34

    Breaking-92513-StopActionExceptionRequiresAResponseObjectAsConstructorArgument.rst:12 Reply Unresolved

    IMHO we can remove this specific RST now
  14. Alexander Schnitzler uploaded patch set 8 10/21/20, 10:02

  15. TYPO3com voted on patch set 8 V +1 10/21/20, 10:16 Completed build in 13m 48s on Wed, 21 Oct, 10:16 AM Test Summary: 73486 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6714

  16. Benni Mack voted on patch set 8 V +1 CR +1 10/23/20, 07:42

  17. Oli Bartsch commented on patch set 8 10/23/20, 08:09

    Breaking-92513-MethodSignatureChangeOfTYPO3CMSExtbaseMvcControllerControllerInterfaceprocessRequest.rst:12

    Suggest to use the fully qualified name here `TYPO3\CMS\Extbase\Mvc\ResponseInterface` to make it clear.

    Breaking-92513-MethodSignatureChangeOfTYPO3CMSExtbaseMvcControllerControllerInterfaceprocessRequest.rst:33

    Also here: "Return a :php:`TYPO3\CMS\Extbase\Mvc\ResponseInterface` object" (Without the full stop according to the other bullet point)

    ActionController.php:398

    This should be changed as the response object is no longer given to this function. Same in the interface

    ActionController.php:407

    Just curios, why do we use objectManager->get here instead of DI or makeInstance?

    Dispatcher.php:98

    Same question, why using objectManager here?
  18. Alexander Schnitzler commented on patch set 8 10/23/20, 08:18

    Breaking-92513-MethodSignatureChangeOfTYPO3CMSExtbaseMvcControllerControllerInterfaceprocessRequest.rst:12 Reply

    That I wouldn't do because there is another patch pending which removes that interface. The goal is to be PSR-7 compatible and use the ResponseInterface of that package. I would rather adjust this rst file after that mentioned change has been merged.

    Breaking-92513-MethodSignatureChangeOfTYPO3CMSExtbaseMvcControllerControllerInterfaceprocessRequest.rst:33 Reply

    Same here.

    ActionController.php:398 Reply

    Doog catch!

    ActionController.php:407 Reply

    Let's use makeInstance here. That's a copy paste issue.

    Dispatcher.php:98 Reply

    That's just copy paste stuff. We can use makeInstance here already since Response does not have any dependencies.
  19. Oli Bartsch commented on patch set 8 10/23/20, 08:29

    Breaking-92513-MethodSignatureChangeOfTYPO3CMSExtbaseMvcControllerControllerInterfaceprocessRequest.rst:12 Reply

    Great, sounds even better.
  20. Alexander Schnitzler uploaded patch set 9 10/23/20, 11:44

  21. Alexander Schnitzler commented on patch set 9 10/23/20, 11:45

    Breaking-92513-MethodSignatureChangeOfTYPO3CMSExtbaseMvcControllerControllerInterfaceprocessRequest.rst:12 Reply

    Done

    Breaking-92513-MethodSignatureChangeOfTYPO3CMSExtbaseMvcControllerControllerInterfaceprocessRequest.rst:33 Reply

    Done

    ActionController.php:398 Reply

    Done

    ActionController.php:407 Reply

    Done

    Dispatcher.php:98 Reply

    Done
  22. TYPO3com voted on patch set 9 V +1 10/23/20, 11:57 Completed build in 12m 57s on Fri, 23 Oct, 11:57 AM Test Summary: 73458 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6838

  23. Oli Bartsch voted on patch set 9 V +1 CR +1 10/23/20, 12:37

  24. Benni Mack voted on patch set 9 V +2 CR +2 10/23/20, 12:38

  25. Benni Mack merged patch set 10 10/23/20, 12:38