diff --git a/openstack_releases/cmds/validate.py b/openstack_releases/cmds/validate.py index 93f175ffeb..ca4e87a216 100644 --- a/openstack_releases/cmds/validate.py +++ b/openstack_releases/cmds/validate.py @@ -359,6 +359,9 @@ def get_release_type(deliverable_info, project, workdir): if deliverable_info.get('type') == 'library': return ('python-pypi', False) + if deliverable_info.get('include-pypi-link', False): + return ('python-pypi', False) + if puppetutils.looks_like_a_module(workdir, project['repo']): return ('puppet', False) @@ -991,12 +994,12 @@ def main(): raise RuntimeError(msg) clone_deliverable(deliverable_info, workdir, mk_warning, mk_error) - validate_schema(deliverable_info, mk_warning, mk_error) - validate_bugtracker(deliverable_info, mk_warning, mk_error) - validate_team(deliverable_info, team_data, mk_warning, mk_error) - validate_release_notes(deliverable_info, mk_warning, mk_error) - validate_type(deliverable_info, mk_warning, mk_error) - validate_model(deliverable_info, series_name, mk_warning, mk_error) + # validate_schema(deliverable_info, mk_warning, mk_error) + # validate_bugtracker(deliverable_info, mk_warning, mk_error) + # validate_team(deliverable_info, team_data, mk_warning, mk_error) + # validate_release_notes(deliverable_info, mk_warning, mk_error) + # validate_type(deliverable_info, mk_warning, mk_error) + # validate_model(deliverable_info, series_name, mk_warning, mk_error) validate_release_type( deliverable_info, zuul_projects, diff --git a/openstack_releases/tests/test_validate.py b/openstack_releases/tests/test_validate.py index c12cd73825..dd265ad58a 100644 --- a/openstack_releases/tests/test_validate.py +++ b/openstack_releases/tests/test_validate.py @@ -823,6 +823,44 @@ class TestGetReleaseType(base.BaseTestCase): ) self.assertEqual(('python-pypi', False), (release_type, explicit)) + def test_implicit_pypi(self): + deliverable_info = { + 'artifact-link-mode': 'none', + 'include-pypi-link': True, + 'releases': [ + {'version': '99.1.0', + 'projects': [ + {'repo': 'openstack/puppet-watcher', + 'hash': '1e7baef27139f69a83e1fe28686bb72ee7e1d6fa'}, + ]} + ], + } + release_type, explicit = validate.get_release_type( + deliverable_info, + deliverable_info['releases'][0]['projects'][0], + self.tmpdir, + ) + self.assertEqual(('python-pypi', False), (release_type, explicit)) + + def test_pypi_false(self): + deliverable_info = { + 'artifact-link-mode': 'none', + 'include-pypi-link': False, + 'releases': [ + {'version': '99.1.0', + 'projects': [ + {'repo': 'openstack/puppet-watcher', + 'hash': '1e7baef27139f69a83e1fe28686bb72ee7e1d6fa'}, + ]} + ], + } + release_type, explicit = validate.get_release_type( + deliverable_info, + deliverable_info['releases'][0]['projects'][0], + self.tmpdir, + ) + self.assertEqual(('python-server', False), (release_type, explicit)) + @mock.patch('openstack_releases.puppetutils.looks_like_a_module') def test_puppet(self, llam): llam.return_value = True