Test for system-required

system-required template is now obsolete, check that nobody sneaks it in
again.

Change-Id: Ifa96cba6ac2d16a6a8b5f7637d706fbf824f7fb8
This commit is contained in:
Andreas Jaeger 2018-06-28 08:34:58 +02:00
parent 84e7963117
commit 713ad6adfd
1 changed files with 32 additions and 0 deletions

View File

@ -83,6 +83,37 @@ def check_release_jobs():
return errors
def blacklist_jobs():
"""Check that certain jobs and templates are *not* used."""
# Currently only handles templates
blacklist_templates = [
'system-required'
]
errors = False
print("\nChecking for obsolete jobs and templates")
print("=========================================")
for entry in projects:
project = entry['project']
name = project['name']
# The openstack catch all contains system-required, so skip that one.
if name == "^openstack.*":
continue
found = [tmpl for tmpl in project.get('templates', [])
if tmpl in blacklist_templates]
if found:
errors = True
print(" ERROR: Found obsolete template for %s:" % name)
for x in found:
print(" %s" % x)
print(" Remove it.")
if not errors:
print("... all fine.")
return errors
def check_pipeline(project, job_pipeline, pipeline_name):
errors = False
@ -137,6 +168,7 @@ def check_voting():
def check_all():
errors = check_projects_sorted()
errors = blacklist_jobs() or errors
errors = check_release_jobs() or errors
errors = check_voting() or errors