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.
|
# limitations under the License.
|
||||||
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import collections
|
||||||
import contextlib
|
import contextlib
|
||||||
import git
|
import git
|
||||||
import os
|
import os
|
||||||
@@ -170,9 +171,11 @@ def main():
|
|||||||
VALID_OPTIONS = ['delay-release', 'translate']
|
VALID_OPTIONS = ['delay-release', 'translate']
|
||||||
CGIT_ALIAS_SITES = ['zuul-ci.org']
|
CGIT_ALIAS_SITES = ['zuul-ci.org']
|
||||||
|
|
||||||
|
project_group_count = collections.Counter()
|
||||||
for p in projects:
|
for p in projects:
|
||||||
name = p.get('project')
|
name = p.get('project')
|
||||||
repo_group, repo_name = name.split('/')
|
repo_group, repo_name = name.split('/')
|
||||||
|
project_group_count.update([repo_group])
|
||||||
if not name:
|
if not name:
|
||||||
# not a project
|
# not a project
|
||||||
found_errors += 1
|
found_errors += 1
|
||||||
@@ -326,6 +329,9 @@ def main():
|
|||||||
print("Error: groups entry for project %s is not a list." % name)
|
print("Error: groups entry for project %s is not a list." % name)
|
||||||
|
|
||||||
found_errors += check_zuul_main(args.zuul_main_file, projects)
|
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:
|
if found_errors:
|
||||||
print("Found %d error(s) in %s" % (found_errors, args.infile))
|
print("Found %d error(s) in %s" % (found_errors, args.infile))
|
||||||
sys.exit(1)
|
sys.exit(1)
|
||||||
|
Reference in New Issue
Block a user