diff --git a/README.md b/README.md index ddd9a1f..fc1cc85 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,12 @@ a valid YAML/JSON file formatted like this: projects: - name: dib-utils - name: diskimage-builder + - name: tripleo-heat-templates + launchpad_project: tripleo + - name: tripleo-image-elements + launchpad_project: tripleo + - name: tripleo-incubator + launchpad_project: tripleo ## License diff --git a/bin/reviewday b/bin/reviewday index 34df613..60d2cbf 100755 --- a/bin/reviewday +++ b/bin/reviewday @@ -74,12 +74,16 @@ PROJECTS = [ ] proj_names = PROJECTS +lp_projects = {} if options.project_file: if os.path.exists(options.project_file): with open(options.project_file) as cf: proj_names = [] for proj in yaml.load(cf.read()).get("projects"): - proj_names.append(proj['name']) + name = proj['name'] + proj_names.append(name) + if 'launchpad_project' in proj: + lp_projects[name] = proj['launchpad_project'] for project in proj_names: if project not in projects: diff --git a/reviewday/mergeprop.py b/reviewday/mergeprop.py index cc381e6..1084228 100644 --- a/reviewday/mergeprop.py +++ b/reviewday/mergeprop.py @@ -25,11 +25,11 @@ class MergeProp(object): # FIXME: bug.importance doesn't seem to work but it should? cause = '%s bugfix' % bug.bug_tasks[0].importance elif self.topic.find('bp/') == 0: - spec = lp.specification(self.project, self.topic[3:]) + spec = lp.specification(self.lp_proj_name, self.topic[3:]) if spec: cause = '%s feature' % spec.priority else: - spec = lp.specification(self.project, self.topic) + spec = lp.specification(self.lp_proj_name, self.topic) if spec: cause = '%s feature' % spec.priority except: @@ -52,11 +52,12 @@ class MergeProp(object): score = score + days_old_score return (cause, reason, score) - def __init__(self, lp, review, cur_timestamp): + def __init__(self, lp, review, cur_timestamp, launchpad_proj_name=None): self.owner_name = review['owner']['name'] self.url = '%s/#change,%s' % tuple(review['url'].rsplit('/', 1)) self.subject = review['subject'] self.project = review['project'][10:] + self.lp_proj_name = launchpad_proj_name or review['project'][10:] if 'topic' in review: self.topic = review['topic'] else: