publisher: Simplify publisher initialization and add journal cli
Closed
requested to merge generated-differential-D1249-source into generated-differential-D1249-target
3 unresolved threads
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 swh-core#1410
Test Plan
tox
Migrated from D1249 (view on Phabricator)
Merge request reports
Activity
Filter activity
Build is green See https://jenkins.softwareheritage.org/job/DJNL/job/tox/36/ for more details.
139 145 140 146 class TestPublisher(unittest.TestCase): 141 147 def setUp(self): 142 self.publisher = JournalPublisherTest() 148 self.publisher = JournalPublisherNoKafkaInMemoryStorage(TEST_CONFIG) That will be reworked in !242 (closed).
- swh/journal/cli.py 0 → 100644
62 'publisher_id', 'object_types', 'storage' 63 ] 64 65 conf = ctx.obj['config'] 66 missing_keys = [] 67 for key in mandatory_keys: 68 if not conf.get(key): 69 missing_keys.append(key) 70 71 if missing_keys: 72 raise click.ClickException( 73 'Configuration error: The following keys must be' 74 ' provided: %s' % (','.join(missing_keys), )) 75 76 publisher = JournalPublisher(conf) 77 try: mentioned in merge request swh-docker-dev!129 (closed)
mentioned in merge request !242 (closed)
- swh/journal/cli.py 0 → 100644
58 59 """ 60 mandatory_keys = [ 61 'brokers', 'temporary_prefix', 'final_prefix', 'consumer_id', 62 'publisher_id', 'object_types', 'storage' 63 ] 64 65 conf = ctx.obj['config'] 66 missing_keys = [] 67 for key in mandatory_keys: 68 if not conf.get(key): 69 missing_keys.append(key) 70 71 if missing_keys: 72 raise click.ClickException( 73 'Configuration error: The following keys must be' mentioned in commit swh/infra/puppet/puppet-swh-site@01897647
Some references in the commit message have been migrated:
- T1410 is now swh-core#1410
Build is green See https://jenkins.softwareheritage.org/job/DJNL/job/tox/37/ for more details.
Please register or sign in to reply