Do not allow new x/ namespace projects
We intend new projects to go into other namespaces; the x/ namespace is for legacy projects insufficiently motivated to reclassify themselves. Add a check so that people don't cargo-cult new projects into the x/ namespace. Change-Id: I83c2d6e55ffa62b1416e5646fbfcd8c6ed652ab8
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import argparse
|
||||
import collections
|
||||
import contextlib
|
||||
import git
|
||||
import os
|
||||
@@ -170,9 +171,11 @@ def main():
|
||||
VALID_OPTIONS = ['delay-release', 'translate']
|
||||
CGIT_ALIAS_SITES = ['zuul-ci.org']
|
||||
|
||||
project_group_count = collections.Counter()
|
||||
for p in projects:
|
||||
name = p.get('project')
|
||||
repo_group, repo_name = name.split('/')
|
||||
project_group_count.update([repo_group])
|
||||
if not name:
|
||||
# not a project
|
||||
found_errors += 1
|
||||
@@ -326,6 +329,9 @@ def main():
|
||||
print("Error: groups entry for project %s is not a list." % name)
|
||||
|
||||
found_errors += check_zuul_main(args.zuul_main_file, projects)
|
||||
if project_group_count['x'] > 582:
|
||||
found_errors += 1
|
||||
print("Error: do not create new projects in the x/ namespace")
|
||||
if found_errors:
|
||||
print("Found %d error(s) in %s" % (found_errors, args.infile))
|
||||
sys.exit(1)
|
||||
|
Reference in New Issue
Block a user