Remove build descriptions

These (the HTML formatted information we would display on Jenkins
about related builds) are no longer relevant in v3.

Change-Id: Id1c3ff353308f2732d223f63dec5fb743029ec2c
This commit is contained in:
James E. Blair 2016-07-25 13:15:57 -07:00
parent 1059cce6ea
commit 43746ffe51
5 changed files with 1 additions and 209 deletions

View File

@ -362,24 +362,3 @@ function should be the following encoded in JSON format:
The original job is expected to complete with a WORK_DATA and
WORK_FAIL packet as described in `Starting Builds`_.
Build Descriptions
^^^^^^^^^^^^^^^^^^
In order to update the job running system with a description of the
current state of all related builds, the job runner may optionally
implement the following Gearman function:
set_description:MANAGER_NAME
Where **MANAGER_NAME** is used as described in `Stopping Builds`_.
The argument to the function is the following encoded in JSON format:
**name**
The job name of the build to describe.
**number**
The build number of the build to describe.
**html_description**
The description of the build in HTML format.

View File

@ -546,7 +546,6 @@ class FakeBuild(threading.Thread):
self.waiting = False
self.aborted = False
self.created = time.time()
self.description = ''
self.run_error = False
def release(self):
@ -624,8 +623,7 @@ class FakeBuild(threading.Thread):
self.worker.build_history.append(
BuildHistory(name=self.name, number=self.number,
result=result, changes=changes, node=self.node,
uuid=self.unique, description=self.description,
parameters=self.parameters,
uuid=self.unique, parameters=self.parameters,
pipeline=self.parameters['ZUUL_PIPELINE'])
)
@ -689,8 +687,6 @@ class FakeWorker(gear.Worker):
self.handleLaunch(job)
elif cmd == 'stop':
self.handleStop(job)
elif cmd == 'set_description':
self.handleSetDescription(job)
def handleLaunch(self, job):
# TODOv3(jeblair): handle nodes
@ -716,24 +712,6 @@ class FakeWorker(gear.Worker):
return
job.sendWorkFail()
def handleSetDescription(self, job):
self.log.debug("handle set description")
parameters = json.loads(job.arguments)
name = parameters['name']
number = parameters['number']
descr = parameters['html_description']
for build in self.running_builds:
if build.name == name and build.number == number:
build.description = descr
job.sendWorkComplete()
return
for build in self.build_history:
if build.name == name and build.number == number:
build.description = descr
job.sendWorkComplete()
return
job.sendWorkFail()
def work(self):
while self.running:
try:

View File

@ -2261,25 +2261,6 @@ jobs:
self.sched.testConfig(self.config.get('zuul', 'tenant_config'),
self.connections)
@skip("Disabled for early v3 development")
def test_build_description(self):
"Test that build descriptions update"
self.worker.registerFunction('set_description:' +
self.worker.worker_id)
A = self.fake_gerrit.addFakeChange('org/project', 'master', 'A')
A.addApproval('CRVW', 2)
self.fake_gerrit.addEvent(A.addApproval('APRV', 1))
self.waitUntilSettled()
desc = self.history[0].description
self.log.debug("Description: %s" % desc)
self.assertTrue(re.search("Branch.*master", desc))
self.assertTrue(re.search("Pipeline.*gate", desc))
self.assertTrue(re.search("project-merge.*SUCCESS", desc))
self.assertTrue(re.search("project-test1.*SUCCESS", desc))
self.assertTrue(re.search("project-test2.*SUCCESS", desc))
self.assertTrue(re.search("Reported result.*SUCCESS", desc))
@skip("Disabled for early v3 development")
def test_queue_names(self):
"Test shared change queue names"

View File

@ -541,28 +541,6 @@ class LaunchClient(object):
timeout=300)
return True
def setBuildDescription(self, build, desc):
try:
name = "set_description:%s" % build.__gearman_manager
except AttributeError:
# We haven't yet received the first data packet that tells
# us where the job is running.
return False
if self.job_registration and not self.isJobRegistered(name):
return False
desc_uuid = str(uuid4().hex)
data = dict(name=build.job.name,
number=build.number,
html_description=desc)
desc_job = gear.Job(name, json.dumps(data), unique=desc_uuid)
self.meta_jobs[desc_uuid] = desc_job
self.log.debug("Submitting describe job: %s", desc_job)
self.gearman.submitJob(desc_job, precedence=gear.PRECEDENCE_LOW,
timeout=300)
return True
def lookForLostBuilds(self):
self.log.debug("Looking for lost builds")
for build in self.builds.values():

