Page MenuHomeSoftware Heritage

publisher: Simplify publisher initialization and add journal cli
ClosedPublic

Authored by ardumont on Mar 15 2019, 12:10 PM.

Details

Summary

This allows to pass the configuration needed to the publisher.

I extracted that from the current work i'm doing on testing kafka.
That allows to unblock other coming changes needed (impact on
swh-docker-dev, swh-site).

Related T1410

Test Plan

tox

Diff Detail

Repository
rDJNL Journal infrastructure
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.Mar 15 2019, 12:10 PM
ardumont marked an inline comment as done.Mar 15 2019, 12:19 PM
ardumont added inline comments.
swh/journal/tests/test_publisher.py
148

That will be reworked in D1239.

ardumont added a project: Journal.
vlorentz accepted this revision.Mar 15 2019, 12:22 PM

Accepted, but let's not forget to add tests for the CLI

swh/journal/cli.py
77–78

Add an except KeyboardException to exit the loop nicely.

This revision is now accepted and ready to land.Mar 15 2019, 12:22 PM
vlorentz added inline comments.Mar 15 2019, 12:23 PM
swh/journal/cli.py
73–74

raise a ClickException instead.

73–74

And reword to: Configuration error: The following keys must be provided: %s

Thanks for the remarks.

Yes, for the test on cli.
I planned to do that but not right now.
My main focus right now is being able to test the kafka layer for now ;)

ardumont updated this revision to Diff 3946.Mar 15 2019, 1:43 PM

Adapt according to review

This revision was automatically updated to reflect the committed changes.