~brian-murray/ubuntu-archive-tools/ubuntu-security-bugs

« back to all changes in this revision

Viewing changes to component-mismatches

  • Committer: Łukasz 'sil2100' Zemczak
  • Date: 2018-03-07 14:54:19 UTC
  • mfrom: (1159.1.3 component-mismatches)
  • Revision ID: lukasz.zemczak@canonical.com-20180307145419-jlpm2iwegbj82qtq
Add assignee if a MIR bug is currently open and not yet approved (Fix Committed or Fix Released).

Show diffs side-by-side

added added

removed removed

Lines of Context:
70
70
 
71
71
 
72
72
class MIRLink:
73
 
    def __init__(self, id, status, title):
 
73
    def __init__(self, id, status, title, assignee):
74
74
        self.id = id
75
75
        self.status = status
76
76
        self.title = title
 
77
        self.assignee = assignee
77
78
 
78
79
    def __str__(self):
79
 
        s = "MIR: #%d (%s)" % (self.id, self.status)
 
80
        if self.status not in ('Fix Committed', 'Fix Released') and assignee:
 
81
            s = "MIR: #%d (%s for %s)" % (self.id, self.status,
 
82
                                          self.assignee.display_name)
 
83
        else:
 
84
            s = "MIR: #%d (%s)" % (self.id, self.status)
80
85
        # no need to repeat the standard title
81
86
        if not self.title.startswith("[MIR]"):
82
87
            s += " %s" % self.title
377
382
 
378
383
                mirs = mir_bugs.get(name, [])
379
384
                approved_mirs = [
380
 
                    id for id, status, title in mirs
 
385
                    id for id, status, title, assignee in mirs
381
386
                    if status in ('Fix Committed', 'Fix Released')]
382
387
 
383
388
                url = None
639
644
            binaries = sorted(both[source])
640
645
            entry = [[source] + binaries]
641
646
 
642
 
            for (id, status, title) in mir_bugs.get(source, []):
643
 
                entry.append(MIRLink(id, status, title))
 
647
            for (id, status, title, assignee) in mir_bugs.get(source, []):
 
648
                entry.append(MIRLink(id, status, title, assignee))
644
649
 
645
650
            entry.extend(do_reverse(options, source, binaries, both))
646
651
            output.append(entry)
802
807
def get_mir_bugs(options, sources):
803
808
    '''Return MIR bug information for a set of source packages.
804
809
 
805
 
    Return a map source -> [(id, status, title), ...]
 
810
    Return a map source -> [(id, status, title, assignee), ...]
806
811
    '''
807
812
    result = defaultdict(list)
808
813
    mir_team = options.launchpad.people['ubuntu-mir']
812
817
        tasks = options.distro.getSourcePackage(name=source).searchTasks(
813
818
            bug_subscriber=mir_team, status=bug_statuses)
814
819
        for task in tasks:
815
 
            result[source].append((task.bug.id, task.status, task.bug.title))
 
820
            result[source].append((task.bug.id, task.status, task.bug.title,
 
821
                                   task.assignee))
816
822
 
817
823
    return result
818
824