def test_read_official_projects_yaml(self, read_uri):
        read_uri.return_value = SAMPLE

        expected = {
            "sahara-group": {
                "id": "sahara-group",
                "module_group_name": "Sahara Official",
                "modules": [
                    "python-saharaclient",
                    "sahara",
                    "sahara-dashboard",
                    "sahara-extra",
                    "sahara-image-elements",
                    "sahara-specs",
                ],
                "tag": "program",
            },
            "tc-approved-release": {
                "id": "tc-approved-release",
                "module_group_name": "tc-approved-release",
                "modules": ["sahara", "sahara-extra", "sahara-image-elements"],
                "tag": "project_type",
            },
            "type:library": {
                "id": "type:library",
                "module_group_name": "type:library",
                "modules": ["python-saharaclient", "sahara-dashboard"],
                "tag": "project_type",
            },
            "type:service": {
                "id": "type:service",
                "module_group_name": "type:service",
                "modules": ["sahara", "sahara-extra", "sahara-image-elements"],
                "tag": "project_type",
            },
            "openstack-official": {
                "id": "openstack-official",
                "module_group_name": "openstack-official",
                "modules": [
                    "python-saharaclient",
                    "sahara",
                    "sahara-dashboard",
                    "sahara-extra",
                    "sahara-image-elements",
                    "sahara-specs",
                ],
                "tag": "project_type",
            },
        }

        actual = governance.read_projects_yaml("uri")

        self.assertEqual(expected, actual)
    def test_read_official_projects_yaml(self, read_uri):
        read_uri.return_value = SAMPLE

        expected = {
            'sahara-group': {
                'id':
                'sahara-group',
                'module_group_name':
                'Sahara Official',
                'modules': [
                    'python-saharaclient', 'sahara', 'sahara-dashboard',
                    'sahara-extra', 'sahara-image-elements', 'sahara-specs'
                ],
                'tag':
                'program'
            },
            'tc-approved-release': {
                'id': 'tc-approved-release',
                'module_group_name': 'tc-approved-release',
                'modules': ['sahara', 'sahara-extra', 'sahara-image-elements'],
                'tag': 'project_type'
            },
            'type:library': {
                'id': 'type:library',
                'module_group_name': 'type:library',
                'modules': ['python-saharaclient', 'sahara-dashboard'],
                'tag': 'project_type'
            },
            'type:service': {
                'id': 'type:service',
                'module_group_name': 'type:service',
                'modules': ['sahara', 'sahara-extra', 'sahara-image-elements'],
                'tag': 'project_type'
            },
            'openstack-official': {
                'id':
                'openstack-official',
                'module_group_name':
                'openstack-official',
                'modules': [
                    'python-saharaclient', 'sahara', 'sahara-dashboard',
                    'sahara-extra', 'sahara-image-elements', 'sahara-specs'
                ],
                'tag':
                'project_type'
            },
        }

        actual = governance.read_projects_yaml('uri')

        self.assertEqual(expected, actual)
示例#3
0
def process_project_list(runtime_storage_inst, project_list_uri):
    module_groups = runtime_storage_inst.get_by_key("module_groups") or {}

    official_module_groups = governance.read_projects_yaml(project_list_uri)
    LOG.debug("Update module groups with official: %s", official_module_groups)
    module_groups.update(official_module_groups)

    # register modules as module groups
    repos = runtime_storage_inst.get_by_key("repos") or []
    for repo in repos:
        module = repo["module"]
        module_groups[module] = utils.make_module_group(module, tag="module")

    # register module 'unknown' - used for emails not mapped to any module
    module_groups["unknown"] = utils.make_module_group("unknown", tag="module")

    runtime_storage_inst.set_by_key("module_groups", module_groups)
示例#4
0
def process_project_list(runtime_storage_inst, project_list_uri):
    module_groups = runtime_storage_inst.get_by_key('module_groups') or {}

    official_module_groups = governance.read_projects_yaml(project_list_uri)
    LOG.debug('Update module groups with official: %s', official_module_groups)
    module_groups.update(official_module_groups)

    # register modules as module groups
    repos = runtime_storage_inst.get_by_key('repos') or []
    for repo in repos:
        module = repo['module']
        module_groups[module] = utils.make_module_group(module, tag='module')

    # register module 'unknown' - used for emails not mapped to any module
    module_groups['unknown'] = utils.make_module_group('unknown', tag='module')

    runtime_storage_inst.set_by_key('module_groups', module_groups)
示例#5
0
def process_project_list(runtime_storage_inst, project_list_uri):
    module_groups = runtime_storage_inst.get_by_key('module_groups') or {}

    official_module_groups = governance.read_projects_yaml(project_list_uri)
    LOG.debug('Update module groups with official: %s', official_module_groups)
    module_groups.update(official_module_groups)

    # register modules as module groups
    repos = runtime_storage_inst.get_by_key('repos') or []
    for repo in repos:
        module = repo['module']
        module_groups[module] = utils.make_module_group(module, tag='module')

    # register module 'unknown' - used for emails not mapped to any module
    module_groups['unknown'] = utils.make_module_group('unknown', tag='module')

    runtime_storage_inst.set_by_key('module_groups', module_groups)