Review main Abandoned

65087[FEATURE] Introduce ConfigurationProcessor

Nikita Hovratov CR 0 V 0 Nightmare +5887 −30 updated 11/04/21, 16:42

Commit message

The ConfigurationProcessor enables to process and validate user-defined
TypoScript data in respect of predefined configuration structures.
The configuration structure is defined in classes implementing the
ConfigurationInterface. It is possible to define types, default
values and other options which can be found in the documentation. The
processor validates the user input based on this structure and throws an
exception if it fails.

As configuration was not validated at all before, this might be
breaking in setups with (serious) misconfigurations. Therefore a feature
toggle is provided to allow smooth migrations from lower TYPO3 versions.

Benefits are a stricter user input validation and an overview over all
the possible configuration in the code. Also there are less checks for
existence of values, less php notices and less initialization steps for
options in the executing code.

As a first real world example the HMENU configuration is processed.
Other configuration will follow.

Review

  • Code review CR 0
  • Verified V 0

Issues 1

Files 34

Show 14 more files

Review log 4175

Show 3050 earlier messages
  1. Nikita Hovratov uploaded patch set 1 07/24/20, 15:08

  2. TYPO3com voted on patch set 1 V +1 07/24/20, 15:19 Completed build in 11m 11s on Fri, 24 Jul, 03:19 PM Test Summary: 73089 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4230

  3. Nikita Hovratov uploaded patch set 2 07/25/20, 19:20

  4. TYPO3com voted on patch set 2 V -1 07/25/20, 19:32 Completed build in 11m 57s on Sat, 25 Jul, 07:32 PM Test Summary: 72 of 73585 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4252

  5. Benni Mack commented on patch set 2 07/25/20, 20:19

    Wow. very impressive. Don't know if I would put so much effort on that topic for HMENU (as in my opinion, HMENU is broken in the way how it is used). My question is: What is your final goal? To be able to validate all given properties properly during runtime for a specific TypoScript cObject or TypoScript function like typolink or stdWrap?
  6. Nikita Hovratov commented on patch set 2 07/25/20, 20:29

    > Patch Set 2: > > Wow. very impressive. Don't know if I would put so much effort on that topic for HMENU (as in my opinion, HMENU is broken in the way how it is used). My question is: What is your final goal? To be able to validate all given properties properly during runtime for a specific TypoScript cObject or TypoScript function like typolink or stdWrap? Hi Benni, thanks! HMENU is just a testcase for it to work properly, because it has so much configuration. My goal is to streamline and harden the configuration for cObjects, because right now one has to fully trust the documentation to be correct. Looking for configuration in the code is also very painful, as it is scattered around the code. A central place in the code to look up the possible configuration would be nice. And yes also what you said about validation and it should work for any type of typoscript configuration (cObj, functions, user defined configuration).
  7. Nikita Hovratov uploaded patch set 3 07/25/20, 20:32

  8. TYPO3com voted on patch set 3 V +1 07/25/20, 20:45 Completed build in 12m 41s on Sat, 25 Jul, 08:45 PM Test Summary: 73098 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4253

  9. Nikita Hovratov uploaded patch set 4 07/26/20, 15:04

  10. TYPO3com voted on patch set 4 V -1 07/26/20, 15:05 Completed build in 23s on Sun, 26 Jul, 03:05 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4258

  11. Nikita Hovratov uploaded patch set 5 07/26/20, 15:12

  12. TYPO3com voted on patch set 5 V -1 07/26/20, 15:25 Completed build in 12m 37s on Sun, 26 Jul, 03:25 PM Test Summary: 71875 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4259

  13. Nikita Hovratov updated the commit message in patch set 6 07/26/20, 15:52

  14. TYPO3com voted on patch set 6 V -1 07/26/20, 16:04 Completed build in 11m 51s on Sun, 26 Jul, 04:04 PM Test Summary: 9 of 73645 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4260

  15. Nikita Hovratov updated the commit message in patch set 7 07/26/20, 16:05

  16. TYPO3com voted on patch set 7 V +1 07/26/20, 16:16 Completed build in 11m 07s on Sun, 26 Jul, 04:16 PM Test Summary: 73158 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4261

  17. Nikita Hovratov uploaded patch set 8 07/26/20, 22:44

  18. TYPO3com voted on patch set 8 V +1 07/26/20, 22:58 Completed build in 14m 37s on Sun, 26 Jul, 10:58 PM Test Summary: 73158 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4262

  19. Nikita Hovratov uploaded patch set 9 07/28/20, 10:50

  20. TYPO3com voted on patch set 9 V +1 07/28/20, 11:01 Completed build in 11m 01s on Tue, 28 Jul, 11:01 AM Test Summary: 73205 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4282

  21. Nikita Hovratov uploaded patch set 10 07/28/20, 17:17

  22. TYPO3com voted on patch set 10 V +1 07/28/20, 17:28 Completed build in 11m 25s on Tue, 28 Jul, 05:28 PM Test Summary: 73206 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4286

  23. Nikita Hovratov uploaded patch set 11 07/29/20, 13:05

  24. TYPO3com voted on patch set 11 V +1 07/29/20, 13:17 Completed build in 11m 33s on Wed, 29 Jul, 01:17 PM Test Summary: 73206 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-4303

  25. Nikita Hovratov uploaded patch set 12 08/29/20, 19:54

  26. TYPO3com voted on patch set 12 V +1 08/29/20, 20:06 Completed build in 10m 56s on Sat, 29 Aug, 08:06 PM Test Summary: 73374 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5047

  27. Alexander Schnitzler commented on patch set 12 08/31/20, 07:55

    Do i get it right that this patch is meant to be a runtime TypoScript linter which ungracefully fails if active? From my first look at this I'd say I would implement this rather as a tool in the backend first. I understand the idea and goal of having valid typoscript, it's a good one which TYPO3 lacks. But implementing this directly in the (frontend) parsing process is a bit fast for me.
  28. Nikita Hovratov commented on patch set 12 08/31/20, 08:28

    > Patch Set 12: > > Do i get it right that this patch is meant to be a runtime TypoScript linter which ungracefully fails if active? > > From my first look at this I'd say I would implement this rather as a tool in the backend first. I understand the idea and goal of having valid typoscript, it's a good one which TYPO3 lacks. But implementing this directly in the (frontend) parsing process is a bit fast for me. Hi Alex, yes this checks and transforms TypoScript to the target data type in runtime, but it handles it really gracefully. For example where I see the most common misconfiguration is in bool types. They are handled as before, but log deprecations. Everything else should not work in my opinion. Better fail early and know something is wrong.
  29. Tymoteusz Motylewski commented on patch set 12 09/01/20, 21:12

    Does this approach relates somehow to the https://github.com/martin-helmich/typo3-typoscript-parser ?
  30. Nikita Hovratov commented on patch set 12 09/02/20, 06:56

    > Patch Set 12: > > Does this approach relates somehow to the https://github.com/martin-helmich/typo3-typoscript-parser ? No, there is no parsing involved at all. This is only for checking correct user input after TypoScript is parsed.
  31. Nikita Hovratov rebased onto patch set 13 09/02/20, 11:49

  32. TYPO3com voted on patch set 13 V +1 09/02/20, 12:01 Completed build in 12m 17s on Wed, 2 Sep, 12:01 PM Test Summary: 73446 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5137

  33. Anja Leichsenring commented on patch set 13 CR -1 09/02/20, 19:31

    I think this is way too harsh to actually be accepted into existing instances updating to v11. My propasal would be to introduce the ConfigurationProcessor together with a feature toggle: In new instances, all is as proposed here, then you will ensure proper TypoScript from the very beginning. In updating instances, feature toggle is off, and the ConfigurationProcessor will not throw any exception, but trigger deprecation warnings the same way we handle any deprecation. Feature Toggle will be removed in v12, together with the graceful exception handling. This way, you are not rendering any older instance unusable from the start, increasing the update effort and frustrating people. All in all, I like that we introduce more stability and reliability into TypoScript, but you really have to offer a chance to our users to cope in proper time with this rather radical change in behavior.

    Feature-91865-IntroduceConfigurationProcessor.rst:92 Unresolved

    add an empty line after each headline, else it does not get rendered.

    Feature-91865-IntroduceConfigurationProcessor.rst:98 Unresolved

    here also an empty line is missing for proper rendering

    Feature-91865-IntroduceConfigurationProcessor.rst:195 Unresolved

    what is the meaning here? I declare 1, notEmpty is true, and now what? This table is not really enlightening.

    Feature-91865-IntroduceConfigurationProcessor.rst:221 Unresolved

    means what? Input was -1, I get 0 as fallback. Input is 4711, and I get 100?

    Feature-91865-IntroduceConfigurationProcessor.rst:257 Unresolved

    please explain, what is the use? Why should I alias keyword2 to keyword1, when I have keyword1 already?

    Feature-91865-IntroduceConfigurationProcessor.rst:283 Unresolved

    and will trigger a deprecation warning in TYPO3 v12. Just some rewording.
  34. Nikita Hovratov uploaded patch set 14 09/03/20, 13:27

  35. TYPO3com voted on patch set 14 V -1 09/03/20, 13:39 Completed build in 11m 21s on Thu, 3 Sep, 01:39 PM Test Summary: 73632 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5178

  36. Nikita Hovratov uploaded patch set 15 09/03/20, 14:56

  37. TYPO3com voted on patch set 15 V -1 09/03/20, 14:56 Completed build in 25s on Thu, 3 Sep, 02:56 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5182

  38. Nikita Hovratov uploaded patch set 16 09/03/20, 15:01

  39. TYPO3com voted on patch set 16 V -1 09/03/20, 15:02 Completed build in 23s on Thu, 3 Sep, 03:02 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5183

  40. Nikita Hovratov uploaded patch set 17 09/03/20, 15:05

  41. TYPO3com voted on patch set 17 V -1 09/03/20, 15:17 Completed build in 11m 55s on Thu, 3 Sep, 03:17 PM Test Summary: 66 of 74117 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5184

  42. Nikita Hovratov uploaded patch set 18 09/03/20, 15:33

  43. TYPO3com voted on patch set 18 V +1 09/03/20, 15:44 Completed build in 11m 18s on Thu, 3 Sep, 03:44 PM Test Summary: 73630 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5185

  44. Nikita Hovratov commented on patch set 18 09/03/20, 16:16

    > Patch Set 13: Code-Review-1 > > (6 comments) > > I think this is way too harsh to actually be accepted into existing instances updating to v11. > > My propasal would be to introduce the ConfigurationProcessor together with a feature toggle: > In new instances, all is as proposed here, then you will ensure proper TypoScript from the very beginning. > In updating instances, feature toggle is off, and the ConfigurationProcessor will not throw any exception, but trigger deprecation warnings the same way we handle any deprecation. > Feature Toggle will be removed in v12, together with the graceful exception handling. > > This way, you are not rendering any older instance unusable from the start, increasing the update effort and frustrating people. > > All in all, I like that we introduce more stability and reliability into TypoScript, but you really have to offer a chance to our users to cope in proper time with this rather radical change in behavior. Thank you for taking time going through the feature! I agree with everything and added a feature toggle. With the feature off, only deprecation warnings will be thrown. I also improved the documentation to make it more clear.
  45. Anja Leichsenring commented on patch set 18 09/03/20, 18:23

    thank you for the adaption, and also thank you for taking my review as an attempt to improve, not to critisize. I forwarded the feature to the core team so they can give their opinion as well.
  46. Nikita Hovratov uploaded patch set 19 09/05/20, 15:27

  47. TYPO3com voted on patch set 19 V +1 09/05/20, 15:39 Completed build in 11m 48s on Sat, 5 Sep, 03:39 PM Test Summary: 73662 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5285

  48. Nikita Hovratov uploaded patch set 20 09/07/20, 18:50

  49. TYPO3com voted on patch set 20 V -1 09/07/20, 19:29 Completed build in 21m 34s on Mon, 7 Sep, 07:29 PM Test Summary: 1 of 74162 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5348

  50. Nikita Hovratov rebased onto patch set 21 09/10/20, 07:34

  1. TYPO3com voted on patch set 21 V +1 09/10/20, 07:45 Completed build in 11m 12s on Thu, 10 Sep, 07:45 AM Test Summary: 73623 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5462

  2. Nikita Hovratov uploaded patch set 22 09/21/20, 18:39

  3. TYPO3com voted on patch set 22 V -1 09/21/20, 18:51 Completed build in 12m 04s on Mon, 21 Sep, 06:51 PM Test Summary: 1 of 74593 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5796

  4. Nikita Hovratov rebased onto patch set 23 09/22/20, 09:11

  5. Nikita Hovratov rebased onto patch set 24 10/07/20, 16:14

  6. TYPO3com voted on patch set 24 V +1 10/07/20, 16:30 Completed build in 16m 02s on Wed, 7 Oct, 04:30 PM Test Summary: 74238 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6331

  7. Nikita Hovratov uploaded patch set 25 10/13/20, 11:30

  8. TYPO3com voted on patch set 25 V +1 10/13/20, 11:45 Completed build in 15m 18s on Tue, 13 Oct, 11:45 AM Test Summary: 74166 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-6467

  9. Nikita Hovratov uploaded patch set 26 02/23/21, 10:11

  10. Nikita Hovratov uploaded patch set 27 02/23/21, 10:14

  11. TYPO3com voted on patch set 26 V -1 02/23/21, 10:19 Completed build in 07m 39s on Tue, 23 Feb, 10:19 AM Test Summary: 55 of 33075 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9672

  12. TYPO3com voted on patch set 27 V -1 02/23/21, 10:23 Completed build in 08m 39s on Tue, 23 Feb, 10:23 AM Test Summary: 54 of 33075 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9673

  13. core-ci voted on patch set 26 V -1 02/23/21, 10:24 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/907

  14. Nikita Hovratov uploaded patch set 28 02/23/21, 10:25

  15. core-ci voted on patch set 27 V -1 02/23/21, 10:28 Core CI is not happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/908

  16. TYPO3com voted on patch set 28 V +1 02/23/21, 10:33 Completed build in 07m 15s on Tue, 23 Feb, 10:33 AM Test Summary: 32834 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9674

  17. core-ci voted on patch set 28 V +1 02/23/21, 10:35 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/909

  18. Nikita Hovratov uploaded patch set 29 02/25/21, 17:46

  19. TYPO3com voted on patch set 29 V +1 02/25/21, 17:54 Completed build in 08m 21s on Thu, 25 Feb, 05:54 PM Test Summary: 32878 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9730

  20. core-ci voted on patch set 29 V +1 02/25/21, 17:56 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1014

  21. Nikita Hovratov uploaded patch set 30 02/27/21, 08:41

  22. TYPO3com voted on patch set 30 V +1 02/27/21, 08:49 Completed build in 07m 55s on Sat, 27 Feb, 08:49 AM Test Summary: 32878 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-9744

  23. core-ci voted on patch set 30 V +1 02/27/21, 08:54 Core CI is happy: https://core.b13.com/typo3-core/typo3.cms/-/pipelines/1037

  24. Christian Kuhn commented on patch set 30 11/04/21, 16:42

    Hey. Had a short chat with Nikita about this one a while ago - It is currently too intrusive and may need a bit of coordination and goal definition beforehand, if we decide that we should go this path. For the sake of a more clean review system, I'll abandon the patch for now.
  25. Christian Kuhn abandoned the change 11/04/21, 16:42