90852[FEATURE] "Ad-hoc" tasks for CLI scheduler
Commit message
Review
-
Code review CR 0
-
Verified V 0
- core-ci +1 CI
Issues 2
Files 11
- typo3/sysext/core/Documentation/Changelog/14.0/Feature-107575-AdHocTasksForSchedulerCLI.rst4new+76 −0
- typo3/sysext/scheduler/Classes/Command/SchedulerAdHocExecuteCommand.php4new+115 −0
- typo3/sysext/scheduler/Classes/Command/SchedulerAdHocListCommand.phpnew+134 −0
- typo3/sysext/scheduler/Classes/Service/TaskService.php3+7 −1
- typo3/sysext/scheduler/Classes/Task/TaskSerializer.php+47 −0
- typo3/sysext/scheduler/Configuration/Services.yaml1+14 −0
- typo3/sysext/scheduler/Resources/Private/Language/locallang.xlf+3 −0
- typo3/sysext/scheduler/Tests/Functional/Command/SchedulerAdHocExecuteCommandTest.phpnew+142 −0
- typo3/sysext/scheduler/Tests/Functional/Command/SchedulerAdHocListCommandTest.phpnew+43 −0
- typo3/sysext/scheduler/Tests/Functional/Fixtures/SchedulerAdHocCleanerApplied.csvnew+3 −0
- typo3/sysext/scheduler/Tests/Functional/Fixtures/SchedulerAdHocCleanerBase.csvnew+4 −0
Review log 1724
-
Garvin Hicking uploaded patch set 1 10/01/25, 08:05
-
core-ci voted on patch set 1 V -1 10/01/25, 08:17 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85784
-
Garvin Hicking uploaded patch set 2
V -110/01/25, 08:21 -
core-ci voted on patch set 2 V +1 10/01/25, 08:28 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85787
-
Garvin Hicking uploaded patch set 3
V +110/04/25, 08:22Adjust variable names -
core-ci voted on patch set 3 V +1 10/04/25, 08:31 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/85988
-
Benni Mack commented on patch set 3 10/04/25, 14:32
hey, how about creating a new command "scheduler:adhoc:run" this way, we don't need to do --adhoc over and over again? -
Oli Bartsch commented on patch set 3 10/04/25, 14:39
Reply
++ -
Garvin Hicking commented on patch set 3 10/04/25, 14:51
Reply
Yeah. Tomatoes on the eyes. Will do. -
Garvin Hicking uploaded patch set 4
V +110/04/25, 19:50Move to own scope tests list command -
Garvin Hicking commented on patch set 4 10/04/25, 19:54
Reply
DoneTaskService.php:75Reviewer's note: I wanted to be able to type-hint the CLI output at least somehow, and did not want to jump through all the TCA hoops inside the CLI command to evaluate which TCA type a field has.Services.yaml:31Reviewer's note: These are not using the #[AsCommand] attributes intentionally. These would always be schedulable, which we don't want, because of recursion because of recursion. -
core-ci voted on patch set 4 V -1 10/04/25, 19:57 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86017
-
Garvin Hicking commented on patch set 5
V -110/04/25, 20:24Published edit on patch set 4. -
core-ci voted on patch set 5 V -1 10/04/25, 20:30 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86019
-
core-ci voted on patch set 5 V +1 10/04/25, 20:48 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86019
-
Garvin Hicking updated the commit message in patch set 6
V +110/04/25, 21:01 -
core-ci voted on patch set 6 V +1 10/04/25, 21:09 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/86020
-
Chris Müller commented on patch set 6 10/05/25, 04:19
SchedulerAdHocExecuteCommand.php:49Wouldn't it be better to register an argument instead of an option for the task? The task is mandatory anyway, and this way one can omit the "--task" part then: typo3 scheduler:adhoc:execute \ 'TYPO3\CMS\Scheduler\Task\OptimizeDatabaseTableTask' \ --config='{"selected_tables": "be_dashboards,be_groups"}' -
Garvin Hicking commented on patch set 6 10/05/25, 06:53
SchedulerAdHocExecuteCommand.php:49ReplyI did think about this but I thought maybe we would later add interaction to the command and then it would not be a mandatory argument anymore and we would need to change docs. With the option we can make it not required any time. Does that sound reasonable? Open to discussion. -
Oli Bartsch commented on patch set 6 10/05/25, 08:13
SchedulerAdHocExecuteCommand.php:49ReplyI would also see this as an required argument for this command.TaskService.php:75What is this used for? -
Benni Mack commented on patch set 6 10/05/25, 08:43
Feature-107575-AdHocTasksForSchedulerCLI.rst:20we should debate if this CLI command should actually create a new tx_scheduler_task record which is set to "single run" and executed directly. Why? Because then we'd have logging etc. what is executed and when with what options.Feature-107575-AdHocTasksForSchedulerCLI.rst:27Let's discuss this (recommendation for today). I see a downside for this recommendation nowadays - you can have extended validation and better UX for configuring a native scheduler task than a CLI command. "also allowed CLI execution" scheduler tasks always allowed CLI executions. -
Garvin Hicking commented on patch set 6 10/05/25, 13:00
Feature-107575-AdHocTasksForSchedulerCLI.rst:20Reply UnresolvedHm. I could imagine we could log it, but creating a DB entry and removing that again would feel like spamming the DB and would be unexpected to me. It also makes the "ad-hocness" be a moot point. So, to me, I'd prefer not to, and just to loggerInterface stuff.Feature-107575-AdHocTasksForSchedulerCLI.rst:27Reply UnresolvedYeah but you had to create a task and run it on CLI and that was awkward, so the symfony command was much more convenient. Also IMO the Symfony command validations are more common and standard than the task TCA/Formengine validation. We could of course also just remove the "this is still recommended" and see what the actual best practice will evolve to?! I have no strong oppinion here.SchedulerAdHocExecuteCommand.php:49Reply UnresolvedThe regular "scheduler:execute" also has the task as an option and not an argument. Multiple options can also be chained here. The more I think about it we shouldn't block ourselves with an argument here instead of an option we can handle/adjust better in the future.TaskService.php:75Reply UnresolvedPlease see resolved command comment. It's there to reveal the TCA type of a field on the CLI "list" command. -
Garvin Hicking commented on patch set 6 10/17/25, 11:50
Unresolved
I've received feedback that the ideal way to proceed with this is: * Migrate the logic of all TYPO3 Core Tasks into Service classes * Add a Symfony CLI Command to execute the logic from the service class, using Symfony CLI options * Adjust the Native Task to run logic from the Service class, using TCA options This would be the clean approach, but maybe not the pragmatic one. Due to this I've extracted this as a third-party extension: https://github.com/garvinhicking/typo3-adhoc-tasks/ I am abandoning this patch because I feel this will not gain traction here, and I understand and support the reasoning. However, this also means: More work. :-D -
Garvin Hicking abandoned the change 10/17/25, 11:50
Abandoning, see comment.