Merge "properly support private builds in the registry"

This commit is contained in:
Jenkins 2017-07-28 18:15:17 +00:00 committed by Gerrit Code Review
commit 8d3d915aa0
2 changed files with 5 additions and 1 deletions

View File

@ -64,7 +64,7 @@ class ModuleRegistry(object):
mapped to its plugin info dictionary.
"""
version = plugin_info.get('version', '0')
plugin_info['version'] = re.sub(r'(.*)-(?:SNAPSHOT|BETA)',
plugin_info['version'] = re.sub(r'(.*)-(?:SNAPSHOT|BETA).*',
r'\g<1>.preview', version)
aliases = []

View File

@ -24,6 +24,10 @@ class ModuleRegistryPluginInfoTestsWithScenarios(
('s11', dict(v1='1.0.preview', op='__lt__', v2='1.0')),
('s12', dict(v1='1.1-SNAPSHOT', op='__gt__', v2='1.0')),
('s13', dict(v1='1.0a-SNAPSHOT', op='__lt__', v2='1.0a')),
('s14', dict(v1='1.4.6-SNAPSHOT (private-0986edd9-example)',
op='__lt__', v2='1.4.6')),
('s15', dict(v1='1.4.6-SNAPSHOT (private-0986edd9-example)',
op='__gt__', v2='1.4.5')),
]
def setUp(self):