Add "supercedes" pipeline option
This lets us abort check jobs when a change goes straight to gate. Change-Id: I0e07a4be74ea708d0a0e186f523dd41174215b92
This commit is contained in:
@@ -334,6 +334,7 @@ class PipelineManager(object):
|
||||
tenant = self.pipeline.tenant
|
||||
zuul_driver.onChangeEnqueued(
|
||||
tenant, item.change, self.pipeline, event)
|
||||
self.dequeueSupercededItems(item)
|
||||
return True
|
||||
|
||||
def dequeueItem(self, item):
|
||||
@@ -351,6 +352,23 @@ class PipelineManager(object):
|
||||
self.dequeueItem(item)
|
||||
self.reportStats(item)
|
||||
|
||||
def dequeueSupercededItems(self, item):
|
||||
for other_name in self.pipeline.supercedes:
|
||||
other_pipeline = self.pipeline.tenant.layout.pipelines.get(
|
||||
other_name)
|
||||
if not other_pipeline:
|
||||
continue
|
||||
|
||||
found = None
|
||||
for other_item in other_pipeline.getAllItems():
|
||||
if other_item.live and other_item.change.equals(item.change):
|
||||
found = other_item
|
||||
break
|
||||
if found:
|
||||
self.log.info("Item %s is superceded by %s, removing" %
|
||||
(found, item))
|
||||
other_pipeline.manager.removeItem(found)
|
||||
|
||||
def updateCommitDependencies(self, change, change_queue, event):
|
||||
log = get_annotated_logger(self.log, event)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user