swh-lister/swh/lister/npm
David Douard 8d9deeb8f8 plugins: add support for scheduler's task-type declaration
Add a new register-task-types cli that will create missing task-type entries in the
scheduler according to:

- only create missing task-types (do not update them), but check that the
  backend_name field is consistent,
- each SWHTask-based task declared in a module listed in the 'task_modules'
  plugin registry field will be checked and added if needed; tasks which name
  start wit an underscore will not be added,
- added task-type will have:
  - the 'type' field is derived from the task's function name (with underscores
    replaced with dashes),
  - the description field is the first line of that function's docstring,
  - default values as provided by the swh.lister.cli.DEFAULT_TASK_TYPE (with
    a simple pattern matching to have decent default values for full/incremental
    tasks),
  - these default values can be overloaded via the 'task_type' plugin registry
    entry.

For this, we had to rename all tasks names (eg. `cran_lister` -> `list_cran`).

Comes with some tests.
2019-09-04 15:36:08 +02:00
..
tests lister: Type correctly the 'indexable' column 2019-06-26 10:58:54 +02:00
__init__.py plugins: add support for scheduler's task-type declaration 2019-09-04 15:36:08 +02:00
lister.py Drop SWH prefix in classes everywhere 2019-06-20 19:08:46 +02:00
models.py npm: make NpmVisitModel use the main declarative base class from core.models 2019-09-03 15:02:24 +02:00
tasks.py plugins: add support for scheduler's task-type declaration 2019-09-04 15:36:08 +02:00