Browse Source

Merge "Add more logging to zuul merger process"

changes/52/80152/2
Jenkins 8 years ago committed by Gerrit Code Review
parent
commit
0781020be2
  1. 8
      zuul/merger/merger.py
  2. 2
      zuul/merger/server.py
  3. 14
      zuul/scheduler.py

8
zuul/merger/merger.py

@ -195,7 +195,7 @@ class Merger(object):
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 @@ class Merger(object):
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

2
zuul/merger/server.py

@ -90,8 +90,10 @@ class MergeServer(object):
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)

14
zuul/scheduler.py

@ -1111,6 +1111,16 @@ class BasePipelineManager(object):
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 @@ class BasePipelineManager(object):
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):

Loading…
Cancel
Save