diff --git a/gerrit/projects.yaml b/gerrit/projects.yaml index c5d6bba72f..1bd056673b 100755 --- a/gerrit/projects.yaml +++ b/gerrit/projects.yaml @@ -249,6 +249,9 @@ - openstack-ci - project: openstack-infra/nodepool use-storyboard: true + cgit-alias: + site: git.zuul-ci.org + path: nodepool groups: - openstack-ci description: Manage a pool of nodes for a distributed test infrastructure @@ -837,16 +840,25 @@ acl-config: /home/gerrit2/acls/openstack-infra/zuul.config - project: openstack-infra/zuul use-storyboard: true + cgit-alias: + site: git.zuul-ci.org + path: zuul groups: - openstack-ci description: The Gatekeeper, or a project gating system - project: openstack-infra/zuul-base-jobs use-storyboard: true + cgit-alias: + site: git.zuul-ci.org + path: zuul-base-jobs groups: - openstack-ci description: Zuul base job definition - project: openstack-infra/zuul-jobs use-storyboard: true + cgit-alias: + site: git.zuul-ci.org + path: zuul-jobs groups: - openstack-ci description: Ansible job definitions for Zuul @@ -857,11 +869,17 @@ description: Zuul packaging - project: openstack-infra/zuul-sphinx use-storyboard: true + cgit-alias: + site: git.zuul-ci.org + path: zuul-sphinx groups: - openstack-ci description: Sphinx extension for Zuul jobs - project: openstack-infra/zuul-website use-storyboard: true + cgit-alias: + site: git.zuul-ci.org + path: zuul-website groups: - openstack-ci description: The contents of the Zuul website diff --git a/tools/check_valid_gerrit_projects.py b/tools/check_valid_gerrit_projects.py index 071ce16c9f..bb96dd25e7 100755 --- a/tools/check_valid_gerrit_projects.py +++ b/tools/check_valid_gerrit_projects.py @@ -108,11 +108,13 @@ def main(): VALID_LABELS = ["acl-config", "description", "docimpact-group", "groups", "homepage", "options", "project", - "upstream", "upstream-prefix", "use-storyboard"] + "upstream", "upstream-prefix", "use-storyboard", + "cgit-alias"] VALID_SCHEMES = ['https://', 'http://', 'git://'] DESCRIPTION_REQUIRED = ['openstack', 'openstack-infra', 'openstack-dev', 'stackforge'] VALID_OPTIONS = ['delay-release', 'track-upstream', 'translate'] + CGIT_ALIAS_SITES = ['zuul-ci.org'] for p in projects: name = p.get('project') @@ -189,6 +191,29 @@ def main(): found_errors += 1 print("ERROR: Unknown keyword '%s' in project %s" % (entry, name)) + # Check for valid cgit aliases + cgit_alias = p.get('cgit_alias') + if cgit_alias: + if not isinstance(cgit_alias, dict): + found_errors += 1 + print("ERROR: cgit alias in project %s must be a dict" % + (name,)) + else: + if 'site' not in cgit_alias or 'path' not in cgit_alias: + found_errors += 1 + print("ERROR: cgit alias in project %s must have " + "a site and path" % (name,)) + else: + site = cgit_alias['site'] + path = cgit_alias['path'] + if path.startswith('/'): + found_errors += 1 + print("ERROR: cgit alias path in project %s must " + "not begin with /" % (name,)) + if site not in CGIT_ALIAS_SITES: + found_errors += 1 + print("ERROR: cgit alias site in project %s is " + "not valid" % (name,)) # Check for valid options for option in p.get('options', []): if option not in VALID_OPTIONS: