[MediaWiki-commits] [Gerrit] Implementing satus mapping and severity mapping based on [1]... - change (pywikibot/sf-export)
Ladsgroup has submitted this change and it was merged. Change subject: Implementing satus mapping and severity mapping based on [1] [2] [3] [4] .. Implementing satus mapping and severity mapping based on [1] [2] [3] [4] [1] https://www.mediawiki.org/wiki/Bug_management/Bug_report_life_cycle [2] http://www.bugzilla.org/docs/3.6/en/html/api/Bugzilla/WebService/Bug.html [3] https://sourceforge.net/rest/p/pywikipediabot/feature-requests/347/ [4] https://sourceforge.net/rest/p/pywikipediabot/bugs/1669/ Change-Id: I4d51c2f3219484db0e090f8484b89d2e65f3fdcd --- M bz.py M sf.py 2 files changed, 15 insertions(+), 2 deletions(-) Approvals: Ladsgroup: Verified Merlijn van Deen: Looks good to me, approved diff --git a/bz.py b/bz.py index 7bf3a0e..47840c6 100644 --- a/bz.py +++ b/bz.py @@ -23,8 +23,10 @@ 'summary': ticket.summary(), 'version': '', # ??? 'description': ticket.export(), -'status': '', # Need to map this +'status': find_status(ticket), # Need to map this } +if ticket.group == 'feature-requests': +params['severity'] = 'Enhancement' logging.info('Uploading {0} to Bugzilla'.format(ticket.human_url())) bug = BZ.createbug(**params) @@ -58,7 +60,10 @@ content_type='text/plain' # python-bugzilla says we need to do this ) - +def find_status(ticket): +if ticket.owner(): +return ASSIGNED +return NEW def find_valid_component(labels): Modified slightly from Amir's list... diff --git a/sf.py b/sf.py index b1051a1..5b60f6f 100644 --- a/sf.py +++ b/sf.py @@ -77,6 +77,14 @@ def summary(self): return self.json['ticket']['summary'] +def status(self): +return self.json['ticket']['status'] + +def owner(self): +if self.json['ticket']['assigned_to_id'] == null: +return None +return self.json['ticket']['assigned_to_id'] + def comments(self): for cmt in self.json['ticket']['discussion_thread']['posts']: yield cmt['text'] -- To view, visit https://gerrit.wikimedia.org/r/83419 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I4d51c2f3219484db0e090f8484b89d2e65f3fdcd Gerrit-PatchSet: 2 Gerrit-Project: pywikibot/sf-export Gerrit-Branch: master Gerrit-Owner: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Ladsgroup ladsgr...@gmail.com Gerrit-Reviewer: Legoktm legoktm.wikipe...@gmail.com Gerrit-Reviewer: Merlijn van Deen valhall...@arctus.nl ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Implementing satus mapping and severity mapping based on [1]... - change (pywikibot/sf-export)
Ladsgroup has uploaded a new change for review. https://gerrit.wikimedia.org/r/83419 Change subject: Implementing satus mapping and severity mapping based on [1] [2] [3] [4] .. Implementing satus mapping and severity mapping based on [1] [2] [3] [4] [1] https://www.mediawiki.org/wiki/Bug_management/Bug_report_life_cycle [2] http://www.bugzilla.org/docs/3.6/en/html/api/Bugzilla/WebService/Bug.html [3] https://sourceforge.net/rest/p/pywikipediabot/feature-requests/347/ [4] https://sourceforge.net/rest/p/pywikipediabot/bugs/1669/ Change-Id: I4d51c2f3219484db0e090f8484b89d2e65f3fdcd --- M bz.py M sf.py 2 files changed, 16 insertions(+), 2 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/pywikibot/sf-export refs/changes/19/83419/1 diff --git a/bz.py b/bz.py index 7bf3a0e..8dc8399 100644 --- a/bz.py +++ b/bz.py @@ -23,8 +23,10 @@ 'summary': ticket.summary(), 'version': '', # ??? 'description': ticket.export(), -'status': '', # Need to map this +'status': finds_status(ticket), # Need to map this } +if ticket.group == 'feature-requests': +params['severity'] = 'Enhancement' logging.info('Uploading {0} to Bugzilla'.format(ticket.human_url())) bug = BZ.createbug(**params) @@ -58,7 +60,11 @@ content_type='text/plain' # python-bugzilla says we need to do this ) - +def find_status(ticket): +if ticket.owner(): +return ASSIGNED +sfstatus = ticket.status() +return NEW def find_valid_component(labels): Modified slightly from Amir's list... diff --git a/sf.py b/sf.py index b1051a1..5b60f6f 100644 --- a/sf.py +++ b/sf.py @@ -77,6 +77,14 @@ def summary(self): return self.json['ticket']['summary'] +def status(self): +return self.json['ticket']['status'] + +def owner(self): +if self.json['ticket']['assigned_to_id'] == null: +return None +return self.json['ticket']['assigned_to_id'] + def comments(self): for cmt in self.json['ticket']['discussion_thread']['posts']: yield cmt['text'] -- To view, visit https://gerrit.wikimedia.org/r/83419 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I4d51c2f3219484db0e090f8484b89d2e65f3fdcd Gerrit-PatchSet: 1 Gerrit-Project: pywikibot/sf-export Gerrit-Branch: master Gerrit-Owner: Ladsgroup ladsgr...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits