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:
James E. Blair
2025-08-05 09:48:28 -07:00
parent 5a3110c981
commit 9f75ef1ed6

View File

@@ -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)