Skip to content

cgit/tasks: Allow passing extra parameters to task

Antoine R. Dumont requested to merge ardumont/swh-lister:fix-cgit-tasks into master

This unifies with other lister tasks modules. And this allow the cgit task to be scheduled by the add-forge-now scheduler cli.

Currently, without the fix, that fails [1]

[1]

listers [2023-03-21 11:13:53,282: ERROR/ForkPoolWorker-5] Task swh.lister.cgit.tasks.CGitListerTask[fe5b9920-6082-4cdd-8b24-a598a580ff35] raised unexpected: TypeError("list_cgit() got an unexpected keyword argument 'max_pages'")
listers Traceback (most recent call last):
listers   File "/opt/swh/.local/lib/python3.10/site-packages/celery/app/trace.py", line 451, in trace_task
listers     R = retval = fun(*args, **kwargs)
listers   File "/opt/swh/.local/lib/python3.10/site-packages/sentry_sdk/integrations/celery.py", line 207, in _inner
listers     reraise(*exc_info)
listers   File "/opt/swh/.local/lib/python3.10/site-packages/sentry_sdk/_compat.py", line 60, in reraise
listers     raise value
listers   File "/opt/swh/.local/lib/python3.10/site-packages/sentry_sdk/integrations/celery.py", line 202, in _inner
listers     return f(*args, **kwargs)
listers   File "/opt/swh/.local/lib/python3.10/site-packages/swh/scheduler/task.py", line 61, in __call__
listers     result = super().__call__(*args, **kwargs)
listers   File "/opt/swh/.local/lib/python3.10/site-packages/celery/app/trace.py", line 734, in __protected_call__
listers     return self.run(*args, **kwargs)
listers TypeError: list_cgit() got an unexpected keyword argument 'max_pages'

cc @teams/developers @vlorentz

Refs. swh/infra/sysadm-environment#4813 (closed)

Edited by Antoine R. Dumont

Merge request reports