Merge "Don't store change_queue in QueueItem"
diff --git a/zuul/model.py b/zuul/model.py
index a2573f7..b66480a 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -412,12 +412,13 @@
self._jobs |= set(self.pipeline.getJobTree(project).getJobs())
def enqueueChange(self, change):
- item = QueueItem(self, self.pipeline, change)
+ item = QueueItem(self.pipeline, change)
self.enqueueItem(item)
item.enqueue_time = time.time()
return item
def enqueueItem(self, item):
+ item.pipeline = self.pipeline
if self.dependent and self.queue:
item.item_ahead = self.queue[-1]
item.item_ahead.items_behind.append(item)
@@ -659,8 +660,7 @@
class QueueItem(object):
"""A changish inside of a Pipeline queue"""
- def __init__(self, change_queue, pipeline, change):
- self.change_queue = change_queue
+ def __init__(self, pipeline, change):
self.pipeline = pipeline
self.change = change # a changeish
self.build_sets = []
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index a2d1d34..fabaa88 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -1257,19 +1257,18 @@
item.change.branch)
self.log.info("Reported change %s status: all-succeeded: %s, "
"merged: %s" % (item.change, succeeded, merged))
+ change_queue = self.pipeline.getQueue(item.change.project)
if not (succeeded and merged):
self.log.debug("Reported change %s failed tests or failed "
"to merge" % (item.change))
- item.change_queue.decreaseWindowSize()
+ change_queue.decreaseWindowSize()
self.log.debug("%s window size decreased to %s" %
- (item.change_queue,
- item.change_queue.window))
+ (change_queue, change_queue.window))
raise MergeFailure("Change %s failed to merge" % item.change)
else:
- item.change_queue.increaseWindowSize()
+ change_queue.increaseWindowSize()
self.log.debug("%s window size increased to %s" %
- (item.change_queue,
- item.change_queue.window))
+ (change_queue, change_queue.window))
def _reportItem(self, item):
if item.reported: