Skip to content

[NEW] Tiki Manager inside Tiki and related enhancements

Victor Emanouilov requested to merge kroky/tiki:feature/tiki-manager into master

This MR aims at integrating Tiki Manager within Tiki as an optional package and feature. Once enabled, it exposes manager CLI commands to the console Tiki app, it adds a section in Admin for GUI operations with Tiki Manager. For now, you can list instances, auto-create local instance (the one you run manager on), fix permissions, get info and update an instance. This should serve as an example of how Tiki Manager functionality can be executed inside Tiki. Check Manager/Controller.php for examples.

Additionally, this MR adds a basic background jobs execution engine - it builds on top of Schedulers, divides one-time items from repeated items and calls one-time items bg jobs. They can be scheduled to execute immediately (via Scheduler_Manager::queueJob method) and will execute upon next scheduler cron run. We can enhance them with queues, priorities and distinct workers rather than relying on the cron engine but this should be a good start.

Tiki manager commands can currently be executed in 3 distinct ways:

  1. via Tiki manager console application (see info command).
  2. via direct interface of classes inside Tiki manager (see update command in foreground).
  3. via background console command execution of relevant manager:instance:xyz command (see update in background command).

Commands that take a lot of time like backups, instance updates, upgrades, clone, etc. should be run in the background. There is sufficient interface to review the results of these commands from Scheduler logs.

Commands that are almost instant can run in the foreground. The goal here is to port the whole existing manager gui (https://gitlab.com/tikiwiki/tiki-manager/-/tree/master/www/include) into Tiki using one of the 3 command execution actions above and proper UI inside Tiki. We can then add whatever is missing. Note that the preferred way to do this is via cli command execution of the relevant manager command but this is not always possible as some cli commands expect interactive input from console (e.g. import). Such commands must interactively take the input from user's browser and then execute relevant calls to Tiki manager object methods. See existing manager GUI for more info how it is done.

Additionally, a wiki plugin called tikimanager has been added that exposes the manager services controller actions and allows configuration - it essentially runs tiki manager gui in a wiki page. Note that it loads interface, navigation and initial instances list directly but then each action is an ajax hook to the corresponding service, so we don't duplicate frontend and backend logic too much. I expect most of the actions here in the wiki plugin and also in the standalone tiki manager page in Tiki will use helper bootstrap modals to collect information and report results. It is preferred to keep the TikiManager integration code all in one place - in the services - so API support is easy to add and also it is easy to update the integration code once Tiki Manager itself evolves.

Finally, a tracker field TikiManager is added that will eventually replace Show.tiki.org tracker field. It supports managing one or more Tikies much likes the wiki plugin but also can create one private Tiki and execute actions on it - e.g. when people use this to reproduce a bug. The plan here is to add more actions like applying a patch or a set of patches to the instance, so bug fixing can be a collaborative work.

Edited by Victor Emanouilov

Merge request reports