Merge "Partial sync with OpenStack requirements."
diff --git a/tests/test_scheduler.py b/tests/test_scheduler.py
index a1f48fa..70956b4 100644
--- a/tests/test_scheduler.py
+++ b/tests/test_scheduler.py
@@ -2848,7 +2848,7 @@
for q in p['change_queues']:
for head in q['heads']:
for change in head:
- self.assertEqual(change['id'], 'None')
+ self.assertEqual(change['id'], None)
for job in change['jobs']:
status_jobs.add(job['name'])
self.assertIn('project-bitrot-stable-old', status_jobs)
diff --git a/zuul/model.py b/zuul/model.py
index 056f41d..0c69430 100644
--- a/zuul/model.py
+++ b/zuul/model.py
@@ -304,6 +304,7 @@
ret['item_ahead'] = None
ret['items_behind'] = [i.change._id() for i in item.items_behind]
ret['failing_reasons'] = item.current_build_set.failing_reasons
+ ret['zuul_ref'] = item.current_build_set.ref
ret['project'] = changeish.project.name
ret['enqueue_time'] = int(item.enqueue_time * 1000)
ret['jobs'] = []
@@ -531,10 +532,9 @@
self.job_trees = []
def addJob(self, job):
- if job not in [x.job for x in self.job_trees]:
- t = JobTree(job)
- self.job_trees.append(t)
- return t
+ t = JobTree(job)
+ self.job_trees.append(t)
+ return t
def getJobs(self):
jobs = []
@@ -769,11 +769,8 @@
class NullChange(Changeish):
is_reportable = False
- def __init__(self, project):
- super(NullChange, self).__init__(project)
-
def _id(self):
- return 'None'
+ return None
def equals(self, other):
return False
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index 46897bd..8b6c20c 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -998,7 +998,7 @@
self.cancelJobs(item)
self.prepareRef(item)
if item.current_build_set.unable_to_merge:
- failing_reasons.append("merge conflict")
+ failing_reasons.append("it has a merge conflict")
if self.launchJobs(item):
changed = True
if self.pipeline.didAnyJobFail(item):
@@ -1007,7 +1007,7 @@
try:
self.reportItem(item)
except MergeFailure:
- failing_reasons.append("did not merge")
+ failing_reasons.append("it did not merge")
for item_behind in item.items_behind:
self.log.info("Resetting builds for change %s because the "
"item ahead, %s, failed to merge" %