INGInious
INGInious copied to clipboard
[frontend/plugin_manager] Problem type auto-discovery for plugins and base code
The current way of loading INGInious plugins requires a call to the load
method of the PluginManager
https://github.com/UCL-INGI/INGInious/blob/fac7761f9f1a9992bb83f4ad81ec085a7e3b289f/inginious/frontend/plugin_manager.py#L65
e.g. https://github.com/UCL-INGI/INGInious/blob/f28ad8daa77f0a724e85180eb4c8dcd61e792e7b/inginious/frontend/app.py#L315
This method then calls the init
function of the plugin which, in turn, may add pages and hooks to the webapp, e.g. https://github.com/cnp3/INGInious-problems-network-trace/blob/d1c3f0229e06e777def1b87ab1671f71d23615a1/inginious-problems-network-trace/init.py#L260. It thus involves the usage of a deployed webapp.
In some use-cases, e.g. https://github.com/UCL-INGI/INGInious/pull/861, one may need to only load the new type(s) of problem(s) proposed by a given plugin in a headless configuration. Plugins should thus expose a method to that end.
In the same idea, INGInious does not propose auto-discovery functions for problem types, hence manual loading is still required, e.g. https://github.com/UCL-INGI/INGInious/blob/f28ad8daa77f0a724e85180eb4c8dcd61e792e7b/inginious/frontend/app.py#L217. A function solving this issue should also be available.
@anthonygego any inputs on this?