Add a Zuul trigger
This adds the ability for a pipelite to have multiple triggers.
This also adds a "Zuul" trigger which is used to generate trigger
events based on internal actions Zuul has taken.
It supports two event types:
* parent-change-enqueued: This can be used so that other pipelines
can enqueue children of parents that are enqueued in a different
pipeline. Specifically, this lets OpenStack enqueue changes in
check when their parents are enqueued in gate (which may be
necessary because of our clean check rules).
This could be used to replace the internal logic that enqueues
children in dependent pipelines (moving that into explicit
configuration instead).
One can also imagine a future 'change-enqueued' event so that a
pipeline could react directly to a change in another.
* project-change-merged: This can be used to trigger changes on all
open changes for a project when a change is merged to that project.
Specifically, this lets us perform light-weight merge checks on all
open changes whenever a change is merged.
Change-Id: I2a67699dbed92a6b9c143a77795cb126f1f4dd57
diff --git a/tests/base.py b/tests/base.py
index a86de82..1b82944 100755
--- a/tests/base.py
+++ b/tests/base.py
@@ -52,6 +52,7 @@
import zuul.reporter.smtp
import zuul.trigger.gerrit
import zuul.trigger.timer
+import zuul.trigger.zuultrigger
FIXTURE_DIR = os.path.join(os.path.dirname(__file__),
'fixtures')
@@ -401,6 +402,11 @@
return change.query()
return {}
+ def simpleQuery(self, query):
+ # This is currently only used to return all open changes for a
+ # project
+ return [change.query() for change in self.changes.values()]
+
def startWatching(self, *args, **kw):
pass
@@ -906,6 +912,8 @@
self.sched.registerTrigger(self.gerrit)
self.timer = zuul.trigger.timer.Timer(self.config, self.sched)
self.sched.registerTrigger(self.timer)
+ self.zuultrigger = zuul.trigger.zuultrigger.ZuulTrigger(self.config, self.sched)
+ self.sched.registerTrigger(self.zuultrigger)
self.sched.registerReporter(
zuul.reporter.gerrit.Reporter(self.gerrit))