Exclude all projects that start with "deb-"

This code fixes a wrong behavior when commits are
counted under deb-<project> instead of just <project>.
This was partially fixed for official projects with a
temporary workaround, but we need to exlude all projects.
For example, for 'glare' commits still go to 'deb-glare'
repo.

Closes-bug: #1625060

Change-Id: I669d1fdee25f1d9c141006d930f3d45dbd3310c5
This commit is contained in:
Mike Fedosin 2017-06-23 23:58:20 +03:00
parent 084db0ff00
commit 90ce9b362f
3 changed files with 8 additions and 6 deletions

View File

@ -158,8 +158,9 @@ def _update_project_list(default_data):
repos = _retrieve_project_list_from_sources(
default_data['project_sources'])
if repos:
# update pre-configured
repos_dict = dict((r['uri'], r) for r in repos)
# update pre-configured and exclude all projects start with 'deb-'
repos_dict = dict((r['uri'], r) for r in repos
if not r['module'].startswith('deb-'))
for r in default_data['repos']:
if r['uri'] in repos_dict:
for k, v in repos_dict[r['uri']].items():

View File

@ -76,10 +76,6 @@ def read_big_tent_projects_yaml(module_groups, release_name, content):
mn = repo_split[1] # module_name
# todo (ishakhat): temporary ban all deb-* projects
if mn.startswith('deb-'):
continue
module_groups[group_id]['modules'].add(mn)
all_official['releases'][release_name].add(mn)

View File

@ -67,6 +67,9 @@ class TestDefaultDataProcessor(testtools.TestCase):
{'module': 'qa', 'uri': 'git://git.openstack.org/openstack/qa',
'has_gerrit': True,
'organization': 'openstack'},
{'module': 'deb-nova',
'uri': 'git://git.openstack.org/openstack/deb-nova',
'organization': 'openstack'},
]
dd = {
'repos': [
@ -87,6 +90,8 @@ class TestDefaultDataProcessor(testtools.TestCase):
self.assertEqual(3, len(dd['repos']))
self.assertIn('qa', set([r['module'] for r in dd['repos']]))
self.assertIn('nova', set([r['module'] for r in dd['repos']]))
self.assertNotIn('deb-nova',
set([r['module'] for r in dd['repos']]))
self.assertIn('tux', set([r['module'] for r in dd['repos']]))
self.assertIn('has_gerrit', dd['repos'][0])