From 74cb2ea75ac4f477371e6c73e79899809c0011b1 Mon Sep 17 00:00:00 2001 From: Ralf Stephan Date: Fri, 9 May 2014 08:46:59 +0200 Subject: [PATCH 1/3] bail out if open dependency found --- src/patchbot.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/patchbot.py b/src/patchbot.py index 460d9c1..eff874a 100755 --- a/src/patchbot.py +++ b/src/patchbot.py @@ -389,8 +389,14 @@ def test_a_ticket(self, ticket=None): print "No more tickets." time.sleep(self.config['idle']) return - rating, ticket = ticket + if len(ticket['depends_on']) > 0: + for dep_id in ticket['depends_on']: + dep = self.lookup_ticket(dep_id) + if dep['status'] <> 'closed': + print "Ticket has open dependency. Ignoring..." + return + print "\n" * 2 print "=" * 30, ticket['id'], "=" * 30 print ticket['title'] From 814ae534526f6a1b5a53b5e2228089a08006dd9c Mon Sep 17 00:00:00 2001 From: Ralf Stephan Date: Fri, 9 May 2014 10:14:55 +0200 Subject: [PATCH 2/3] wait a sec between ticket pulls when checking for open deps --- src/patchbot.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/patchbot.py b/src/patchbot.py index eff874a..66216fe 100755 --- a/src/patchbot.py +++ b/src/patchbot.py @@ -392,6 +392,7 @@ def test_a_ticket(self, ticket=None): rating, ticket = ticket if len(ticket['depends_on']) > 0: for dep_id in ticket['depends_on']: + time.sleep(1) dep = self.lookup_ticket(dep_id) if dep['status'] <> 'closed': print "Ticket has open dependency. Ignoring..." From eec09aa20e27cc4ab1c8a1e97a581b87300be95e Mon Sep 17 00:00:00 2001 From: Ralf Stephan Date: Sun, 1 Jun 2014 08:29:38 +0200 Subject: [PATCH 3/3] also bail out when dependency status is unknown --- src/patchbot.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/patchbot.py b/src/patchbot.py index 66216fe..817f6a7 100755 --- a/src/patchbot.py +++ b/src/patchbot.py @@ -394,7 +394,7 @@ def test_a_ticket(self, ticket=None): for dep_id in ticket['depends_on']: time.sleep(1) dep = self.lookup_ticket(dep_id) - if dep['status'] <> 'closed': + if dep['status'] <> 'closed' and dep['status'] <> 'unknown': print "Ticket has open dependency. Ignoring..." return