[Tracker-discuss] [issue363] auto-nosy release manager(s) on release blockers

Ezio Melotti metatracker at psf.upfronthosting.co.za
Wed Dec 15 04:00:58 CET 2010


Ezio Melotti <ezio.melotti at gmail.com> added the comment:

I committed the patch with a couple of changes in r87253 using the user ids instead of the names.
I then further improved the patch in r87257 to also check the previous values when they are not changed, so, if the version is already set to e.g. 3.2 and the priority is changed to release blocker (and vice versa -- priority already set to release blocker and 3.2 added), the 3.2 release manager will be added anyway. Finally I fixed a bug in r87259 that gave an error message when the priority was not set.
Attached a diff of all these changes

----------
assignedto:  -> ezio.melotti
nosy: +ezio.melotti
status: chatting -> resolved

_______________________________________________________
PSF Meta Tracker <metatracker at psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue363>
_______________________________________________________
-------------- next part --------------
Index: instances/python-dev/detectors/autonosy.py
===================================================================
--- instances/python-dev/detectors/autonosy.py	(revision 87250)
+++ instances/python-dev/detectors/autonosy.py	(revision 87259)
@@ -4,14 +4,16 @@
 # 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):
+    components = newvalues.get('components', [])
 
-    if 'components' not in newvalues:
-        # Without components, nobody needs to be added as nosy
-        return
-    else:
-        components = newvalues['components']
-
     nosy = set()
     if 'nosy' in newvalues:
         new_nosy = newvalues.get('nosy', [])
@@ -26,6 +28,25 @@
         users = db.component.get(component, 'add_as_nosy')
         nosy |= set(users)
 
+    # get the new values if they changed or the already-set ones if they didn't
+    priority = 'None'
+    if 'priority' in newvalues:
+        priority_id = newvalues['priority']
+    else:
+        priority_id = db.issue.get(nodeid, 'priority')
+    if priority_id is not None:
+        priority = db.priority.get(priority_id, 'name')
+    if 'versions' in newvalues:
+        versions = newvalues.get('versions', [])
+    else:
+        versions = db.issue.get(nodeid, 'versions')
+
+    if priority == 'release blocker':
+        for version in 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 Tracker-discuss mailing list