80404[TASK] Introduce Symfony attribute based registration of CLI commands
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 2
Review log 5371
Show 3446 earlier messages
-
Bastien Lutz uploaded patch set 1 08/05/23, 10:00
-
core-ci voted on patch set 1 V +1 08/05/23, 10:07 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45103
-
Stefan Bürk uploaded patch set 2
V +108/05/23, 14:59 -
Stefan Bürk voted on patch set 2 V +1 CR +1 08/05/23, 15:01
-
core-ci voted on patch set 2 V +1 08/05/23, 15:06 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45110
-
Oli Bartsch commented on patch set 2 08/05/23, 16:24
-
Chris Müller commented on patch set 2 08/05/23, 17:14
ConsoleCommand.php:24ReplyWe have then "different" attributes: In v12 were introduced: - \TYPO3\CMS\Backend\Attribute\Controller - \TYPO3\CMS\Install\Attribute\UpgradeWizard When using the "As" prefix this gets inconsistent: Some has "As", some not. -
Stefan Bürk voted on patch set 2 V 0 CR 0 08/05/23, 18:06
-
Oli Bartsch commented on patch set 2 08/05/23, 19:33
ConsoleCommand.php:24ReplyCorrect. I propose to use the As naming for all new attributes and to think of a migration path for the existing ones. -
Stefan Bürk commented on patch set 2 08/06/23, 16:45
A note - this solves midterm the issue, that if some names are used in the description of a command and replaced in the yaml, it no longer produces weired descriptions output for the command listing/help. -
Mathias Brodala commented on patch set 2 08/07/23, 07:24
Feature-101567-IntroducePHPAttributeToAutoconfigureCliCommands.rst:43This should be "AsConsoleCommand" to be consistent with the recently added "AsEventListener". -
Bastien Lutz uploaded patch set 3
V +108/07/23, 09:27 -
Mathias Brodala updated the commit message in patch set 4 08/07/23, 09:31
-
core-ci voted on patch set 3 V +1 08/07/23, 09:35 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45175
-
core-ci voted on patch set 4 V +1 08/07/23, 09:39 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45176
-
Chris Müller uploaded patch set 5
V +108/07/23, 10:07 -
Chris Müller uploaded patch set 6 08/07/23, 10:08
-
Chris Müller commented on patch set 6 08/07/23, 10:09
ConsoleCommand.php:24ReplyAck -
core-ci voted on patch set 6 V +1 08/07/23, 10:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45179
-
core-ci voted on patch set 5 V +1 08/07/23, 10:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45178
-
Bastien Lutz commented on patch set 6 08/09/23, 10:45
ConsoleCommand.php:24ReplyDoneFeature-101567-IntroducePHPAttributeToAutoconfigureCliCommands.rst:43ReplyDone -
Benjamin Franzke commented on patch set 6 CR -1 08/10/23, 08:50
will reviewmissing line: Releases: main -
Benjamin Franzke uploaded patch set 7
CR -1V +108/10/23, 09:01 -
core-ci voted on patch set 7 V +1 08/10/23, 09:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/45316
-
Jörg Bösche voted on patch set 7 V +1 CR +1 08/10/23, 12:54
-
Benjamin Kott commented on patch set 7 09/14/23, 21:46
please consider adding this, also to 12.4 this is marked as feature, yes - but in general it´s only a simple improvement to developers. Gating this away until v13 feels wrong to me. -
Garvin Hicking commented on patch set 7 09/15/23, 07:32
Feature-101567-IntroducePHPAttributeToAutoconfigureCliCommands.rst:34Suggestion: "(all parameters as above are still viable: command, description, schedulable, hidden)" -
Garvin Hicking voted on patch set 7 V +1 CR +1 09/15/23, 07:43
-
Bastien Lutz uploaded patch set 8
CR +1V +109/19/23, 09:57 -
core-ci voted on patch set 8 V -1 09/19/23, 10:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46750
-
Bastien Lutz commented on patch set 8 09/19/23, 10:09
Feature-101567-IntroducePHPAttributeToAutoconfigureCliCommands.rst:34ReplyAs discussed in the typo3-cms-coredev channel i decided to use the symfonf shipped AsCommand Attribute. Therefore in order to overwrite schedulable or hidden the old way of registration is still accepted. A note was added to the rst file. -
Bastien Lutz uploaded patch set 9
V -109/19/23, 10:13 -
Mathias Brodala commented on patch set 9 09/19/23, 10:20
CLISymfonycommandsImportant-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst:19And this cannot be changed since the Symfony "AsCommand" attribute does not have these parameters, correct? If yes, then this should be emphasized and mentioned once more in the example below. -
core-ci voted on patch set 9 V +1 09/19/23, 10:21 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46752
-
Garvin Hicking commented on patch set 9 09/19/23, 10:34
Services.php:49Maybe for "future us" we could add a comment here like: // hidden, schedulable is not (yet?) a configurable symfony attribute parameter // If those parameters shall be set differently, services.yaml registration can be used // Note: If services.yaml registration gets deprecated at some point, another way of exposing a way to alter these attributes must be possible. (maybe a shorter variant of this) -
Mathias Brodala commented on patch set 9 09/19/23, 10:44
Services.php:49ReplyAt least "hidden" exists in Symfony, so that would work as expected: https://github.com/symfony/symfony/blob/4ba165a7e2c1a9bcdca69393e7fef8f25a66f8ea/src/Symfony/Component/Console/Attribute/AsCommand.php#L24 Maybe could consider adding a custom attribute "AsSchedulerTask" which would cover the "schedulable: true" case. If absent, "schedulable: false" could be implied. -
Bastien Lutz updated the commit message in patch set 10
V +109/19/23, 11:48 -
Bastien Lutz commented on patch set 10 09/19/23, 11:48
Reply
DoneReply
DoneReply
DoneServices.php:49ReplyHidden can not be used as it is protected. I think providing multiple attributes for this simple registration would over complicate this and may be confusing. Adding a comment for our "future us" sounds reasonable i'll add a comment with the next patchsetImportant-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst:19ReplyCorrect. They are not provided. As already discussed on slack the "old" way via Services.yaml should be used if a dev wants to overwrite them. -
Bastien Lutz uploaded patch set 11 09/19/23, 11:52
-
core-ci voted on patch set 10 V +1 09/19/23, 11:58 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46767
-
core-ci voted on patch set 11 V +1 09/19/23, 12:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46768
-
Bastien Lutz updated the commit message in patch set 12
V +109/19/23, 12:07 -
core-ci voted on patch set 12 V +1 09/19/23, 12:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/46772
-
Benjamin Franzke commented on patch set 12 09/19/23, 12:48
Services.php:48Services.yamlServices.php:49Replyack, I think it's fine for the rare case for non schedulable commands to be required to use Services.yaml -
Stefan Bürk commented on patch set 12 09/19/23, 16:46
Services.php:49ReplyFYI - for me, having scheduable commands are the "rare case". 100% of may commands I created and project and internal projects are mostly long running tasks and not suited to be scheduled as scheduler task. rare case for me would be to have schedulable commands. Makes the decision harder here. Maybe we should keep that here with false, and for v13 a core implementation attrobute which supports it then. However, not blocking it. But also not really voting it as I'm quite unsure if this is really the right default.
-
Benjamin Franzke commented on patch set 12 10/26/23, 06:46
Services.php:49ReplyI'd say long-running tasks are still "fine" to be scheduled. scheduler is a task runner. IMO "schedulable:false" main usage is to define: This command cannot run without user interaction – e.g. it needs your input/action during runtime. …and I think that's a rare case. Would you be fine with that definition? -
Stefan Bürk commented on patch set 12 10/26/23, 10:59
Services.php:49ReplyI'm still disagree. From personal experience my commands mostly did not need to be schedualable, and often would lead to unexpected behaviour if the command would have been configured to be scheduled and executed in the web contect and not from cli running the scheduler command. My point is just, that there is no real good default as it differs from person/project to another which would be the "correct" default. My comment was more a FYI and not meant as blocking. Therefore, fine with your "definition" as we would otherwise end a dead end. -
Stefan Bürk rebased onto patch set 13
V +110/26/23, 10:59 -
core-ci voted on patch set 13 V +1 10/26/23, 11:08 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48225
-
Stefan Bürk commented on patch set 14
V +110/26/23, 11:12Published edit on patch set 13. -
Stefan Bürk commented on patch set 14 10/26/23, 11:13
Services.php:48ReplyDone -
Benni Mack commented on patch set 14 10/26/23, 11:18
Services.php:49Replymost of my scheduler tasks are wrapped in a CLI Command, I recommend to slowly dissolve scheduler tasks that can't be run directly on CLI. So, my from experience, roughly 60-80% of my project Cli commands are schedulable. -
core-ci voted on patch set 14 V +1 10/26/23, 11:19 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48227
-
Benjamin Franzke updated the commit message in patch set 15
V +110/26/23, 11:22 -
Benjamin Franzke voted on patch set 15 CR -1 10/26/23, 11:23
-
Benjamin Franzke uploaded patch set 16
CR -110/26/23, 11:29 -
core-ci voted on patch set 15 V +1 10/26/23, 11:29 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48228
-
Benjamin Franzke voted on patch set 16 V +1 CR +1 10/26/23, 11:29
-
core-ci voted on patch set 16 V +1 10/26/23, 11:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48229
-
Garvin Hicking voted on patch set 16 V +1 CR +1 10/26/23, 12:04
-
Stefan Bürk voted on patch set 16 V +1 CR +1 10/26/23, 14:49
-
Stefan Bürk voted on patch set 16 V +2 CR +2 10/26/23, 21:13
-
Stefan Bürk updated the commit message in patch set 17
CR +1V +110/26/23, 21:26 -
Stefan Bürk updated the commit message in patch set 18 10/26/23, 21:27
-
Stefan Bürk commented on patch set 18 V +1 CR +1 10/26/23, 21:27
Commit message was a little off. Beside that, I already created the backport. Waiting for revotes before merge. -
core-ci voted on patch set 17 V +1 10/26/23, 21:36 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48265
-
core-ci voted on patch set 18 V +1 10/26/23, 21:37 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48266
-
Garvin Hicking voted on patch set 18 V +1 CR +1 10/26/23, 21:44
-
Stefan Bürk voted on patch set 18 V +2 CR +2 10/26/23, 21:46
-
Stefan Bürk merged patch set 19 10/26/23, 21:47
ConsoleCommand.php:24