Review main Merged

72437[FEATURE] Introduce RedirectWasHitEvent

Oli Bartsch CR +2 V +2 Hard +370 −45 updated 12/01/21, 22:35

Commit message

A new PSR-14 based event "RedirectWasHitEvent" is introduced,
allowing extension authors to further process a matched redirect
and to adjust the PSR-7 Response. It's furthermore possibility
to influence core functionality, e.g. the hit count increment.
This is especially useful for e.g. the use of custom monitoring
tools, which should not increment the hit count while testing
the redirects.

As a side effect, the middleware is cleaned up, since the
increment task is moved into a dedicated event listener.

Review

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

Issues 1

Files 7

Review log 2433

Show 58 earlier messages
  1. Oli Bartsch uploaded patch set 1 12/01/21, 12:42

  2. Oli Bartsch uploaded patch set 2 12/01/21, 12:45

  3. Oli Bartsch updated the commit message in patch set 3 12/01/21, 12:48

  4. core-ci voted on patch set 1 V +1 12/01/21, 12:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20311

  5. core-ci voted on patch set 2 V +1 12/01/21, 13:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20312

  6. core-ci voted on patch set 3 V +1 12/01/21, 13:03 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20313

  7. Christian Kuhn voted on patch set 3 V +1 CR +1 12/01/21, 13:07

  8. Benni Mack commented on patch set 3 CR -1 12/01/21, 13:09

    I recommend moving the HitCount functionality directly into an event listener, making the Event even more generic "RedirectWasHitEvent". If we allow to change the Response, this Event will become even more powerful (and more generic).
  1. Stefan Bürk commented on patch set 3 12/01/21, 13:18

    Could we also have some functional tests for the hit counting stuff anyway ? Could not find any on a quick look, and would be nice to have some coverage here. If not, would make some later (had it on my personal todo anyway).
  2. Oli Bartsch uploaded patch set 4 12/01/21, 16:58

  3. core-ci voted on patch set 4 V +1 12/01/21, 17:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20345

  4. Oli Bartsch uploaded patch set 5 12/01/21, 18:10

  5. Oli Bartsch commented on patch set 5 12/01/21, 18:10

    Reply

    Done

    Reply

    Done
  6. Oli Bartsch uploaded patch set 6 12/01/21, 18:18

  7. core-ci voted on patch set 5 V -1 12/01/21, 18:22 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20351

  8. core-ci voted on patch set 6 V +1 12/01/21, 18:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20352

  9. Stefan Bürk commented on patch set 6 V +1 CR +1 12/01/21, 19:46

    Reply

    Thanks for adding the tests, and for the feature at all.
    Nice little feature.
  10. Oli Bartsch commented on patch set 6 V -1 12/01/21, 19:46

    Will do some rework.
  11. Stefan Bürk wrote 12/01/21, 19:47

    Removed Code-Review+1 by Stefan Bürk <stefan@buerk.tech>
  12. Stefan Bürk wrote 12/01/21, 19:47

    Removed Verified+1 by Stefan Bürk <stefan@buerk.tech>
  13. Oli Bartsch uploaded patch set 7 12/01/21, 20:26

  14. Oli Bartsch uploaded patch set 8 12/01/21, 20:30

  15. core-ci voted on patch set 7 V -1 12/01/21, 20:46 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20361

  16. core-ci voted on patch set 8 V +1 12/01/21, 20:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20363

  17. Stefan Bürk voted on patch set 8 V +1 CR +1 12/01/21, 20:51

  18. Benni Mack commented on patch set 8 12/01/21, 21:20

    RedirectWasHitEvent.php:58

    do we need a setter?

    IncrementHitCount.php:28

    listeners can become final
  19. Oli Bartsch uploaded patch set 9 12/01/21, 21:32

  20. Oli Bartsch commented on patch set 9 12/01/21, 21:33

    RedirectWasHitEvent.php:58 Reply

    Yes, see RST regarding the option to dynamically disable the hit counter.

    IncrementHitCount.php:28 Reply

    Done
  21. core-ci voted on patch set 9 V +1 12/01/21, 21:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/20369

  22. Benni Mack voted on patch set 9 V +1 CR +1 12/01/21, 21:59

  23. Stefan Bürk voted on patch set 9 V +1 CR +1 12/01/21, 22:00

  24. Oli Bartsch voted on patch set 9 V +2 CR +2 12/01/21, 22:35

  25. Oli Bartsch merged patch set 10 12/01/21, 22:35