Avoid import of zuul files

Check that new upstream projects do not have any zuul files in there and
fail if so.

We add this check to not import a zuul config file that is broken. We
only accept zuul config files that have been gone through review.

Change-Id: Ie33d91637e812a17f3b2a2b2c75cbbadcde176ad
This commit is contained in:
Andreas Jaeger 2018-02-21 21:16:24 +01:00
parent a20b15a3aa
commit 5c074b977b
1 changed files with 13 additions and 0 deletions

View File

@ -68,6 +68,19 @@ def check_repo(repo_path):
print(" %s" % tag)
else:
print(" Found no tags.")
# Check that no zuul files are in here
for branch in branches:
print("Testing branch %s" % branch)
if 'origin/HEAD' in branch:
continue
repo.git.checkout(branch)
head = repo.head.commit.tree
for z in ['zuul.yaml', 'zuul.yaml', 'zuul.d', '.zuul.d']:
if z in head:
found_errors += 1
print(" ERROR: Found %s on branch %s" % (z, branch))
print(" Remove any zuul config files before import.")
# Just an empty line for nicer formatting
print("")
return found_errors