Alias zuul git repos to git.zuul-ci.org

This adds support for the cgit-alias directive added in
https://review.openstack.org/555105.  It's safe to land this change
before or after the implementation.

It also aliases the zuul project repos to git.zuul-ci.org.

Change-Id: I05a7156e092faad1457973b88537ec73012a5c96
This commit is contained in:
James E. Blair 2018-03-23 13:17:35 -07:00
parent 9fadc6f206
commit 6da7b5e6ad
2 changed files with 44 additions and 1 deletions

View File

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

View File

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