Browse Source

Add missing params to launcher.

Change-Id: Iddc4f508fa2425c31369c84f63d3bcf8df5e0887
changes/11/7911/2
James E. Blair 10 years ago
parent
commit
a03262c814
  1. 9
      zuul/launcher/jenkins.py
  2. 5
      zuul/model.py
  3. 5
      zuul/scheduler.py
  4. 1
      zuul/trigger/gerrit.py

9
zuul/launcher/jenkins.py

@ -137,7 +137,14 @@ class Jenkins(object):
self.log.info("Launch job %s for change %s with dependent changes %s" % (
job, change, dependent_changes))
uuid = str(uuid1())
params = dict(UUID=uuid)
dependent_changes_str = '^'.join(
['%s:%s:%s' % (c.project.name, c.branch, c.refspec)
for c in dependent_changes])
params = dict(UUID=uuid,
GERRIT_PROJECT=change.project.name,
GERRIT_BRANCH=change.branch,
GERRIT_REFSPEC=change.refspec,
DEPENDENT_CHANGES=dependent_changes_str)
build = Build(job, uuid)
self.builds[uuid] = build
# We can get the started notification on another thread before this is done

5
zuul/model.py

@ -136,11 +136,13 @@ class Project(object):
return tree.getJobs()
class Change(object):
def __init__(self, queue_name, project, number, patchset):
def __init__(self, queue_name, project, branch, number, patchset, refspec):
self.queue_name = queue_name
self.project = project
self.branch = branch
self.number = number
self.patchset = patchset
self.refspec = refspec
self.jobs = {}
self.job_urls = {}
self.change_ahead = None
@ -241,6 +243,7 @@ class TriggerEvent(object):
self.project_name = None
self.change_number = None
self.patch_number = None
self.refspec = None
self.approvals = []
self.branch = None
self.ref = None

5
zuul/scheduler.py

@ -160,8 +160,9 @@ class Scheduler(object):
self.log.debug("Event %s ignored by %s" % (event, manager))
continue
if event.change_number:
change = Change(manager.name, project,
event.change_number, event.patch_number)
change = Change(manager.name, project, event.branch,
event.change_number, event.patch_number,
event.refspec)
self.log.info("Adding %s, %s to to %s" % (
project, change, manager))
manager.addChange(change)

1
zuul/trigger/gerrit.py

@ -40,6 +40,7 @@ class GerritEventConnector(threading.Thread):
patchset = data.get('patchSet')
if patchset:
event.patch_number = patchset.get('number')
event.refspec = patchset.get('ref')
event.approvals = data.get('approvals')
self.sched.addEvent(event)

Loading…
Cancel
Save