summaryrefslogtreecommitdiff
path: root/zuul/manager
diff options
context:
space:
mode:
authorJames E. Blair <jeblair@redhat.com>2019-04-05 13:47:15 -0700
committerJames E. Blair <jeblair@redhat.com>2019-04-05 13:59:05 -0700
commitbab008ee929473ff80962e7d2067f54faff9c923 (patch)
tree46a522d972feaa5ae9ffa8b1774647fb8c15e717 /zuul/manager
parent9f7c642ae1dc5ac7de1cb0ff5c7e32d6426bd1b3 (diff)
downloadzuul-bab008ee929473ff80962e7d2067f54faff9c923.tar.gz
Check branches in supercedent pipelines
Supercedent was designed for a post pipeline and predates common use of a promote pipeline. It therefore only consulted the 'ref' attribute of a change (so that it would work on tags as well as branches). However, it should work just fine as a manager for promote pipelines too, so have it check the branch attribute for de-duplication first, and only use the ref attribute if it isn't present. Change-Id: I1393c828b86a577fba568a183efee98cf5d030e7
Diffstat (limited to 'zuul/manager')
-rw-r--r--zuul/manager/supercedent.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/zuul/manager/supercedent.py b/zuul/manager/supercedent.py
index a63fcb797..73932484b 100644
--- a/zuul/manager/supercedent.py
+++ b/zuul/manager/supercedent.py
@@ -26,10 +26,13 @@ class SupercedentPipelineManager(PipelineManager):
return DynamicChangeQueueContextManager(existing)
# Don't use Pipeline.getQueue to find an existing queue
- # because we're matching project and ref.
+ # because we're matching project and (branch or ref).
for queue in self.pipeline.queues:
if (queue.queue[-1].change.project == change.project and
- queue.queue[-1].change.ref == change.ref):
+ ((hasattr(change, 'branch') and
+ hasattr(queue.queue[-1].change, 'branch') and
+ queue.queue[-1].change.branch == change.branch) or
+ queue.queue[-1].change.ref == change.ref)):
self.log.debug("Found existing queue %s", queue)
return DynamicChangeQueueContextManager(queue)
change_queue = model.ChangeQueue(