84004[BUGFIX] Mitigate exceptions in `LogDataTrait::formatLogDetailsStatic`
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Garvin Hicking +1
-
Verified V +2 Done
- Stefan Bürk +2
- Garvin Hicking +1
- core-ci +1 CI
Issues 1
Files 4
Review log 2333
Show 68 earlier messages
-
Thomas Hohn uploaded patch set 1 04/23/24, 11:19
-
Thomas Hohn updated the commit message in patch set 2 04/23/24, 11:20
-
core-ci voted on patch set 1 V +1 04/23/24, 11:25 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56568
-
core-ci voted on patch set 2 V +1 04/23/24, 11:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56569
-
Christian Kuhn commented on patch set 2 CR -1 04/23/24, 13:05
-
Thomas Hohn commented on patch set 2 04/23/24, 13:47
LogDataTrait.php:59ReplyThis comment is kind of weird too // Handle legacy "%s" placeholders Since it actually handles % anything and then in the end all %s are replaced by '' But what should the fallback be - do nothing? And then just replace %s with '' ? -
Thomas Hohn uploaded patch set 3
CR -1V +104/23/24, 14:00 -
Thomas Hohn commented on patch set 3 04/23/24, 14:04
LogDataTrait.php:59ReplyProposed a different attempt
-
core-ci voted on patch set 3 V +1 04/23/24, 14:05 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56581
-
Stefan Bürk commented on patch set 3 04/23/24, 15:09
LogDataTrait.php:59ReplyWhat lolli/we meant was: 1. try-catch do the vsprintf() without the str_contains() check at all. 2. in case of a value expection use the fallback. getting a suitable check is not really manageable. Or use only the "$substitute" emtpy check. The point was, that the str_contains() call is not good at all in any case and missleading. Would it be okay for you to provide such a attempt/change ? -
Thomas Hohn uploaded patch set 4
V +104/23/24, 17:08 -
core-ci voted on patch set 4 V -1 04/23/24, 17:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56597
-
Thomas Hohn uploaded patch set 5
V -104/23/24, 17:14 -
core-ci voted on patch set 5 V +1 04/23/24, 17:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/56598
-
Garvin Hicking commented on patch set 5 09/05/24, 08:43
This looks good to me now, however maybe we could rewrite the test to use a dataprovider instead to increase legibility and better test failure reporting? (I can offer to do that too, but only after feature freeze) -
Stefan Bürk commented on patch set 5 09/05/24, 20:41
Reply
Yes, either sigle test methods or DataProvider - but different calls/expectation for different input in one test case is not good. Will change that ....LogDataTraitTest.php:26Test case class should not implement that trait directly. To keep test cases clean a class implementing the trait needs to be constructed. Due to the simple nature of the trait, this can be done simply with: ```php $subject = new class() { use LogDataTrait; public static callFormatLogDetailsStatic( string $detailString, array $substitutes ): string { return self::formatLogDetailsStatic($detailString, array $substitures); } } ``` or with a test fixture class allong with a dispatcher method towards the protected method. -
Stefan Bürk commented on patch set 5 CR -1 09/05/24, 20:45
on itLogDataTraitTest.php:32`assertEquals()` does not take type into account and thus we use assertSame() over `assertEquals()` to mitigate eventually relaxed issues. -
Stefan Bürk uploaded patch set 6
CR -1V +109/06/24, 14:09 -
Stefan Bürk uploaded patch set 7 09/06/24, 14:12
-
Stefan Bürk updated the commit message in patch set 8 09/06/24, 14:13
-
Stefan Bürk commented on patch set 8 09/06/24, 14:14
Reply
DoneReply
DoneLogDataTraitTest.php:26ReplyDoneLogDataTraitTest.php:32ReplyDone -
core-ci voted on patch set 6 V -1 09/06/24, 14:15 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64966
-
Stefan Bürk uploaded patch set 9 09/06/24, 14:17
-
Stefan Bürk uploaded patch set 10 09/06/24, 14:19
-
core-ci voted on patch set 8 V -1 09/06/24, 14:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64968
-
core-ci voted on patch set 7 V -1 09/06/24, 14:20 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64967
-
Stefan Bürk updated the commit message in patch set 11 09/06/24, 14:21
-
core-ci voted on patch set 10 V -1 09/06/24, 14:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64970
-
core-ci voted on patch set 11 V +1 09/06/24, 14:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/64971
-
Stefan Bürk voted on patch set 11 CR +1 V +1 09/06/24, 14:39
-
Garvin Hicking voted on patch set 11 CR +1 V +1 09/06/24, 18:45
-
Stefan Bürk voted on patch set 11 CR +2 V +2 09/06/24, 18:57
-
Stefan Bürk merged patch set 12 09/06/24, 19:14
LogDataTrait.php:59