Review main Merged

89289[TASK] Unify tasks + CLI commands in scheduler

Benni Mack CR +2 V +2 Hard +209 −366 updated 05/05/25, 05:43

Commit message

Historically CLI commands (or "CommandControllers" back then) were
introduced much later than the scheduler extension in TYPO3 v4.2,
- including "task" objects, which can be scheduled / timed via
database entries.

However, when making CLI commands "schedulable", this
was almost always a huge jump through the hoops, as there
is a distinction on how to register a task vs. a CLI command,
and what options are available etc..

Although the registration could be one of the next steps,
this change now merges a task object and a schedulable
CLI command within the scheduler module as a visible change.

What does this mean?

1. The "task type" is an identifier, which should only exist
   once and we're done with it. It does not matter anymore
   if this is a registered CLI command or class extending
   the abstract class. This is handled throughout all of the
   module.

2. The differentiation is now only visible in the TaskService
   and some minor details regarding the additionalFieldProvider
   logic.

3. The Backend module now handles a CLI Command exactly 1:1 as a
   Scheduler Task, making it a first-class citizen inside Scheduler.

This can be seen when listing all available tasks, or when adding
a new task within the select dropdown, saving admins one click when
adding a new schedulable CLI command via the GUI.

Now, the GUI does NOT make any differentiation between available
tasks and schedulable CLI commands anymore.

This is only a minor detail, but finally allows to continue
with various more enhancements:

a) introducing TCA for tx_scheduler_task
b) reworking the additional field provider concept by using
   TCA syntax and allowing FormEngine to do its work
c) Introducing "Ad-hoc" scheduler tasks allowing a task object
   to be run the same way as a CLI command (= without a DB entry)

Eventually, TYPO3 can and will distinguish between:

- A CLI Command, based on Symfony Console, which acts as PHP
  code which is executed via CLI with additional and/or options
  and is executed manually via CLI on the server.
- A Scheduler Task, which serves to be configured via the Backend UI
  and is like a "preconfigured" CLI command, which can be run once
  or multiple times at a dedicated point of time (or cron).
  And this pre-configuration (options + schedulable information)
  is what should be stored within the database records.

Used command(s):

> Build/Scripts/runTests.sh -s phpstanGenerateBaseline

Review

  • Code review CR +2 Done
    • Georg Ringer +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
  • Verified V +2 Done
    • Georg Ringer +2
    • Anja Leichsenring +1
    • Stefan Bürk +1
    • core-ci +1 CI

Issues 1

Files 20

Review log 1524

  1. Benni Mack uploaded patch set 1 05/02/25, 22:34

  2. core-ci voted on patch set 1 V -1 05/02/25, 22:43 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78448

  3. Benni Mack uploaded patch set 2 V -1 05/03/25, 06:35

  4. core-ci voted on patch set 2 V -1 05/03/25, 06:42 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78465

  5. Benni Mack uploaded patch set 3 V -1 05/03/25, 15:01

  6. core-ci voted on patch set 3 V -1 05/03/25, 15:08 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78468

  7. Benni Mack uploaded patch set 4 V -1 05/03/25, 15:55

  8. core-ci voted on patch set 4 V -1 05/03/25, 16:02 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78469

  9. Benni Mack uploaded patch set 5 V -1 05/03/25, 16:27

  10. core-ci voted on patch set 5 V +1 05/03/25, 16:33 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78470

  11. Benni Mack updated the commit message in patch set 6 V +1 05/03/25, 16:46

  12. core-ci voted on patch set 6 V +1 05/03/25, 16:52 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78471

  13. Benni Mack uploaded patch set 7 V +1 05/03/25, 21:12

  14. core-ci voted on patch set 7 V +1 05/03/25, 21:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78472

  15. Stefan Bürk uploaded patch set 8 V +1 05/03/25, 21:43

  16. core-ci voted on patch set 8 V -1 05/03/25, 21:49 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78473

  17. Stefan Bürk voted on patch set 8 CR +1 V +1 05/03/25, 21:49

  18. Stefan Bürk voted on patch set 8 CR 0 V 0 05/03/25, 21:49

  19. Stefan Bürk uploaded patch set 9 V -1 05/03/25, 21:51

  20. core-ci voted on patch set 9 V +1 05/03/25, 21:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/78474

  21. Stefan Bürk commented on patch set 9 CR +1 V +1 05/03/25, 21:57

    Nice one. Thanks for the work in the scheduler @benni@typo3.org
  22. Anja Leichsenring voted on patch set 9 CR +1 V +1 05/05/25, 05:36

  23. Georg Ringer voted on patch set 9 CR +2 V +2 05/05/25, 05:43

  24. Georg Ringer merged patch set 10 05/05/25, 05:43