rename python-server to python-service
The deliverable type value is 'service', so let's use that for consistency Change-Id: I7118b6737800921b72ab4637fe614de29167f0fa Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
parent
76b89d0466
commit
1016065aa6
@ -397,13 +397,13 @@ The top level of a deliverable file is a mapping with keys:
|
||||
``release-type``
|
||||
This (optional) key sets the level of validation for the versions numbers.
|
||||
|
||||
``python-server``
|
||||
``python-service``
|
||||
Default: Enforces 3 digit semver version numbers in releases and allows
|
||||
for common alpha, beta and dev releases. This should be appropriate for
|
||||
most OpenStack component release requirements.
|
||||
|
||||
``python-pypi``
|
||||
Like ``python-server`` but requires the jobs to publish the component
|
||||
Like ``python-service`` but requires the jobs to publish the component
|
||||
to the Python Package Index (PyPI).
|
||||
|
||||
``xstatic``
|
||||
|
@ -360,7 +360,7 @@ def get_release_type(deliverable_info, project, workdir):
|
||||
return ('python-pypi', False)
|
||||
|
||||
if deliverable_info.get('type') == 'service':
|
||||
return ('python-server', False)
|
||||
return ('python-service', False)
|
||||
|
||||
if deliverable_info.get('include-pypi-link', False):
|
||||
return ('python-pypi', False)
|
||||
@ -371,7 +371,7 @@ def get_release_type(deliverable_info, project, workdir):
|
||||
if npmutils.looks_like_a_module(workdir, project['repo']):
|
||||
return ('nodejs', False)
|
||||
|
||||
return ('python-server', False)
|
||||
return ('python-service', False)
|
||||
|
||||
|
||||
def validate_release_type(deliverable_info,
|
||||
|
@ -81,7 +81,7 @@ def get_zuul_project_data(url=ZUUL_PROJECTS_URL):
|
||||
|
||||
# Which jobs are needed for which release types.
|
||||
_RELEASE_JOBS_FOR_TYPE = {
|
||||
'python-server': [
|
||||
'python-service': [
|
||||
'release-openstack-server',
|
||||
],
|
||||
'python-pypi': [
|
||||
@ -142,7 +142,7 @@ def require_release_jobs_for_repo(deliverable_info, zuul_projects, repo,
|
||||
# jobs, because we want projects to use the templates.
|
||||
expected_jobs = _RELEASE_JOBS_FOR_TYPE.get(
|
||||
release_type,
|
||||
_RELEASE_JOBS_FOR_TYPE['python-server'],
|
||||
_RELEASE_JOBS_FOR_TYPE['python-service'],
|
||||
)
|
||||
if expected_jobs:
|
||||
found_jobs = [
|
||||
|
@ -35,7 +35,7 @@ properties:
|
||||
type: "object"
|
||||
release-type:
|
||||
type: "string"
|
||||
enum: [ "python-server", "python-pypi", "xstatic", "fuel",
|
||||
enum: [ "python-service", "python-pypi", "xstatic", "fuel",
|
||||
"nodejs", "puppet", "neutron", "horizon" ]
|
||||
stable-branch-type:
|
||||
type: "string"
|
||||
|
@ -823,10 +823,10 @@ class TestGetReleaseType(base.BaseTestCase):
|
||||
)
|
||||
self.assertEqual(('python-pypi', False), (release_type, explicit))
|
||||
|
||||
def test_server(self):
|
||||
def test_service(self):
|
||||
deliverable_info = {
|
||||
'artifact-link-mode': 'none',
|
||||
'type': 'server',
|
||||
'type': 'service',
|
||||
'releases': [
|
||||
{'version': '99.1.0',
|
||||
'projects': [
|
||||
@ -840,7 +840,7 @@ class TestGetReleaseType(base.BaseTestCase):
|
||||
deliverable_info['releases'][0]['projects'][0],
|
||||
self.tmpdir,
|
||||
)
|
||||
self.assertEqual(('python-server', False), (release_type, explicit))
|
||||
self.assertEqual(('python-service', False), (release_type, explicit))
|
||||
|
||||
def test_implicit_pypi(self):
|
||||
deliverable_info = {
|
||||
@ -878,7 +878,7 @@ class TestGetReleaseType(base.BaseTestCase):
|
||||
deliverable_info['releases'][0]['projects'][0],
|
||||
self.tmpdir,
|
||||
)
|
||||
self.assertEqual(('python-server', False), (release_type, explicit))
|
||||
self.assertEqual(('python-service', False), (release_type, explicit))
|
||||
|
||||
@mock.patch('openstack_releases.puppetutils.looks_like_a_module')
|
||||
def test_puppet(self, llam):
|
||||
@ -940,7 +940,7 @@ class TestGetReleaseType(base.BaseTestCase):
|
||||
deliverable_info['releases'][0]['projects'][0],
|
||||
self.tmpdir,
|
||||
)
|
||||
self.assertEqual(('python-server', False), (release_type, explicit))
|
||||
self.assertEqual(('python-service', False), (release_type, explicit))
|
||||
|
||||
|
||||
class TestPuppetUtils(base.BaseTestCase):
|
||||
|
@ -26,23 +26,23 @@ import pbr.version
|
||||
# 3. canonicalise: The function used to canonicalise the *Version object.
|
||||
# Used to verify that the version string is already in the
|
||||
# canonical form
|
||||
_VALIDATORS = {'python-server': (pbr.version.SemanticVersion.from_pip_string,
|
||||
ValueError,
|
||||
lambda x: x.release_string()),
|
||||
_VALIDATORS = {'python-service': (pbr.version.SemanticVersion.from_pip_string,
|
||||
ValueError,
|
||||
lambda x: x.release_string()),
|
||||
'xstatic': (packaging.version.Version,
|
||||
packaging.version.InvalidVersion,
|
||||
lambda x: str(x)),
|
||||
}
|
||||
_VALIDATORS['fuel'] = _VALIDATORS['python-server']
|
||||
_VALIDATORS['openstack-manuals'] = _VALIDATORS['python-server']
|
||||
_VALIDATORS['puppet'] = _VALIDATORS['python-server']
|
||||
_VALIDATORS['nodejs'] = _VALIDATORS['python-server']
|
||||
_VALIDATORS['neutron'] = _VALIDATORS['python-server']
|
||||
_VALIDATORS['horizon'] = _VALIDATORS['python-server']
|
||||
_VALIDATORS['python-pypi'] = _VALIDATORS['python-server']
|
||||
_VALIDATORS['fuel'] = _VALIDATORS['python-service']
|
||||
_VALIDATORS['openstack-manuals'] = _VALIDATORS['python-service']
|
||||
_VALIDATORS['puppet'] = _VALIDATORS['python-service']
|
||||
_VALIDATORS['nodejs'] = _VALIDATORS['python-service']
|
||||
_VALIDATORS['neutron'] = _VALIDATORS['python-service']
|
||||
_VALIDATORS['horizon'] = _VALIDATORS['python-service']
|
||||
_VALIDATORS['python-pypi'] = _VALIDATORS['python-service']
|
||||
|
||||
|
||||
def validate_version(versionstr, release_type='python-server', pre_ok=True):
|
||||
def validate_version(versionstr, release_type='python-service', pre_ok=True):
|
||||
"""Given a version string, yield error messages if it is "bad"
|
||||
|
||||
Apply our SemVer rules to version strings and report all issues.
|
||||
@ -55,8 +55,8 @@ def validate_version(versionstr, release_type='python-server', pre_ok=True):
|
||||
'model does not allow for it' % versionstr)
|
||||
|
||||
if release_type not in _VALIDATORS:
|
||||
yield 'Release Type %r not valid using \'python-server\' instead' % release_type
|
||||
release_type = 'python-server'
|
||||
yield 'Release Type %r not valid using \'python-service\' instead' % release_type
|
||||
release_type = 'python-service'
|
||||
|
||||
constructor, exception, canonicalise = _VALIDATORS[release_type]
|
||||
try:
|
||||
@ -71,7 +71,7 @@ def validate_version(versionstr, release_type='python-server', pre_ok=True):
|
||||
(versionstr, canonical)
|
||||
|
||||
|
||||
def canonical_version(versionstr, release_type='python-server'):
|
||||
def canonical_version(versionstr, release_type='python-service'):
|
||||
"""Given a version string verify it is in the canonical form."""
|
||||
errors = list(validate_version(versionstr, release_type))
|
||||
if errors:
|
||||
|
Loading…
Reference in New Issue
Block a user