Page MenuHomeSoftware Heritage

git: Unify loaders constructor + register worker (tasks, cli)
ClosedPublic

Authored by ardumont on Dec 5 2019, 3:44 PM.

Details

Summary

With this commit, we stop passing parameters to the load method. We pass those
parameters to the loader's constructor.

  • tasks: Rename task according to production
  • loader.git: Register git worker

Related to T2134

Test Plan

tox

Diff Detail

Repository
rDLDG Git loader
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

ardumont created this revision.Dec 5 2019, 3:44 PM
anlambert accepted this revision.Dec 6 2019, 1:24 PM
anlambert added a subscriber: anlambert.

Looks good !

swh/loader/git/__init__.py
9 ↗(On Diff #8455)

s/Mapping/Dict/

This revision is now accepted and ready to land.Dec 6 2019, 1:24 PM
anlambert added inline comments.Dec 6 2019, 1:37 PM
swh/loader/git/tests/test_tasks.py
6

You should use the mocker fixture from pytest-mock instead

ardumont updated this revision to Diff 8495.Dec 6 2019, 3:05 PM
  • tests: Migrate to pytest-mock's fixture
  • tasks: Use celery's shared_task decorator
ardumont updated this revision to Diff 8496.Dec 6 2019, 3:06 PM

Adapt according to review (missed)