From 1942b394d6da526679c4c7b3d024f276bb4099dd Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Thu, 27 Aug 2015 12:35:40 +1000 Subject: [PATCH] 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 --- gerrit/projects.yaml | 20 ++++++++++---------- tools/check_valid_gerrit_projects.py | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/gerrit/projects.yaml b/gerrit/projects.yaml index cf2bd47cf3..952b5e63f3 100755 --- a/gerrit/projects.yaml +++ b/gerrit/projects.yaml @@ -23,10 +23,10 @@ options: - direct-release - 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 - 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 description: OpenStack upgrade testing tool - project: openstack-dev/hacking @@ -85,7 +85,7 @@ options: - direct-release - project: openstack-infra/devstack-gate - description: Run devstack in the gate + description: Run DevStack in the gate use-storyboard: true groups: - openstack-ci @@ -926,14 +926,14 @@ - project: openstack/designate-specs description: OpenStack DNS As A Service (Designate) Specifications - 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 groups: - oslo - project: openstack/devstack-plugin-hdfs - description: Devstack plugin to configure HDFS backend. + description: DevStack plugin to configure HDFS backend. - 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 groups: - oslo @@ -1816,9 +1816,9 @@ description: Agent for using Microsoft DNS Server with Designate acl-config: /home/gerrit2/acls/openstack/designate.config - project: stackforge/devstack-plugin-glusterfs - description: Devstack plugin to configure GlusterFS backend. + description: DevStack plugin to configure GlusterFS backend. - project: stackforge/devstack-plugin-sheepdog - description: Devstack plugin to configure Sheepdog backend. + description: DevStack plugin to configure Sheepdog backend. - project: stackforge/distil description: Rating Service for OpenStack acl-config: /home/gerrit2/acls/stackforge/distil.config @@ -1827,7 +1827,7 @@ - project: stackforge/dox description: Run tests in a docker container - project: stackforge/drbd-devstack - description: Devstack plugin to configure the DRBD backend. + description: DevStack plugin to configure the DRBD backend. - project: stackforge/driverlog description: Vendor drivers for OpenStack - project: stackforge/ec2-api @@ -2079,7 +2079,7 @@ - project: stackforge/fuel-plugin-tls groups: - 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 docimpact-group: fuel - project: stackforge/fuel-plugin-vmware-dvs diff --git a/tools/check_valid_gerrit_projects.py b/tools/check_valid_gerrit_projects.py index b1754f8813..1102f653cc 100755 --- a/tools/check_valid_gerrit_projects.py +++ b/tools/check_valid_gerrit_projects.py @@ -15,6 +15,7 @@ # limitations under the License. import argparse +import re import sys import yaml @@ -52,6 +53,25 @@ for p in projects: if args.verbose: print('Checking %s' % name) 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'(?