49307[TASK] Add functional test for exbase validation caching
Commit message
Review
-
Code review CR +2
- Anja Leichsenring +2
- Christian Kuhn +1
-
Verified V +2
- Anja Leichsenring +2
- Christian Kuhn +1
- TYPO3com +1 CI
Issues 1
Files 4
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Controller/BlogController.php+49 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/Classes/Domain/Validator/PostValidator.phpnew+40 −0
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_localconf.php+1 −1
- typo3/sysext/extbase/Tests/Functional/Mvc/Validation/ActionControllerValidationTest.phpnew+196 −0
Review log 2641
Show 1116 earlier messages
-
Alexander Stehlik uploaded patch set 1 08/02/16, 11:26
-
TYPO3com voted on patch set 1 V -1 08/02/16, 11:40 Completed build in 12m 06s on Tue, 2 Aug, 01:40 PM Test Summary: 19386 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1584
-
Alexander Stehlik uploaded patch set 2 08/02/16, 11:43
-
TYPO3com voted on patch set 2 V -1 08/02/16, 12:42 Completed build in 24m 10s on Tue, 2 Aug, 02:42 PM Test Summary: 19268 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1589
-
TYPO3com voted on patch set 2 V +1 08/02/16, 19:13 Completed build in 7h 20m 04s on Tue, 2 Aug, 09:13 PM Test Summary: 19382 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-1589
-
Alexander Stehlik uploaded patch set 3 09/01/16, 10:19
-
TYPO3com voted on patch set 3 V +1 09/01/16, 10:22 Completed build in 03m 08s on Thu, 1 Sep, 12:22 PM Test Summary: 19105 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-2614
-
Alexander Stehlik commented on patch set 3 V -1 09/14/16, 13:54
Causes problems when custom object validators are used. Validation messages are added twice. -
Claus Due commented on patch set 3 CR -1 10/18/16, 01:12
I recommend solving this one by simply removing the internal cache in method getBaseValidatorConjunction on ValidatorResolver. Reasoning: validation is not frequently called upon. Also, for validation of sub-properties, which is by far where this cache optimisation would have impact (e.g. avoiding re-calling resolving for each and every sub-object), validators are already built directly using GenericObjectValidator which means the resolving logic does not even trigger here. All in all, removing the cache should have very little impact and would correctly bind each validator to a specific instance and assign fresh ones to fresh instances. -
Bernhard Kraft commented on patch set 3 10/19/16, 10:34
The problem is, that there will only be one "GenericObjectValidator" for every object of the same kind. So if you have one "BlogPost" object validator there will only be one instance of it. This is caused by the internal cache of the resolver. But it makes sense! As you do not know how many objects there will be and what the structure is. So the current solution mostly implements the Visitor pattern, where each validator visits the object/data it is intended for. While your suggestion would kind of implement a second identical tree structure of validators and then traverse the validator tree alongside the data-tree. I find the currently implemented visitor pattern makes more sense, only that recursive calls have to get coped with as implemented with my stack solution. I mean: Recursive calls and stacks in the IT world are like chicken and eggs: They are inherently coupled. -
Claus Due commented on patch set 3 10/19/16, 11:20
> So if you have one "BlogPost" object validator there will only be one instance of it. This is caused by the internal cache of the resolver. It is indeed the internal cache that is the source of the problem, as mentioned in my comment before. > But it makes sense! As you do not know how many objects there will be and what the structure is. It may make sense but it also causes issues, and not just of the kind evident in this patch. It also causes issues where you may want a different validator for a secondary BlogPost where you change the validation meanwhile. For example if the validation is different on another controller action to which you forward. So it needs a solution. Status quo is not a solution to this. > So the current solution mostly implements the Visitor pattern, where each validator visits the object/data it is intended for. You even include the cause of the problem here in your explanation. The validators are cached based on object name and so will never visit the *data* they are intended for. They will only visit the *object class* they are intended for. There is a significant difference between those two. Perhaps a solution is to elaborate the key used for storing validators so they will include further uniqueness based on the context of the object, not just the class name. In any case, we agree about the source of the problem and hopefully agree that there is in fact a problem, so let's try and find a solution? ;) -
Bernhard Kraft commented on patch set 3 10/19/16, 12:08
I guess different validators for the same class (but different instances) should get counted as feature. I guess it is even such a specific issue that it should rather get solved by a custom validator in "Domain/Validator/DomainModelValidator" where the validator has to differentiate between instances by some supplied key and/or value. I also thought about this. But at the time the validator resolver traverses the (possible) class tree structure the data from the $arguments passed to the controller are not there. First the validators get instanciated in the resolver, then the arguments get set from within the Controller. During setting the argument the validation takes place ... -
Bernhard Kraft commented on patch set 3 10/19/16, 12:09
I do not really see any arguments against the stack solution!! -
Alexander Stehlik uploaded patch set 4 12/04/16, 18:02
-
TYPO3com voted on patch set 4 V -1 12/04/16, 18:06 Completed build in 04m 23s on Sun, 4 Dec, 07:06 PM Test Summary: 2133 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5514
-
Alexander Stehlik commented on patch set 4 12/04/16, 18:15
OK, simply removing the cache does not work because of recursive validation. Will try the stack solution.
-
Alexander Stehlik uploaded patch set 5 12/04/16, 18:39
-
TYPO3com voted on patch set 5 V -1 12/04/16, 18:44 Completed build in 04m 19s on Sun, 4 Dec, 07:44 PM Test Summary: 54330 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5516
-
Alexander Stehlik uploaded patch set 6 12/04/16, 18:50
-
Alexander Stehlik commented on patch set 6 12/04/16, 18:51
OK, I found a quite simple solution. I reset the base validator conjunction cache for each controller request. For me this makes perfect sense because every request should handle validation on its own. This fixes the remaining duplicate error issue. I hope this is OK. -
TYPO3com voted on patch set 6 V +1 12/04/16, 18:55 Completed build in 04m 26s on Sun, 4 Dec, 07:55 PM Test Summary: 54330 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-5517
-
Benni Mack commented on patch set 6 11/24/17, 21:11
please rebase, so it can be tested. -
Alexander Stehlik uploaded patch set 7 12/28/17, 13:54
-
TYPO3com voted on patch set 7 V -1 12/28/17, 13:54 Completed build in 08s on Thu, 28 Dec, 02:54 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-17990
-
Alexander Stehlik uploaded patch set 8 12/28/17, 13:56
-
TYPO3com voted on patch set 8 V -1 12/28/17, 14:03 Completed build in 07m 08s on Thu, 28 Dec, 03:03 PM Test Summary: 8 of 30168 failed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-17991
-
Alexander Stehlik uploaded patch set 9 01/03/18, 09:40
-
TYPO3com voted on patch set 9 V +1 01/03/18, 09:48 Completed build in 07m 26s on Wed, 3 Jan, 10:48 AM Test Summary: 30007 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-18034
-
Anja Leichsenring uploaded patch set 10 06/09/18, 16:52
-
TYPO3com voted on patch set 10 V -1 06/09/18, 16:53 Completed build in 07s on Sat, 9 Jun, 06:53 PM Test Summary: No tests found Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24223
-
Anja Leichsenring uploaded patch set 11 06/09/18, 17:35
-
Anja Leichsenring uploaded patch set 12 06/09/18, 17:37
-
TYPO3com voted on patch set 11 V -1 06/09/18, 17:37 Completed build in 02m 07s on Sat, 9 Jun, 07:37 PM Test Summary: 28505 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24226
-
Anja Leichsenring uploaded patch set 13 06/09/18, 17:41
-
TYPO3com voted on patch set 12 V -1 06/09/18, 17:45 Completed build in 08m 28s on Sat, 9 Jun, 07:45 PM Test Summary: 32701 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24227
-
TYPO3com voted on patch set 13 V +1 06/09/18, 17:49 Completed build in 08m 07s on Sat, 9 Jun, 07:49 PM Test Summary: 32701 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24228
-
Christian Kuhn uploaded patch set 14 06/09/18, 19:29
-
Christian Kuhn voted on patch set 14 V +1 CR +1 06/09/18, 19:30
-
TYPO3com voted on patch set 14 V +1 06/09/18, 19:40 Completed build in 11m 26s on Sat, 9 Jun, 09:40 PM Test Summary: 32701 passed Find logs and detail information at https://bamboo.typo3.com/browse/CORE-GTC-24250
-
Anja Leichsenring voted on patch set 14 V +2 CR +2 06/09/18, 19:41
-
Anja Leichsenring merged patch set 15 06/09/18, 19:41