Merge "Add more logging to zuul merger process"
diff --git a/zuul/merger/merger.py b/zuul/merger/merger.py
index ff6b682..f150771 100644
--- a/zuul/merger/merger.py
+++ b/zuul/merger/merger.py
@@ -195,7 +195,7 @@
try:
self.log.info("Updating local repository %s", project)
repo.update()
- except:
+ except Exception:
self.log.exception("Unable to update %s", project)
def _mergeChange(self, item, ref):
@@ -282,6 +282,12 @@
recent = {}
commit = None
for item in items:
+ if item.get("number") and item.get("patchset"):
+ self.log.debug("Merging for change %s,%s." %
+ (item["number"], item["patchset"]))
+ elif item.get("newrev") and item.get("oldrev"):
+ self.log.debug("Merging for rev %s with oldrev %s." %
+ (item["newrev"], item["oldrev"]))
commit = self._mergeItem(item, recent)
if not commit:
return None
diff --git a/zuul/merger/server.py b/zuul/merger/server.py
index d8bc1b8..0d105f6 100644
--- a/zuul/merger/server.py
+++ b/zuul/merger/server.py
@@ -90,8 +90,10 @@
job = self.worker.getJob()
try:
if job.name == 'merger:merge':
+ self.log.debug("Got merge job.")
self.merge(job)
elif job.name == 'merger:update':
+ self.log.debug("Got update job.")
self.update(job)
else:
self.log.error("Unable to handle job %s" % job.name)
diff --git a/zuul/scheduler.py b/zuul/scheduler.py
index ac99740..c941a98 100644
--- a/zuul/scheduler.py
+++ b/zuul/scheduler.py
@@ -1111,6 +1111,16 @@
def _makeMergerItem(self, item):
# Create a dictionary with all info about the item needed by
# the merger.
+ number = None
+ patchset = None
+ oldrev = None
+ newrev = None
+ if hasattr(item.change, 'number'):
+ number = item.change.number
+ patchset = item.change.patchset
+ elif hasattr(item.change, 'newrev'):
+ oldrev = item.change.oldrev
+ newrev = item.change.newrev
return dict(project=item.change.project.name,
url=self.pipeline.trigger.getGitUrl(
item.change.project),
@@ -1118,6 +1128,10 @@
refspec=item.change.refspec,
branch=item.change.branch,
ref=item.current_build_set.ref,
+ number=number,
+ patchset=patchset,
+ oldrev=oldrev,
+ newrev=newrev,
)
def prepareRef(self, item):