From 9f75ef1ed62c2e1a75fd4d2270f339022b2a950d Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 5 Aug 2025 09:48:28 -0700 Subject: [PATCH] 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 --- tools/check_valid_gerrit_projects.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tools/check_valid_gerrit_projects.py b/tools/check_valid_gerrit_projects.py index 351160a078..c1e50d693c 100755 --- a/tools/check_valid_gerrit_projects.py +++ b/tools/check_valid_gerrit_projects.py @@ -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)