View File

@ -403,7 +403,6 @@ class BasePipelineManager(object):
"for change %s" % (build, item.change))
build.result = 'CANCELED'
canceled = True
self.updateBuildDescriptions(old_build_set)
for item_behind in item.items_behind:
self.log.debug("Canceling jobs for change %s, behind change %s" %
(item_behind.change, item.change))
@ -584,26 +583,6 @@ class BasePipelineManager(object):
(self.pipeline.name, changed))
return changed
def updateBuildDescriptions(self, build_set):
for build in build_set.getBuilds():
try:
desc = self.formatDescription(build)
self.sched.launcher.setBuildDescription(build, desc)
except:
# Log the failure and let loop continue
self.log.error("Failed to update description for build %s" %
(build))
if build_set.previous_build_set:
for build in build_set.previous_build_set.getBuilds():
try:
desc = self.formatDescription(build)
self.sched.launcher.setBuildDescription(build, desc)
except:
# Log the failure and let loop continue
self.log.error("Failed to update description for "
"build %s in previous build set" % (build))
def onBuildStarted(self, build):
self.log.debug("Build %s started" % build)
return True
@ -710,109 +689,6 @@ class BasePipelineManager(object):
except:
self.log.exception("Exception while reporting:")
item.setReportedResult('ERROR')
self.updateBuildDescriptions(item.current_build_set)
return ret
def formatDescription(self, build):
concurrent_changes = ''
concurrent_builds = ''
other_builds = ''
for change in build.build_set.other_changes:
concurrent_changes += '<li><a href="{change.url}">\
{change.number},{change.patchset}</a></li>'.format(
change=change)
change = build.build_set.item.change
for build in build.build_set.getBuilds():
if build.url:
concurrent_builds += """\
<li>
<a href="{build.url}">
{build.job.name} #{build.number}</a>: {build.result}
</li>
""".format(build=build)
else:
concurrent_builds += """\
<li>
{build.job.name}: {build.result}
</li>""".format(build=build)
if build.build_set.previous_build_set:
other_build = build.build_set.previous_build_set.getBuild(
build.job.name)
if other_build:
other_builds += """\
<li>
Preceded by: <a href="{build.url}">
{build.job.name} #{build.number}</a>
</li>
""".format(build=other_build)
if build.build_set.next_build_set:
other_build = build.build_set.next_build_set.getBuild(
build.job.name)
if other_build:
other_builds += """\
<li>
Succeeded by: <a href="{build.url}">
{build.job.name} #{build.number}</a>
</li>
""".format(build=other_build)
result = build.build_set.result
if hasattr(change, 'number'):
ret = """\
<p>
Triggered by change:
<a href="{change.url}">{change.number},{change.patchset}</a><br/>
Branch: <b>{change.branch}</b><br/>
Pipeline: <b>{self.pipeline.name}</b>
</p>"""
elif hasattr(change, 'ref'):
ret = """\
<p>
Triggered by reference:
{change.ref}</a><br/>
Old revision: <b>{change.oldrev}</b><br/>
New revision: <b>{change.newrev}</b><br/>
Pipeline: <b>{self.pipeline.name}</b>
</p>"""
else:
ret = ""
if concurrent_changes:
ret += """\
<p>
Other changes tested concurrently with this change:
<ul>{concurrent_changes}</ul>
</p>
"""
if concurrent_builds:
ret += """\
<p>
All builds for this change set:
<ul>{concurrent_builds}</ul>
</p>
"""
if other_builds:
ret += """\
<p>
Other build sets for this change:
<ul>{other_builds}</ul>
</p>
"""
if result:
ret += """\
<p>
Reported result: <b>{result}</b>
</p>
"""
ret = ret.format(**locals())
return ret
def reportStats(self, item):