Page MenuHomeSoftware Heritage

hg/git: Align lister's output (load-hg/git tasks) with loader's new format
ClosedPublic

Authored by ardumont on Dec 6 2019, 5:36 PM.

Details

Diff Detail

Repository
rDLS Listers
Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 9602
Build 14138: tox-on-jenkinsJenkins
Build 14137: arc lint + arc unit

Event Timeline

anlambert added inline comments.
swh/lister/bitbucket/lister.py
35–52

I think you should rather call the utils.create_task_dict function with keyword arguments directly in the task_dict method from the ListerBase class instead of overriding it here.

36

s/Mapping/Dict/

Adapt according to review

swh/lister/bitbucket/lister.py
35–52

Yes. Adapting right now.

Relatedly, i also think i need to align the loader-git accordingly... D2409

ardumont retitled this revision from bitbucket: Align lister's loader output tasks with expected format to hg: Align lister's output (load-hg tasks) with loader's expected format.Dec 9 2019, 10:17 AM
swh/lister/core/lister_base.py
394–398

I would rather use the same task arguments format (keyword) for all loaders here.

swh/lister/core/lister_base.py
394–398

Yes, same.

i'll land D2409 and D2410 first ;)

ardumont retitled this revision from hg: Align lister's output (load-hg tasks) with loader's expected format to hg/git: Align lister's output (load-hg/git tasks) with loader's new format.Dec 9 2019, 2:17 PM

hg/git: Align lister's output (load-hg/git tasks) with loader's new format

swh/lister/core/lister_base.py
394–398

I could not really do it before (well morally).

Looks good !

swh/lister/core/lister_base.py
379

s/Mapping/Dict/

This revision is now accepted and ready to land.Dec 9 2019, 2:51 PM
swh/lister/core/lister_base.py
379

Something hit me, thus i keep doing that.

I thought it was better to be generic in the output (so Mapping here)
And specific in the input (so Dict as parameter).

That's the one thing i remember clearly from zack's slide (and what he told me ;).
Am i misremembering?

swh/lister/core/lister_base.py
379

Yes, the recommended way is the opposite: use a concrete type in the output and a generic type in the input.

See https://mypy.readthedocs.io/en/latest/cheat_sheet_py3.html#standard-duck-types

swh/lister/core/lister_base.py
379

Thanks!

Will try to fix my erroneous ways ;)

swh/lister/core/lister_base.py
379

I checked zack's slide.
I inverted what's said there, great!

Be conservative in what you send, be liberal in what you accept.