Skip to content

BackgroundTasks: Drop legacy BackgroundTasks_ - move setup soap - #12293

Closed
thojou wants to merge 2 commits into
ILIAS-eLearning:trunkfrom
thojou:bt-move-setup-soap
Closed

thojou wants to merge 2 commits into
ILIAS-eLearning:trunkfrom
thojou:bt-move-setup-soap

Conversation

@thojou

@thojou thojou commented Oct 27, 2026

Copy link
Copy Markdown
Contributor

Hey all,

The technical board asked me if we could remove BackgroundTasks_ and migrate the remaining code to their respective new components. This is Part 1 of 4.

Why

The BackgroundTasks setup agent and its SOAP worker entry are global il* classes, split across the legacy BackgroundTasks_ directory and BackgroundTasks/classes. This MR moves them into the BackgroundTasks component under its PSR-4 src/ layout, so the component owns its setup and its SOAP entry.

What changed

  • The setup agent, its config, and its three objectives are now Agent, SetupConfig, ConfigStoredObjective, MetricsCollectedObjective, and BackgoundWorkerObjective in ILIAS\BackgroundTasks\Setup.
  • ilSoapBackgroundTasksAdministration is now ILIAS\BackgroundTasks\SOAP\Administration. BackgroundTasks.php and inc.soap_functions.php construct the new classes.
  • The old files are deleted, with no class alias. The empty class.ilBackgroundTasksDB80.php and redundant docblocks in the moved files are deleted too.

Scope

  • Covers the setup classes and the SOAP administration class only.
  • ilBackgroundTasksDBHotfixes10 keeps its global name. The database step log stores executed steps by class name, so a rename runs its steps again on every installation.
  • Jobs, user interactions, GUI classes, and the rest of BackgroundTasks_ stay for other MRs.

Blast Radius

Setup runs and the startBackgroundTaskWorker SOAP call load the new classes. Behavior stays the same, and each file keeps its strict_types setting. The one visible difference is the metrics objective label in setup status, which now shows the new class name. An installation finds the moved classes after composer install or composer dump-autoload.

Verification

  • php8.3 -l on the 8 changed PHP files shows no errors. rg finds none of the 6 old class names outside vendor/. php-cs-fixer with scripts/PHP-CS-Fixer/code-format.php_cs reports no changes.
  • No PHPUnit test covers BackgroundTasks setup or the SOAP class. An equivalence script runs the base classes and the moved classes side by side on PHP 8.4, because the vendor tree requires 8.4. It compares config parsing, objective trees, the ini file written, metrics, worker applicability, and the SOAP signature. The outputs are equal except for the metrics label. It also checks that BackgroundTasks::init contributes the new agent and that startBackgroundTaskWorker constructs the new SOAP class. That check fails when the old class name is put back.

Move the setup agent, its config and objectives, and the SOAP
administration class into components/ILIAS/BackgroundTasks/src under the
ILIAS\BackgroundTasks namespace. Delete the old files from
BackgroundTasks_ and the empty class.ilBackgroundTasksDB80.php.

ilBackgroundTasksDBHotfixes10 keeps its global class name, because the
database step log stores executed steps by that class name.
Delete @inheritdoc blocks and @return or @throws tags that restate the
interface or the method body. Delete the @var tag for $io in
ConfigStoredObjective, which named a class that does not exist. Drop the
two imports that only these docblocks used.
@thojou thojou added improvement php Pull requests that update Php code labels Oct 27, 2026
@thojou
thojou requested a review from mjansenDatabay October 27, 2026 12:27
@thojou

thojou commented Oct 27, 2026

Copy link
Copy Markdown
Contributor Author

Hey all,

i consolidated the changes into one PR. Stacked PR's did not work as expected.
Please continue in #12294

Kind regards,
@thojou

@thojou thojou closed this Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants