Commits

ezio.melotti  committed 8a06766

#363: add automatically release managers to the nosy list for release blockers. Initial patch by Georg Brandl.

  • Participants
  • Parent commits e8a74ce

Comments (0)

Files changed (1)

File detectors/autonosy.py

 # Python 2.3 ... 2.6 compatibility:
 from roundup.anypy.sets_ import set
 
+RELEASE_MANAGERS = {
+    'Python 2.6': '19',   # barry
+    'Python 2.7': '4455', # benjamin.peterson
+    'Python 3.1': '4455', # benjamin.peterson
+    'Python 3.2': '93',   # georg.brandl
+}
+
 def autonosy(db, cl, nodeid, newvalues):
-
-    if 'components' not in newvalues:
-        # Without components, nobody needs to be added as nosy
-        return
-    else:
-        components = newvalues['components']
+    components = newvalues.get('components', [])
 
     nosy = set()
     if 'nosy' in newvalues:
         users = db.component.get(component, 'add_as_nosy')
         nosy |= set(users)
 
+    if 'priority' in newvalues:
+        if db.priority.get(newvalues['priority'], 'name') == 'release blocker':
+            for version in db.issue.get(nodeid, 'versions'):
+                name = db.version.get(version, 'name')
+                if name in RELEASE_MANAGERS:
+                    nosy.add(RELEASE_MANAGERS[name])
+
     newvalues['nosy'] = list(nosy)