81617[TASK] Respect the AsCommand `hidden` constructor argument
Commit message
Review
-
Code review CR +2 Done
- Benjamin Franzke +2
- Chris Müller +1
- Garvin Hicking +1
- Oliver Hader +1
-
Verified V +2 Done
- Benjamin Franzke +2
- Chris Müller +1
- Garvin Hicking +1
- Oliver Hader +1
- core-ci +1 CI
Issues 2
Files 9
- typo3/sysext/core/Configuration/Services.php+3 −3
- typo3/sysext/core/Documentation/Changelog/12.4.x/Important-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst5+6 −7
- typo3/sysext/core/Tests/Functional/DependencyInjection/AsCommandAttributeTest.phpnew+70 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_di/Classes/Command/HiddenTestCommand.phpnew+32 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_di/Classes/Command/VisibleTestCommand.phpnew+32 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_di/Configuration/Services.yamlnew+8 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_di/composer.jsonnew+19 −0
- typo3/sysext/core/Tests/Functional/Fixtures/Extensions/test_di/ext_emconf.phpnew+21 −0
- composer.json+1 −0
Review log 1822
-
Benjamin Franzke uploaded patch set 1 10/30/23, 16:48
-
core-ci voted on patch set 1 V +1 10/30/23, 16:55 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48365
-
Chris Müller voted on patch set 1 V +1 CR +1 10/30/23, 16:59
-
Garvin Hicking commented on patch set 1 10/30/23, 18:33
But now this |name cariation isn't (yet?) documented, and the hidden-part looks as if dropped altogether? Just from reading the current ReST I would wonder what happened to the formerly existing "hidden" command option? -
Benjamin Franzke uploaded patch set 2
CR +1V +110/31/23, 05:18 -
Benjamin Franzke commented on patch set 2 10/31/23, 05:19
Reply
`hidden` is encoded into a leading `|` in symfony's AsAttribute constructor. I've had plans to add a functional for that and did so now. Updated the patch accordingly. -
core-ci voted on patch set 2 V -1 10/31/23, 05:25 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48376
-
Andreas Kienast commented on patch set 2 10/31/23, 05:47
Important-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst:18Just for clarity: since we're editing this file anyway, I'd write `schedulable` (with backticks) to make it more clear we're dealing with a keyword here. -
Garvin Hicking commented on patch set 2 10/31/23, 07:01
Reply
What I meant was a sentence in the ReST file like: To indicate that a command shall be hidden from the command lisg, you can prepend the "|" pipe character in front of the name of the Symfony Attribute, like this: (example) I wonder, if such "magic" is used, couldn't we also append a "|" character at the end, too, to make "schedulable" be set? Or two "|" in front? It feels a bit odd that one parameter can be accessed, but not the other...? -
Benjamin Franzke uploaded patch set 3
V -110/31/23, 07:37 -
Benjamin Franzke commented on patch set 2 10/31/23, 07:37
Reply
No, `hidden` is a defined constructor argument and thus "ok" to be used, but we rather won't introduce implicit public api like a trailing |. Sorry. The intention is: *Every* proper command should actually be schedulable – which means: "It can work without runtime user interaction" (I think it actually is an antipattern that we have the `schedulable` flag at all). And I'm not talking about DX-console-commands like b13/make: they should/must not be published to production anyway.Important-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst:18ReplyAck -
core-ci voted on patch set 3 V +1 10/31/23, 07:45 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48383
-
Garvin Hicking commented on patch set 3 10/31/23, 09:29
Important-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst:17The Test case uses: ``` #[AsCommand(name: 'testdi:ascommand:hidden', description: 'This is a hidden command.', hidden: true)] ``` so shouldn't the Changelog note at this point say "Only the parameters `command`, `description`, `hidden` are still viable."? -
Benjamin Franzke commented on patch set 4
V +111/06/23, 08:10Published edit on patch set 3. -
Benjamin Franzke commented on patch set 4 11/06/23, 08:11
Important-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst:17ReplyDone (feel free to edit the patchsets if you see obvious issues). -
core-ci voted on patch set 4 V +1 11/06/23, 08:22 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/48613
-
Chris Müller voted on patch set 4 V +1 CR +1 11/06/23, 09:07
-
Garvin Hicking commented on patch set 4 V +1 CR +1 11/06/23, 16:46
Important-101567-UseSymfonyAttributeToAutoconfigureCliCommands.rst:17ReplyPerfect. Didn't want to hijack anything and wanted to ensure we're on the same page :-) Thanks! -
Oliver Hader voted on patch set 4 CR +1 11/06/23, 18:09
-
Oliver Hader commented on patch set 4 V +1 11/06/23, 18:20
Seems to be working... but it's really "ugly" in Symfony's `AsCommand` since these properties are not exposed explicitly... -
Benjamin Franzke voted on patch set 4 V +2 CR +2 11/07/23, 06:13
-
Benjamin Franzke merged patch set 5 11/07/23, 06:13