Revert "Allow multiple invocations of the same job"
This reverts commit 3aa3727225
.
There are several more places in Zuul where it is assumed that job
names are unique. Fixing them all would be complicated and perhaps
not worth the benefit. Go back to requiring that they be unique for
a project.
Change-Id: I5b8aa33d6aed9cb086f44594ce59947c0190cc11
This commit is contained in:
parent
6e81141f58
commit
12a92b1866
@ -772,8 +772,8 @@ for the project.
|
|||||||
|
|
||||||
Note that if multiple templates are used for a project and one
|
Note that if multiple templates are used for a project and one
|
||||||
template specifies a job that is also specified in another template,
|
template specifies a job that is also specified in another template,
|
||||||
or specified in the project itself, those jobs will be duplicated in
|
or specified in the project itself, the configuration defined by
|
||||||
the resulting project configuration.
|
either the last template or the project itself will take priority.
|
||||||
|
|
||||||
logging.conf
|
logging.conf
|
||||||
~~~~~~~~~~~~
|
~~~~~~~~~~~~
|
||||||
|
5
tests/fixtures/layout.yaml
vendored
5
tests/fixtures/layout.yaml
vendored
@ -117,9 +117,6 @@ project-templates:
|
|||||||
- name: test-five
|
- name: test-five
|
||||||
check:
|
check:
|
||||||
- '{name}-{something}-test5'
|
- '{name}-{something}-test5'
|
||||||
- name: test-five-also
|
|
||||||
check:
|
|
||||||
- '{name}-{something}-test5'
|
|
||||||
|
|
||||||
projects:
|
projects:
|
||||||
- name: org/project
|
- name: org/project
|
||||||
@ -215,8 +212,6 @@ projects:
|
|||||||
- name: test-three-and-four
|
- name: test-three-and-four
|
||||||
- name: test-five
|
- name: test-five
|
||||||
something: foo
|
something: foo
|
||||||
- name: test-five-also
|
|
||||||
something: foo
|
|
||||||
check:
|
check:
|
||||||
- project-test6
|
- project-test6
|
||||||
|
|
||||||
|
@ -2061,13 +2061,8 @@ class TestScheduler(testtools.TestCase):
|
|||||||
).result, 'SUCCESS')
|
).result, 'SUCCESS')
|
||||||
self.assertEqual(self.getJobFromHistory('layered-project-test4'
|
self.assertEqual(self.getJobFromHistory('layered-project-test4'
|
||||||
).result, 'SUCCESS')
|
).result, 'SUCCESS')
|
||||||
# test5 should run twice because two templates define it
|
self.assertEqual(self.getJobFromHistory('layered-project-foo-test5'
|
||||||
test5_count = 0
|
).result, 'SUCCESS')
|
||||||
for job in self.worker.build_history:
|
|
||||||
if job.name == 'layered-project-foo-test5':
|
|
||||||
test5_count += 1
|
|
||||||
self.assertEqual(job.result, 'SUCCESS')
|
|
||||||
self.assertEqual(test5_count, 2)
|
|
||||||
self.assertEqual(self.getJobFromHistory('project-test6').result,
|
self.assertEqual(self.getJobFromHistory('project-test6').result,
|
||||||
'SUCCESS')
|
'SUCCESS')
|
||||||
|
|
||||||
|
@ -596,6 +596,7 @@ class JobTree(object):
|
|||||||
self.job_trees = []
|
self.job_trees = []
|
||||||
|
|
||||||
def addJob(self, job):
|
def addJob(self, job):
|
||||||
|
if job not in [x.job for x in self.job_trees]:
|
||||||
t = JobTree(job)
|
t = JobTree(job)
|
||||||
self.job_trees.append(t)
|
self.job_trees.append(t)
|
||||||
return t
|
return t
|
||||||
|
@ -384,11 +384,10 @@ class Scheduler(threading.Thread):
|
|||||||
config_project.update(
|
config_project.update(
|
||||||
{pipeline.name: expanded[pipeline.name] +
|
{pipeline.name: expanded[pipeline.name] +
|
||||||
config_project.get(pipeline.name, [])})
|
config_project.get(pipeline.name, [])})
|
||||||
# TODO: future enhancement -- add an option to the
|
# TODO: future enhancement -- handle the case where
|
||||||
# template block to indicate that duplicate jobs should be
|
# duplicate jobs have different children and you want all
|
||||||
# merged (especially to handle the case where they have
|
# of the children to run after a single run of the
|
||||||
# children and you want all of the children to run after a
|
# parent).
|
||||||
# single run of the parent).
|
|
||||||
|
|
||||||
layout.projects[config_project['name']] = project
|
layout.projects[config_project['name']] = project
|
||||||
mode = config_project.get('merge-mode', 'merge-resolve')
|
mode = config_project.get('merge-mode', 'merge-resolve')
|
||||||
|
Loading…
Reference in New Issue
Block a user