Skip to content

Setup: keep the default plugin agent beside contributed agents - #12239

Open
mjansenDatabay wants to merge 1 commit into
ILIAS-eLearning:release_10from
mjansenDatabay:bugfix/10/keep-default-plugin-agent
Open

mjansenDatabay wants to merge 1 commit into
ILIAS-eLearning:release_10from
mjansenDatabay:bugfix/10/keep-default-plugin-agent

Conversation

@mjansenDatabay

Copy link
Copy Markdown
Contributor

A plugin setup agent replaced installation, update and activation. Contributed agents are now collected in addition to the default agent.

@mjansenDatabay mjansenDatabay added improvement php Pull requests that update Php code labels Oct 20, 2026

@chfsx chfsx left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up, a contributed agent that implements ILIAS\Setup\Agent directly silently losing installation, update and activation is a real trap.

I'd like to suggest narrowing the change, though, because in its current form it changes the CLI surface of every plugin that already ships an agent, and this targets release_10.

Many existing plugin agents already extend ilPluginDefaultAgent and call parent::getInstallObjective() / parent::getUpdateObjective(), e.g. Hub2, OpenCast, PhotoGallery and SrExternalPageContent. Admittedly, these are all ours, so the sample is a bit biased ;-) But I'd be surprised if we were the only ones who worked around it this way, so there are probably more out there. For those, the extra default agent does not change what is executed, since ilComponentInstallPluginObjective, ilComponentUpdatePluginObjective, ilComponentActivatePluginsObjective and ilPluginLanguageUpdatedObjective hash on class and plugin name and are deduplicated by the ObjectiveIterator. But because a single contributed agent is no longer returned directly and is always wrapped in an AgentCollection, every path below the plugin gets one more level:

  • named objectives: OpenCast.OpencastRBACRights becomes OpenCast.ilOpenCastAgent.OpencastRBACRights
  • migrations: PhotoGallery.ilObjPhotoGalleryMigration becomes PhotoGallery.ilObjPhotoGallerySetupAgent.ilObjPhotoGalleryMigration
  • status metrics are stored under a different path
  • agents with hasConfig() now expect their config under <plugin>.<agent class> instead of <plugin>

Calls of achieve and migrate --run in existing documentation, runbooks and deployment scripts would break with a patch release. In addition, the agent class name is used as collection key, so a namespaced agent would end up as something like Plugin.Vendor\Plugin\Setup\Agent.objective on the command line.

Proposal:

  1. Only add the default agent if none of the contributed agents is an ilPluginDefaultAgent. An agent extending it already provides installation, update and activation.
  2. If only one agent remains, return it directly as before, so existing paths stay stable.
  3. Use the short class name as collection key.
  4. Adjust the docblock and the README accordingly: the default agent is added unless the plugin's agent already extends ilPluginDefaultAgent.

This still fixes the case of an agent implementing Agent directly (it then gets the default agent beside it), without affecting plugins that already handle it themselves.

Comment thread components/ILIAS/Setup/src/ImplementationOfAgentFinder.php Outdated
@mjansenDatabay
mjansenDatabay force-pushed the bugfix/10/keep-default-plugin-agent branch 2 times, most recently from 69cfa43 to 3ad978d Compare October 22, 2026 17:52
A plugin setup agent replaced installation, update and activation. The default agent is added unless a contributed agent already extends it.

Co-authored-by: chfsx <fs@studer-raimann.ch>
@mjansenDatabay
mjansenDatabay force-pushed the bugfix/10/keep-default-plugin-agent branch from 3ad978d to 1388d14 Compare October 22, 2026 17:59
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