Add a simple description check for gerrit/projects.yaml

Add a very simple check for some common typos that might appear in the
descriptions.

Correct existing typos as found by the check

Change-Id: I6edd833de8544e44750c3a3fb49a065f99a18499
This commit is contained in:
Ian Wienand 2015-08-27 12:35:40 +10:00
parent 6a43970de5
commit 1942b394d6
2 changed files with 30 additions and 10 deletions

View File

@ -23,10 +23,10 @@
options: options:
- direct-release - direct-release
- project: openstack-dev/devstack-plugin-cookiecutter - project: openstack-dev/devstack-plugin-cookiecutter
description: Cookiecutter Template for new devstack plugins description: Cookiecutter Template for new DevStack plugins
acl-config: /home/gerrit2/acls/openstack-dev/devstack.config acl-config: /home/gerrit2/acls/openstack-dev/devstack.config
- project: openstack-dev/devstack-vagrant - project: openstack-dev/devstack-vagrant
description: Vagrant scripts to build local devstack environments description: Vagrant scripts to build local DevStack environments
- project: openstack-dev/grenade - project: openstack-dev/grenade
description: OpenStack upgrade testing tool description: OpenStack upgrade testing tool
- project: openstack-dev/hacking - project: openstack-dev/hacking
@ -85,7 +85,7 @@
options: options:
- direct-release - direct-release
- project: openstack-infra/devstack-gate - project: openstack-infra/devstack-gate
description: Run devstack in the gate description: Run DevStack in the gate
use-storyboard: true use-storyboard: true
groups: groups:
- openstack-ci - openstack-ci
@ -926,14 +926,14 @@
- project: openstack/designate-specs - project: openstack/designate-specs
description: OpenStack DNS As A Service (Designate) Specifications description: OpenStack DNS As A Service (Designate) Specifications
- project: openstack/devstack-plugin-amqp1 - project: openstack/devstack-plugin-amqp1
description: Devstack plugin to configure AMQP1. description: DevStack plugin to configure AMQP1.
acl-config: /home/gerrit2/acls/openstack/oslo.messaging.config acl-config: /home/gerrit2/acls/openstack/oslo.messaging.config
groups: groups:
- oslo - oslo
- project: openstack/devstack-plugin-hdfs - project: openstack/devstack-plugin-hdfs
description: Devstack plugin to configure HDFS backend. description: DevStack plugin to configure HDFS backend.
- project: openstack/devstack-plugin-zmq - project: openstack/devstack-plugin-zmq
description: Devstack plugin to configure ZMQ. description: DevStack plugin to configure ZMQ.
acl-config: /home/gerrit2/acls/openstack/oslo.messaging.config acl-config: /home/gerrit2/acls/openstack/oslo.messaging.config
groups: groups:
- oslo - oslo
@ -1816,9 +1816,9 @@
description: Agent for using Microsoft DNS Server with Designate description: Agent for using Microsoft DNS Server with Designate
acl-config: /home/gerrit2/acls/openstack/designate.config acl-config: /home/gerrit2/acls/openstack/designate.config
- project: stackforge/devstack-plugin-glusterfs - project: stackforge/devstack-plugin-glusterfs
description: Devstack plugin to configure GlusterFS backend. description: DevStack plugin to configure GlusterFS backend.
- project: stackforge/devstack-plugin-sheepdog - project: stackforge/devstack-plugin-sheepdog
description: Devstack plugin to configure Sheepdog backend. description: DevStack plugin to configure Sheepdog backend.
- project: stackforge/distil - project: stackforge/distil
description: Rating Service for OpenStack description: Rating Service for OpenStack
acl-config: /home/gerrit2/acls/stackforge/distil.config acl-config: /home/gerrit2/acls/stackforge/distil.config
@ -1827,7 +1827,7 @@
- project: stackforge/dox - project: stackforge/dox
description: Run tests in a docker container description: Run tests in a docker container
- project: stackforge/drbd-devstack - project: stackforge/drbd-devstack
description: Devstack plugin to configure the DRBD backend. description: DevStack plugin to configure the DRBD backend.
- project: stackforge/driverlog - project: stackforge/driverlog
description: Vendor drivers for OpenStack description: Vendor drivers for OpenStack
- project: stackforge/ec2-api - project: stackforge/ec2-api
@ -2079,7 +2079,7 @@
- project: stackforge/fuel-plugin-tls - project: stackforge/fuel-plugin-tls
groups: groups:
- fuel - fuel
description: Fuel plugin to secure openstack using the Transport Layer Security description: Fuel plugin to secure OpenStack using the Transport Layer Security
(TLS) protocol (TLS) protocol
docimpact-group: fuel docimpact-group: fuel
- project: stackforge/fuel-plugin-vmware-dvs - project: stackforge/fuel-plugin-vmware-dvs

View File

@ -15,6 +15,7 @@
# limitations under the License. # limitations under the License.
import argparse import argparse
import re
import sys import sys
import yaml import yaml
@ -52,6 +53,25 @@ for p in projects:
if args.verbose: if args.verbose:
print('Checking %s' % name) print('Checking %s' % name)
description = p.get('description') description = p.get('description')
# *very* simple check for common description mistakes
badwords = (
# (words), what_words_should_be
(('openstack', 'Openstack', 'Open Stack'), 'OpenStack'),
(('Devstack', 'devstack'), 'DevStack')
)
if description:
for words, should_be in badwords:
for word in words:
# look for the bad word hanging out on it's own. Only
# trick is "\b" doesn't consider "-" or '.' as a
# word-boundary, so ignore it if it looks like some
# sort of job-description (e.g. "foo-devstack-bar") or
# a url ("foo.openstack.org")
if re.search(r'(?<![-.])\b%s\b' % word, description):
print "Error: %s: should be %s" % (description, should_be)
found_errors += 1
if not description and repo_group in DESCRIPTION_REQUIRED: if not description and repo_group in DESCRIPTION_REQUIRED:
found_errors += 1 found_errors += 1
print("Error: Project %s has no description" % name) print("Error: Project %s has no description" % name)