From a119342786348c10bc44cf23220e2b2429f56543 Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Feb 23 2018 00:19:16 +0000 Subject: Go back to triggering on Pungi status change, not PDC I tweaked wikitcms again to make this possible, using something similar to the old 'pass the cid through' workaround but a bit less icky. This is kinda necessary because PDC just flakes too much; there've been at least two and possibly three stretches where it just gave up importing composes until someone noticed. Signed-off-by: Adam Williamson --- diff --git a/install.requires b/install.requires index 424e135..0768b5f 100644 --- a/install.requires +++ b/install.requires @@ -2,4 +2,4 @@ fedfind fedmsg[consumers] mwclient setuptools -wikitcms +wikitcms>=2.3.0 diff --git a/relvalconsumer.py b/relvalconsumer.py index 402ee92..474b9c8 100644 --- a/relvalconsumer.py +++ b/relvalconsumer.py @@ -56,9 +56,9 @@ class RelvalConsumer(fedmsg.consumers.FedmsgConsumer): test mode. """ # only run on completed composes - action = message['body']['msg'].get('action') + status = message['body']['msg'].get('status') cid = message['body']['msg'].get('compose_id') - if not action == "create" and cid: + if not 'FINISHED' in status and cid: return # some compose info we'll use @@ -324,7 +324,7 @@ class RelvalProductionConsumer(RelvalConsumer): Use carefully! Only one instance of this should be running in the world at any time. """ - topic = "org.fedoraproject.prod.pdc.compose" + topic = "org.fedoraproject.prod.pungi.compose.status.change" config_key = "relvalconsumer.prod.enabled" # this is our own thing, so let's 'namespace' it to avoid any # unfortunate collisions with fedmsg/moksha @@ -337,7 +337,7 @@ class RelvalTestConsumer(RelvalConsumer): than sending it. Still, don't run this willy-nilly, as the more people poking the staging wiki, the more confusing things will be. """ - topic = "org.fedoraproject.dev.pdc.compose" + topic = "org.fedoraproject.dev.pungi.compose.status.change" config_key = "relvalconsumer.test.enabled" validate_signatures = False # this is our own thing, so let's 'namespace' it to avoid any diff --git a/test_relvalconsumer.py b/test_relvalconsumer.py index 65609d2..ab14672 100644 --- a/test_relvalconsumer.py +++ b/test_relvalconsumer.py @@ -38,12 +38,12 @@ def _fakepginit(self, site, name, info=None, extra_properties=None): self.site = site self.name = name -def _fakemsg(cid, action='create'): +def _fakemsg(cid, status='FINISHED_INCOMPLETE'): return { 'body': { 'msg': { 'compose_id': cid, - 'action': action + 'status': status } } }