From 1392fa23d67fb261da1008e45a4f0b9192cef8fb Mon Sep 17 00:00:00 2001 From: Doug Hellmann Date: Wed, 9 Nov 2016 15:59:17 -0500 Subject: [PATCH] move deliverable type into deliverable files The deliverable type is really only used to control how the releases.openstack.org website is rendered, so it does not need to be in the governance repository. Copy the current values here to a new 'type' field in the deliverable file and update the validator to require all deliverable files to have values. Change-Id: I0def1117b45170ebf451ef510917db9c20301e17 Signed-off-by: Doug Hellmann --- README.rst | 5 +++ doc/source/reference/deliverable_types.rst | 44 ++++++++++++++++++++++ openstack_releases/cmds/validate.py | 19 ++++++++++ openstack_releases/governance.py | 2 +- 4 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 doc/source/reference/deliverable_types.rst diff --git a/README.rst b/README.rst index 26bcfe2fa3..04c191f5b9 100644 --- a/README.rst +++ b/README.rst @@ -216,6 +216,11 @@ The top level of a deliverable file is a mapping with keys: the reference section of the documentation for descriptions of the valid models. +``type`` + Categorize the deliverable based on what it does. See the reference + section of the documentation for descriptions of the valid + deliverable types. + ``artifact-link-mode`` Describe how to link to artifacts produced by the project. The default is ``tarball`. Valid values are: diff --git a/doc/source/reference/deliverable_types.rst b/doc/source/reference/deliverable_types.rst new file mode 100644 index 0000000000..9f65dd9128 --- /dev/null +++ b/doc/source/reference/deliverable_types.rst @@ -0,0 +1,44 @@ +=================== + Deliverable Types +=================== + +.. _`type-horizon-plugin`: + +horizon-plugin +============== + +This deliverable type indicates that a deliverable is meant to be +consumed by Horizon as a plug-in, to provide an integrated web UI for +a given project. + +* The repository contains code meant to be dynamically loaded by + OpenStack Horizon to provide UI to specific projects. + +.. _`type-library`: + +library +======= + +This deliverable type indicates that a project is a library, +middleware, client, or other piece of software that is used to build +another project and does not, by itself, provide a long-running +service or stand-alone tool. + +* The repository contains software used as a library for the loose and + commonly-understood definition of "library". + +.. _`type-service`: + +service +======= + +This deliverable type indicates that a project provides a user-facing +long-running service with a REST API. + +.. _`type-other`: + +other +===== + +Deliverables without a more specific categorization are listed as +``other``. diff --git a/openstack_releases/cmds/validate.py b/openstack_releases/cmds/validate.py index 54aab947e9..db66826f71 100644 --- a/openstack_releases/cmds/validate.py +++ b/openstack_releases/cmds/validate.py @@ -47,6 +47,12 @@ _VALID_MODELS = set([ 'cycle-trailing', 'independent', ]) +_VALID_TYPES = set([ + 'horizon-plugin', + 'library', + 'service', + 'other', +]) def is_a_hash(val): @@ -184,6 +190,19 @@ def main(): (release_model, filename, sorted(list(_VALID_MODELS))) ) + # Determine the deliverable type. Require an explicit value. + deliverable_type = deliverable_info.get('type') + if not deliverable_type: + errors.append( + 'No deliverable type for %s, must be one of %r' % + (filename, sorted(list(_VALID_TYPES))) + ) + elif deliverable_type not in _VALID_TYPES: + errors.append( + 'Invalid deliverable type %r for %s, must be one of %r' % + (deliverable_type, filename, sorted(list(_VALID_TYPES))) + ) + # Remember which entries are new so we can verify that they # appear at the end of the file. new_releases = {} diff --git a/openstack_releases/governance.py b/openstack_releases/governance.py index 96085f0853..5284bbbe5e 100644 --- a/openstack_releases/governance.py +++ b/openstack_releases/governance.py @@ -84,7 +84,7 @@ class Deliverable(object): for t in self.tags: if t.startswith('type:'): return t.partition(':')[-1] - return 'unknown' + return 'other' @property def model(self):