Multiple project groups.

Jeepyb now pulls all project groups listed in review.projects.yaml
to check for bugs or blueprints. This is to support multiple
project group membership in storyboard. If 'groups' is not found,
it will fallback to the legacy 'group' or the short project name,
wrapped in an array.

Change-Id: I5f6d09fce609f387b089840f3903303869f33767
This commit is contained in:
Michael Krotscheck 2014-08-04 12:53:27 -07:00
parent 872f72d2b8
commit 959a8a52e4
3 changed files with 19 additions and 8 deletions

View File

@ -68,11 +68,18 @@ DB_DB = GERRIT_CONFIG.get("database", "database")
def update_spec(launchpad, project, name, subject, link, topic=None): def update_spec(launchpad, project, name, subject, link, topic=None):
spec = None
if p.is_no_launchpad_blueprints(project): if p.is_no_launchpad_blueprints(project):
return return
project = p.project_to_group(project) projects = p.project_to_groups(project)
spec = launchpad.projects[project].getSpecification(name=name)
for project in projects:
spec = launchpad.projects[project].getSpecification(name=name)
if spec:
break
if not spec: if not spec:
return return

View File

@ -290,7 +290,7 @@ def find_bugs(launchpad, git_log, args):
if p.is_no_launchpad_bugs(project): if p.is_no_launchpad_bugs(project):
return [] return []
project = p.project_to_group(project) projects = p.project_to_groups(project)
part1 = r'^[\t ]*(?P<prefix>[-\w]+)?[\s:]*' part1 = r'^[\t ]*(?P<prefix>[-\w]+)?[\s:]*'
part2 = r'(?:\b(?:bug|lp)\b[\s#:]*)+' part2 = r'(?:\b(?:bug|lp)\b[\s#:]*)+'
@ -307,7 +307,7 @@ def find_bugs(launchpad, git_log, args):
try: try:
lp_bug = launchpad.bugs[bug_num] lp_bug = launchpad.bugs[bug_num]
for lp_task in lp_bug.bug_tasks: for lp_task in lp_bug.bug_tasks:
if lp_task.bug_target_name == project: if lp_task.bug_target_name in projects:
bugtasks[bug_num] = Task(lp_task, prefix) bugtasks[bug_num] = Task(lp_task, prefix)
break break
except KeyError: except KeyError:

View File

@ -18,6 +18,8 @@ Expected review.projects.yaml format:
- project: some/project - project: some/project
launchpad: awesomeproject launchpad: awesomeproject
description: Best project ever. description: Best project ever.
groups:
- awesome-group
options: options:
- direct-release - direct-release
- no-launchpad-bugs - no-launchpad-bugs
@ -30,10 +32,12 @@ import jeepyb.utils as u
registry = u.ProjectsRegistry() registry = u.ProjectsRegistry()
def project_to_group(project_full_name): def project_to_groups(project_full_name):
return registry[project_full_name].get( return registry[project_full_name] \
'group', registry[project_full_name].get( .get('groups',
'launchpad', u.short_project_name(project_full_name))) [registry[project_full_name].get('group',
u.short_project_name(
project_full_name))])
def _is_no_launchpad(project_full_name, obj_type): def _is_no_launchpad(project_full_name, obj_type):