[Python-checkins] r87253 - tracker/instances/python-dev/detectors/autonosy.py

ezio.melotti python-checkins at python.org
Wed Dec 15 01:53:37 CET 2010


Author: ezio.melotti
Date: Wed Dec 15 01:53:37 2010
New Revision: 87253

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

Modified:
   tracker/instances/python-dev/detectors/autonosy.py

Modified: tracker/instances/python-dev/detectors/autonosy.py
==============================================================================
--- tracker/instances/python-dev/detectors/autonosy.py	(original)
+++ tracker/instances/python-dev/detectors/autonosy.py	Wed Dec 15 01:53:37 2010
@@ -4,13 +4,15 @@
 # Python 2.3 ... 2.6 compatibility:
 from roundup.anypy.sets_ import set
 
-def autonosy(db, cl, nodeid, newvalues):
+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
+}
 
-    if 'components' not in newvalues:
-        # Without components, nobody needs to be added as nosy
-        return
-    else:
-        components = newvalues['components']
+def autonosy(db, cl, nodeid, newvalues):
+    components = newvalues.get('components', [])
 
     nosy = set()
     if 'nosy' in newvalues:
@@ -26,6 +28,13 @@
         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)
 
 


More information about the Python-checkins mailing list