def compare(self, bugs, dups): # each bug in bugs is the dup of one in dups # so the characteristics of this bug should be in the dup signatures = {} pcs = {} for bugid, info in bugs.items(): dupid = info['dupe'] if dupid not in dups: # the bug is unaccessible (sec bug for example) continue dup = dups[dupid] bs = utils.get_signatures(info['signature']) ds = utils.get_signatures(dup['signature']) if not bs.issubset(ds): signatures[dupid] = bs - ds pc = {} for x in ['product', 'component']: if info[x] != dup[x]: pc[x] = dup[x] if pc: # when we change the product, we change the version too # to avoid incompatible version in the new product if 'product' in pc and info['version'] != dup['version']: pc['version'] = dup['version'] pcs[bugid] = pc # Don't move product/component for now # return signatures, pcs return signatures, {}
def compare(self, bugs, dups): # each bug in bugs is the dup of one in dups # so the characteristics of this bug should be in the dup signatures = {} pcs = {} for bugid, info in bugs.items(): dupid = info["dupe"] if dupid not in dups: # the bug is unaccessible (sec bug for example) continue dup = dups[dupid] bs = utils.get_signatures(info["signature"]) ds = utils.get_signatures(dup["signature"]) if not bs.issubset(ds): signatures[dupid] = bs - ds pc = {} for x in ["product", "component"]: if info[x] != dup[x]: pc[x] = dup[x] if pc: # when we change the product, we change the version too # to avoid incompatible version in the new product if "product" in pc and info["version"] != dup["version"]: pc["version"] = dup["version"] pcs[bugid] = pc # Don't move product/component for now # return signatures, pcs return signatures, {}
def handle_bug(self, bug, data): bugid = str(bug['id']) assignee = bug.get('assigned_to', '') if assignee: info = self.people.get_info(assignee) if info: assignee = info['cn'] else: name = bug.get('assigned_to_detail', {}).get('real_name', '') if name: assignee = utils.get_better_name(name) else: assignee = 'Nobody' isacrash = len(utils.get_signatures(bug.get('cf_crash_signature', ''))) != 0 data[bugid] = { 'land': {}, 'assignee': assignee, 'crash': 'Yes' if isacrash else 'No', 'priority': bug['priority'], 'severity': bug['severity'], 'tracking': bug[self.tracking_nightly], 'status': bug['status'].lower(), 'status_flags': { self.nightly: bug[self.status_nightly], self.beta: bug[self.status_beta], self.release: bug[self.status_release], }, 'keywords': ','.join(bug['keywords']), } return bug
def test_add_signatures(self): old = '[@ x]\n[@ y]' new = ' [@ abc]\n[@ def ]\r\n [@ ghi ] \r\n[@ jkl] ' new = utils.get_signatures(new) sgns = utils.add_signatures(old, new) assert sgns == '[@ x]\n[@ y]\n[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]' sgns = utils.add_signatures('', new) assert sgns == '[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]'
def test_add_signatures(self): old = "[@ x]\n[@ y]" new = " [@ abc]\n[@ def ]\r\n [@ ghi ] \r\n[@ jkl] " new = utils.get_signatures(new) sgns = utils.add_signatures(old, new) assert sgns == "[@ x]\n[@ y]\n[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]" sgns = utils.add_signatures("", new) assert sgns == "[@ abc]\n[@ def]\n[@ ghi]\n[@ jkl]"
def bughandler(self, bug, data): """bug handler for the Bugzilla query""" if 'cf_crash_signature' not in bug: return sgns = utils.get_signatures(bug['cf_crash_signature']) id = bug['id'] self.summaries[str(id)] = self.get_summary(bug) data['ids'][id] = sgns signatures = data['signatures'] for s in sgns: signatures.add(s)
def bughandler(self, bug, data): """bug handler for the Bugzilla query""" if "cf_crash_signature" not in bug: return sgns = utils.get_signatures(bug["cf_crash_signature"]) id = bug["id"] self.summaries[str(id)] = self.get_summary(bug) data["ids"][id] = sgns signatures = data["signatures"] for s in sgns: signatures.add(s)
def test_get_signatures(self): s = ' [@ abc]\n[@ def ]\r\n [@ ghi ] \r\n[@ jkl] ' s = utils.get_signatures(s) assert s == {'abc', 'def', 'ghi', 'jkl'}
def test_get_signatures(self): s = " [@ abc]\n[@ def ]\r\n [@ ghi ] \r\n[@ jkl] " s = utils.get_signatures(s) assert s == {"abc", "def", "ghi", "jkl"}