Merge "sort version numbers as we display them"

This commit is contained in:
Jenkins 2016-05-23 15:05:15 +00:00 committed by Gerrit Code Review
commit a46dd9651d
3 changed files with 34 additions and 9 deletions

View File

@ -12,14 +12,14 @@ Requesting a Release
====================
The PTL or release liaison for a project may request a release from
master by submitting a patch to this repository, adding the necessary
master by submitting a patch to this repository, appending the necessary
release metadata to the file describing the deliverable to be
released. The release team will review the request and provide
feedback about the version number.
The stable maintenance team, PTL, or release liaison for a project may
request a release from a stable branch by submitting a patch to this
repository, adding the necessary release metadata to the file
repository, appending the necessary release metadata to the file
describing the deliverable to be released. The release team will
review the request and provide feedback about the version number. If
the stable release is requested by the stable maintenance team, it
@ -29,6 +29,9 @@ the development team is aware of the coming change.
Prepare the release request by submitting a patch to this
repository.
* Always add the new release to the end of the file being edited. The
version numbers will be reordered for display.
* Set the first line (summary) of the commit message to the package
name and version being requested.
@ -124,7 +127,7 @@ Deliverable repositories for projects tagged with
release:cycle_with_intermediatry or release:cycle_with_milestones
should be placed in their respective releases within the
deliverables directory. Deliverable repositories for projects tagged with
release:indepedent should be placed in the deliverables/_independent
release:indepedent should be placed in the ``deliverables/_independent``
directory. Deliverable repositories tagged with release:none have no
release and are not tracked in this repository.

View File

@ -12,10 +12,6 @@ releases:
projects:
- repo: openstack/openstack-ansible
hash: 4981ed929613d6ad448dc9b566b458c85491c5f7
- version: 11.2.16
projects:
- repo: openstack/openstack-ansible
hash: ac7b2d68433f9560a5d401f846349c2e37751f0f
- version: 12.0.11
projects:
- repo: openstack/openstack-ansible
@ -210,3 +206,7 @@ releases:
hash: 5d938cffa73b65503e4d06494e4bb4b5ea7cb5a9
- repo: openstack/openstack-ansible-rsyslog_server
hash: 5a3e325088891f5ea86223dfddb23e74da089c6c
- version: 11.2.16
projects:
- repo: openstack/openstack-ansible
hash: ac7b2d68433f9560a5d401f846349c2e37751f0f

View File

@ -21,7 +21,7 @@ from docutils import nodes
from docutils.parsers import rst
from docutils.parsers.rst import directives
from docutils.statemachine import ViewList
import pbr
import pbr.version
from sphinx.util.nodes import nested_parse_with_titles
import yaml
@ -71,16 +71,38 @@ def _get_deliverable_type(deliverable_types, name):
return 'type:other'
def _version_sort_key(release):
"""Return a value we can compare for sorting.
We can't just use SemanticVersion instances because some of the
legacy tags don't comply with the parser. Use a tuple of the parts
of the version string, converted to integers where possible to
avoid weird alphabetical sorting of numbers.
"""
key = []
for p in str(release['version']).split('.'):
try:
key.append(int(p))
except ValueError:
key.append(p)
return tuple(key)
def _collapse_deliverable_history(app, name, info):
"""Collapse pre-releases into their final release.
Edit the info dictionary in place.
"""
sorted_releases = sorted(
info.get('releases', []),
key=_version_sort_key,
)
# Collapse pre-releases into their final release.
releases = []
known_versions = set()
for r in reversed(info.get('releases', [])):
for r in reversed(sorted_releases):
try:
parsed_vers = pbr.version.SemanticVersion.from_pip_string(
str(r['version']))