Page MenuHomeSoftware Heritage

swh.lister.cli: Add a basic cli to deal with create/drop db actions
ClosedPublic

Authored by ardumont on Jul 6 2018, 4:16 PM.

Details

Reviewers
olasd
Group Reviewers
Reviewers

Diff Detail

Repository
rDLS Listers
Branch
lister-gitlab
Lint
No Linters Available
Unit
No Unit Test Coverage
Build Status
Buildable 1308
Build 1652: arc lint + arc unit

Event Timeline

olasd requested changes to this revision.Jul 6 2018, 5:06 PM
olasd added a subscriber: olasd.

I think it'd be cleaner to have a "--lister" option that would let you set which lister you want to act on (and which would instantiate the proper lister once), then a createdb and a dropdb "action" that would do what's expected:

python3 -m swh.lister --lister gitlab --db-url postgresql:///lister-gitlab createdb
python3 -m swh.lister --lister github --db-url postgresql:///lister-github dropdb
...

On a related note, the actions should probably be called create-tables and drop-tables, as they really don't create databases, just populate them.

This revision now requires changes to proceed.Jul 6 2018, 5:06 PM

sounds better, thx.

  • swh.lister.cli: Simplify cli
olasd added inline comments.
swh/lister/cli.py
20

That help text is still wrong ;)

This revision is now accepted and ready to land.Jul 11 2018, 1:30 PM
ardumont added inline comments.
swh/lister/cli.py
20

oops!
Thanks ;)

ardumont marked an inline comment as done.