74750[TASK] Add tests for log `#[Channel(...)]` attribute
Commit message
Review
-
Code review CR +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
-
Verified V +2 Done
- Stefan Bürk +2
- Christian Kuhn +1
- core-ci +1 CI
Issues 3
Files 7
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_logger/Classes/ConstructorAttributeChannelTester.php5new+33 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_logger/Classes/LoggerAwareClassAttributeChannelTester.php2new+33 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_logger/Configuration/Services.yaml3new+11 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_logger/ext_emconf.phpnew+21 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Log/DummyWriter.phpnew+33 −0
- typo3/sysext/core/Tests/Functional/Log/LoggerAwareChannelTest.php8new+88 −0
- composer.json5+2 −1
Review log 3852
Show 1927 earlier messages
-
crell uploaded patch set 1 05/26/22, 20:56
-
core-ci voted on patch set 1 V -1 05/26/22, 21:04 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27482
-
Simon Schaufelberger commented on patch set 1 05/26/22, 21:51
> It should be safe to backport to v11 as well. this should not be part of the commit message imho. -
Simon Schaufelberger commented on patch set 1 05/26/22, 21:56
LoggerAwareChannelTest.php:54this should be covered by the phpstorm meta file, or? In that case, it can be dropped. -
Simon Schaufelberger commented on patch set 1 V -1 CR -1 05/26/22, 21:58
open CGL issues exist. -
crell commented on patch set 1 05/27/22, 14:18
LoggerAwareChannelTest.php:54ReplyDone -
crell uploaded patch set 2 05/27/22, 14:26
-
core-ci voted on patch set 2 V +1 05/27/22, 14:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27495
-
Simon Schaufelberger voted on patch set 2 CR +1 05/27/22, 15:38
-
Oliver Klee voted on patch set 2 V +1 06/03/22, 15:41
-
Stefan Bürk commented on patch set 2 CR -1 06/03/22, 16:57
ConstructorAttributeChannelTester.php:4Header comment missing.ConstructorAttributeChannelTester.php:14Mh. Want start here a little discussion how to handle "attributes" on method argument layer ... Personally I would suggest, if we are starting with this kind of syntax, to use this with line breaking the arguments and having the attributes above the argument: ``` public function __constructr( #[Channel('beep') LoggerInterface $logger ) { } ``` Maybe there has been discussions about it, and I missed some documentations about it. What are other feelings and opinions about this ? Beside this .. can this be used with "CCP" ? (Not to change this now, just as a general question). Makes the backport easier as no property has bee added than etc.LoggerAwareClassAttributeChannelTester.php:4Header comment missing.Services.yaml:5Public as default feels kind of wrong, even for a "test extension". At least, it's not the TYPO3 way. Maybe raw symfony has public true as default.DummyWriter.php:4Header comment missing.DummyWriter.php:5Test/Dummy classes should be under a "Fixture/xxx" folder. This has some seperations between core, test and fixture classes. Is done already on other places too. So please move the file correspondingly and adjust the namespace afterwards.LoggerAwareChannelTest.php:4Header comment missing.LoggerAwareChannelTest.php:51superflous empty lineLoggerAwareChannelTest.php:66superflous empty line -
crell commented on patch set 2 06/03/22, 17:33
ConstructorAttributeChannelTester.php:4ReplyDoneConstructorAttributeChannelTester.php:14ReplyI'm not aware of any convention on this point yet. I suspect FIG will develop one within the next few months, probably. (I'm on the new working group for evolving coding standards. It hasn't come up yet, but it very likely will soon.) Whatever they come up with is what we should probably follow. My personal take at the moment is that adding an attribute should not, in itself, force going to a new line, but if it adds enough to the line length that it makes sense to break out to separate lines then it should go above the parameter, as in Stefan's sample. Attributes are totally CPP compatible, in which case they end up applying to both the parameter and the property, as appropriate. I didn't use CPP in this case to make it backportable, although... that doesn't much matter as the behavior here is only relevant in PHP 8 anyway, so the test should be marked as such. So it probably can be CPPified safely, whether the attribute is inlined or not.LoggerAwareClassAttributeChannelTester.php:4ReplyDoneServices.yaml:5ReplyIt's necessary since the test classes are requested through DI in the test. The alternative is to not auto-scan the directory but manually add both classes with a public flag, but... that just seems like extra typing to end up in exactly the same place. Can the public flag be put on the second YAML block below, with the `resource` entry? I don't know that is an improvement, though.DummyWriter.php:4ReplyDoneDummyWriter.php:5ReplyDoneLoggerAwareChannelTest.php:4ReplyDoneLoggerAwareChannelTest.php:51ReplyDoneLoggerAwareChannelTest.php:66ReplyDone -
crell uploaded patch set 3 06/03/22, 17:41
-
core-ci voted on patch set 3 V +1 06/03/22, 17:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27691
-
Oliver Klee voted on patch set 3 V +1 06/03/22, 21:57
-
Simon Schaufelberger wrote 06/04/22, 00:25
Removed reviewer Simon Schaufelberger. -
crell uploaded patch set 4 06/07/22, 21:13
-
Oliver Klee wrote 06/07/22, 21:18
Removed reviewer Oliver Klee. -
core-ci voted on patch set 4 V -1 06/07/22, 21:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27781
-
core-ci commented on patch set 4 06/07/22, 22:18 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27781
-
core-ci voted on patch set 4 V +1 06/07/22, 22:49 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/27781
-
crell commented on patch set 4 06/07/22, 23:25
ConstructorAttributeChannelTester.php:14ReplyDoneServices.yaml:5ReplyDone -
Stefan Bürk rebased onto patch set 5 07/13/22, 15:00
-
core-ci voted on patch set 5 V +1 07/13/22, 15:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29072
-
Stefan Bürk commented on patch set 5 CR -1 07/13/22, 15:13
There are more - will push later on it. Please see commit message comment.Please add the forge issue number of the initial patch (or eventually follow up patches) as "Related:" to the commit message betwen "Resolves" and "Releases". Also add them in forge as related issues to #97695. -
crell updated the commit message in patch set 6 07/13/22, 16:40
-
core-ci voted on patch set 6 V +1 07/13/22, 16:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29076
-
Stefan Bürk uploaded patch set 7 07/14/22, 23:55
-
Stefan Bürk commented on patch set 7 07/14/22, 23:59
Reply
Done -
core-ci voted on patch set 7 V -1 07/15/22, 00:03 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29176
-
Stefan Bürk uploaded patch set 8 07/15/22, 00:05
-
core-ci voted on patch set 8 V +1 07/15/22, 00:12 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29177
-
Stefan Bürk updated the commit message in patch set 9 07/15/22, 00:15
-
Stefan Bürk commented on patch set 9 V +1 CR +1 07/15/22, 00:16
Reply
Done -
core-ci voted on patch set 9 V +1 07/15/22, 00:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29178
-
Benni Mack commented on patch set 9 CR -1 07/15/22, 09:06
composer.json:292the test_logger extension needs a composer.json (and this line needs to be removed). This way, autoloader is working and we do not have to touch composer.json (same as with other fixture extensions) -
Stefan Bürk commented on patch set 9 07/15/22, 09:33
composer.json:292ReplyYes and no. And it's not only about autoloading in the test. Ack - test fixture extension should get a dedicated composer.json (as it is planned that extension must have one regardless if composer or legacy install etc). However, there are more plans behind only "autoloading". If this entry is omited in the root composer.json, PHPStorm will say that the namespace is not PSR-4 compatible (if classmap definitions are removed) - and tests are crashing. There are multiple steps planned, just wanted provide the new extension in the minimun current working state which is needed. I will add the composer.json, but we need to have the PSR-4 definition in root composer.json for now. Additionally, a prepared PSR-4 namespace integration test would consider sys-ext composer.json for code files, and root composer.json autoload-dev->psr-4 to validate namespaces in ci. Maybe this can be extended to pre-scan for "all composer.json's" recursivly and build this info up before-hand. Will stop for now, but there were more points on this. As for now, composer.json are not "enforced" needed as tests are running in "legacy mode" (which may change some time in the future if TF can cope with that). Additionally, we not really finished to discuss how we want the composer.json streamlined for the test fixture extension - and as this has to be done for all, I left it out. I can add a first composer.json, but want to keep the PSR-4 definition in the root composer.json for now. Would it be fine for you to delay the fixture extension composer.json to the patch which introduces this for all test fixture extensions (along with streamlining the namespaces and places where they are placed and so on) ? -
crell commented on patch set 9 07/21/22, 20:09
composer.json:292ReplyI'm lost then. Are there still pending tasks on this issue? If not, which issue is blocking? (I have no strong feelings about test extension organization.) -
Stefan Bürk commented on patch set 9 07/21/22, 20:12
composer.json:292ReplyTalked with Benni. We will add the composer.json at a later point. Resolving this now. I think Benni will remove the -1 after a revisit and if nothing else speaks for him for the -1. -
Stefan Bürk commented on patch set 9 07/21/22, 20:12
composer.json:292ReplyDone -
Benni Mack voted on patch set 9 CR 0 07/22/22, 06:44
-
Stefan Bürk rebased onto patch set 10 07/24/22, 16:17
-
Stefan Bürk voted on patch set 10 V +1 CR +1 07/24/22, 19:06
-
core-ci voted on patch set 10 V -1 07/24/22, 19:21 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29475
-
crell rebased onto patch set 11 07/25/22, 17:22
-
core-ci voted on patch set 11 V +1 07/25/22, 17:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29506
-
Stefan Bürk voted on patch set 11 V +1 CR +1 07/25/22, 17:46
-
Stefan Bürk uploaded patch set 12 07/26/22, 20:52
-
core-ci voted on patch set 12 V +1 07/26/22, 21:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/29587
-
Christian Kuhn voted on patch set 12 V +1 CR +1 07/26/22, 21:05
-
Stefan Bürk voted on patch set 12 V +2 CR +2 07/26/22, 21:05
-
Stefan Bürk merged patch set 13 07/26/22, 21:05