Page MenuHomeSoftware Heritage

Improve the cli a bit and normalize the lister_db_url config
ClosedPublic

Authored by douardda on Wed, Feb 6, 10:35 AM.

Details

Summary
  • Make the --lister option of the cli tool a variadic argument and add a 'all' possibel value for it, so that one can initialize all the database for all listers at once.
  • Add an entry point for the cli command
  • Change the lister_db_url config option into a 'lister' one

    with conventional structure { 'cls': cls, 'args': {}}

Bump dependencies

Diff Detail

Repository
rDLS Listers
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

douardda created this revision.Wed, Feb 6, 10:35 AM
vlorentz accepted this revision.Wed, Feb 6, 11:01 AM
vlorentz added a subscriber: vlorentz.
vlorentz added inline comments.
swh/lister/cli.py
23–24

Nitpick: should be -C for consistency with the next option

27–28

Why -f?

This revision is now accepted and ready to land.Wed, Feb 6, 11:01 AM
douardda marked an inline comment as done.Wed, Feb 6, 11:08 AM
douardda added inline comments.
swh/lister/cli.py
27–28

because -d is already used, and -f for 'fill'. But any better idea is welcome :-)

vlorentz added inline comments.Wed, Feb 6, 11:14 AM
swh/lister/cli.py
27–28

Oh indeed. -i? (and maybe rename the full option to --insert-data?)

douardda marked an inline comment as done.Wed, Feb 6, 3:28 PM
douardda added inline comments.
swh/lister/cli.py
23–24

In fact, let's just kill this option! Why on earth would you use this command without this flag on?

douardda marked an inline comment as done.Wed, Feb 6, 3:32 PM
douardda added inline comments.
swh/lister/cli.py
27–28

-i? (and maybe rename the full option to --insert-data?)

I am also tempted to kill this one too. Is there any reason one would NOT want to bootstrap the data? Or at least make it the default behavior...

douardda updated this revision to Diff 3412.Wed, Feb 6, 3:38 PM

Kill (useless) --create-tables and --with-data cli command options

ardumont added inline comments.
swh/lister/cli.py
23–24

That was backward compatible with the existing code, that's it, i think.
I'm fine with removing this.

27–28

as far as i remember only the debian lister needed some setup data to actually work.

Then, we could rework the other listers with a default function doing nothing.
And always calls that function.
Only the debian lister one would do something.

douardda retitled this revision from Improve the cli a bit and make normalize the lister_db_url config to Improve the cli a bit and normalize the lister_db_url config.Wed, Feb 6, 4:10 PM
This revision was automatically updated to reflect the committed changes.