92021[FEATURE] Add Extension Scanner CLI command
Commit message
Review
-
Code review CR 0
-
Verified V 0
- core-ci +1 CI
Issues 1
Files 8
- typo3/sysext/core/Documentation/Changelog/14.1/Feature-108414-ExtensionScannerCLICommand.rstnew+87 −0
- typo3/sysext/install/Classes/Command/ExtensionScannerCommand.php3new+286 −0
- typo3/sysext/install/Classes/ExtensionScanner/Output/CheckstyleOutputFormatter.phpnew+104 −0
- typo3/sysext/install/Classes/ExtensionScanner/Output/JsonOutputFormatter.phpnew+71 −0
- typo3/sysext/install/Classes/ExtensionScanner/Output/OutputFormatterInterface.phpnew+54 −0
- typo3/sysext/install/Classes/ExtensionScanner/Output/TableOutputFormatter.phpnew+111 −0
- typo3/sysext/install/Classes/ExtensionScanner/ExtensionScannerService.php2new+287 −0
- typo3/sysext/install/Classes/ServiceProvider.php+22 −0
Review log 1419
-
Sebastian Mendel uploaded patch set 1 12/06/25, 00:45
-
Sebastian Mendel uploaded patch set 2 12/06/25, 00:48
-
Sebastian Mendel uploaded patch set 3 12/06/25, 00:48
-
core-ci voted on patch set 2 V -1 12/06/25, 01:02 Copied votes on follow-up patch sets have been updated: * Verified-1 has been copied to patch set 3 (copy condition: "changekind:NO_CHANGE"). Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91695
-
core-ci voted on patch set 1 V -1 12/06/25, 01:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91694
-
core-ci voted on patch set 3 V -1 12/06/25, 01:06 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91697
-
Sebastian Mendel marked it work in progress 12/06/25, 01:23
-
Garvin Hicking commented on patch set 3 12/06/25, 04:48
Hey this is pretty nice, I wished for it 😊ExtensionScannerCommand.php:70I think we could introduce a registry (maybe based on php attributes) for the matchers, so we iterate on those. This would prevent manual iteration here, and the odd "class file" approsch? Ideally we could add this registry as an independent pre-patch to this feature, what do you think? -
Sebastian Mendel uploaded patch set 4
V -112/06/25, 08:43 -
Sebastian Mendel uploaded patch set 5 12/06/25, 08:44
-
core-ci voted on patch set 4 V +1 12/06/25, 08:52 Copied votes on follow-up patch sets have been updated: * Verified+1 has been copied to patch set 5 (copy condition: "changekind:NO_CHANGE"). Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91723
-
core-ci voted on patch set 5 V +1 12/06/25, 08:53 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/91724
-
Sebastian Mendel commented on patch set 5 12/06/25, 12:36
This change is ready for review.ExtensionScannerCommand.php:70Reply -
Sebastian Mendel marked it work in progress 12/06/25, 12:37
-
Sebastian Mendel commented on patch set 5 12/07/25, 19:22
ExtensionScannerCommand.php:70ReplyDone -
Garvin Hicking commented on patch set 5 12/07/25, 20:25
Unresolved
I've talked about this with Stefan Bürk a bit today. We think the CLI command should also be made more resilient to errors in files/parsing/AST creation. The backend GUI for example does this with distinct AJAX calls for every file that is scanned. We might want to leverage sub-processes for this. Also we'll need a solution to properly guide people to the RST files (edit them in an IDE of choice by giving the full filename, or maybe even linking to the docs.typo3.org changelog site of the corresponding RST to see it rendered in the browser). We could also leverage IDE editing capabilities by providing the matched file with a full path and the `:XXX` line number notation so that editors can jump directly to that file when using a terminal that supports it (many do). We should not include system extensions. These will by intention always contain matches, also strong ones, because otherwise we could not implement deprecations. Scanning the core extensions has no use other than creating question marks for users. Also we could allow to filter for only strong matches. Or by a specific ReST file entry / configuration. I believe this is worthful to pursue, and we should thoroughly discuss the feature set and implementation to flesh this out into a nice rounded feature. The first thing we should work out is your pre-patch with the integration of a registry / service locators. So we'll need to take this step by step, so that this feature will not just be an after-thought but a first-class citizen of the extension scanner. -
Garvin Hicking commented on patch set 5 12/07/25, 20:27
Unresolved
I forgot: Also Stefan had the idea that we would need something similar to the "phpstan baseline". Otherwise, integration of this into a CI/CD pipeline would be quite overwhelming and filled with false positives. So the CLI command would need to take such a baseline into consideration. That in turn would also improve the GUI scanner as well, so that people would be able to mark specific deprecations / breaking changes as "acknowledged". For that we would need to go through the messages to have some kind of stable format as phpstan does. -
Garvin Hicking commented on patch set 5 12/07/25, 20:39
Unresolved
We should also think about moving all of this to an EXT:extensionscanner scope. That way EXT:install would not be mandatory (because we're currently trying to reduce the scope of EXT:install to really only install related things; checking CLI/CI+CD scripts like this should probably not require to have the whole EXT:install extension available). Having that extension optional in the Install Tool then might be a further challenge, though. We might also want to get in touch with the https://github.com/mschwemer/typo3scan maintainers, ask for feedback, and do it right to get one maintainable codebase. Maybe a solution could also be to not have this CLI command inside the Core, but just be sure to provide a proper API and to continue a 3rd party implementation way.ExtensionScannerService.php:117Unresolvedthese includes / filters should probably be configurable and not hardcodedExtensionScannerService.php:266UnresolvedWould also be interesting for developers to create own matcher configurations in a sitepackage-like extension, so they could do custom scanning and deprecation implementation on their own. Imagine this: - EXT:news has some custom PSR-events and deprecats/breaks things - It could deliver a scanner config in `Configuration/ExtensionScanner/...` - Any user that then installs the new EXT:news version could scan their own extensions that listen to the EXT:news PSR-events and would get notified of changes to method signatures This would allow our ecosystem to profit from the core API. This would also mean to make the API of the ExtensionScanner kind of public, and that need a good architecture. (Maybe this could even be a TYPO3 Association Budget Application, because that's a lot of work to do properly) -
Garvin Hicking abandoned the change 11/11/26, 10:46
I'm abandoning this, my comments were directed at a bigger scope which never took off. We can re-start this happily; meanwhile the CLI command has been added to v15.