Browse Source

Merge "Don't store change_queue in QueueItem"

changes/73/66173/2
Jenkins 8 years ago committed by Gerrit Code Review
parent
commit
8667d80e46
  1. 6
      zuul/model.py
  2. 11
      zuul/scheduler.py

6
zuul/model.py

@ -412,12 +412,13 @@ class ChangeQueue(object):
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 BuildSet(object):
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 = []

11
zuul/scheduler.py

@ -1257,19 +1257,18 @@ class BasePipelineManager(object):
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:

Loading…
Cancel
Save