From fc3b2e3d2676bd05c8559fd5374147d266ab8255 Mon Sep 17 00:00:00 2001 From: Ivaylo Ganchev Date: Thu, 17 Mar 2016 16:35:59 +0100 Subject: [PATCH 1/4] Modification of the ways labels are handled. With this modification they are saved into the labels field of the issues_ext_github database'. To be tested. --- bicho/backends/github.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bicho/backends/github.py b/bicho/backends/github.py index ef589ae..477878d 100644 --- a/bicho/backends/github.py +++ b/bicho/backends/github.py @@ -397,6 +397,10 @@ def analyze_bug(self, bug): issue = bug['id'] if bug['labels']: bug_type = bug['labels'][0]['name'] # FIXME + for i in range(0, len(bug['labels'])): + labels.append (bug['labels'][i]['name'] + self.set_labels(labels) + print labels else: bug_type = unicode('') summary = bug['title'] From fa3c76bef5f1a024712bb083e3d0bea5296fb39e Mon Sep 17 00:00:00 2001 From: Ivaylo Ganchev Date: Thu, 17 Mar 2016 16:35:59 +0100 Subject: [PATCH 2/4] Modification of the way labels are handled. With this modification they are saved into the 'labels' field of the 'issues_ext_github database' (and not the 'bug_type' field of the 'issues' table). Fixes #154. --- bicho/backends/github.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bicho/backends/github.py b/bicho/backends/github.py index ef589ae..477878d 100644 --- a/bicho/backends/github.py +++ b/bicho/backends/github.py @@ -397,6 +397,10 @@ def analyze_bug(self, bug): issue = bug['id'] if bug['labels']: bug_type = bug['labels'][0]['name'] # FIXME + for i in range(0, len(bug['labels'])): + labels.append (bug['labels'][i]['name'] + self.set_labels(labels) + print labels else: bug_type = unicode('') summary = bug['title'] From 0e6d9cd7b6269396198266cc7cc042abd7db45ae Mon Sep 17 00:00:00 2001 From: Ivaylo Ganchev Date: Fri, 1 Apr 2016 13:03:32 +0000 Subject: [PATCH 3/4] Completes the previous comit --- bicho/backends/github.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/bicho/backends/github.py b/bicho/backends/github.py index 477878d..f785e9c 100644 --- a/bicho/backends/github.py +++ b/bicho/backends/github.py @@ -394,15 +394,16 @@ def analyze_bug(self, bug): bug['updated_at'] + ' (ratelimit = ' + str(self.remaining_ratelimit) + ")") + bug_type = unicode('') # There is no bug type with Github. Some labels are used as bug type. issue = bug['id'] + labels_a = [] if bug['labels']: - bug_type = bug['labels'][0]['name'] # FIXME for i in range(0, len(bug['labels'])): - labels.append (bug['labels'][i]['name'] - self.set_labels(labels) - print labels + labels_a.append (bug['labels'][i]['name']) + labels=", ".join(labels_a) else: - bug_type = unicode('') + labels = unicode('') + printdbg(labels) summary = bug['title'] desc = bug['body'] submitted_by = self.__get_user(bug['user']['login']) @@ -422,6 +423,8 @@ def analyze_bug(self, bug): issue.set_description(bug['body']) issue.set_web_link(bug['html_url']) + issue.set_labels(labels) + try: if bug['closed_at']: issue.set_closed_at(self.__to_datetime(bug['closed_at'])) From 7c0f2030fd2db6108e1f8686d4e1be197dcc1410 Mon Sep 17 00:00:00 2001 From: Ivaylo Ganchev Date: Fri, 1 Apr 2016 13:06:52 +0000 Subject: [PATCH 4/4] Code clean (removing debug message from previous commit) --- bicho/backends/github.py | 1 - 1 file changed, 1 deletion(-) diff --git a/bicho/backends/github.py b/bicho/backends/github.py index f785e9c..77d1ae0 100644 --- a/bicho/backends/github.py +++ b/bicho/backends/github.py @@ -403,7 +403,6 @@ def analyze_bug(self, bug): labels=", ".join(labels_a) else: labels = unicode('') - printdbg(labels) summary = bug['title'] desc = bug['body'] submitted_by = self.__get_user(bug['user']['login'])