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 <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2016-11-09 15:59:17 -05:00
parent 2f24a51f6b
commit 1392fa23d6
4 changed files with 69 additions and 1 deletions

View File

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

View File

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

View File

@ -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 = {}

View File

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