[Tracker-discuss] [issue615] Set stage to 'patch review' when a PR is added

Berker Peksag metatracker at psf.upfronthosting.co.za
Mon Jul 24 10:18:49 EDT 2017


Berker Peksag added the comment:

Here's the second patch.

_______________________________________________________
PSF Meta Tracker <metatracker at psf.upfronthosting.co.za>
<http://psf.upfronthosting.co.za/roundup/meta/issue615>
_______________________________________________________
-------------- next part --------------
diff --git a/roundup/github.py b/roundup/github.py
--- a/roundup/github.py
+++ b/roundup/github.py
@@ -195,17 +195,23 @@ class Event(object):
             # create a new link
             if not title:
                 title = ""
             if not status:
                 status = ""
             newpr = self.db.pull_request.create(number=prid,
                 title=title.encode('utf-8'), status=status.encode('utf-8'))
             prs.append(newpr)
-            self.db.issue.set(id, pull_requests=prs)
+            patch_keyword = self.db.keyword.lookup('patch')
+            keywords = self.db.issue.get(id, 'keywords')
+            if patch_keyword not in keywords:
+                keywords.append(patch_keyword)
+            self.db.issue.set(id, pull_requests=prs,
+                              stage=self.db.stage.lookup('patch review'),
+                              keywords=keywords)
             self.db.commit()
 
     def handle_update(self, prid, title, status, issue_ids):
         """
         Helper method for updating GitHub pull request.
         """
         # update handles only title changes, for now
         if not title:


More information about the Tracker-discuss mailing list