Merge lp:~jcsackett/launchpad/remove-unused-sharing-functions into lp:launchpad

Proposed by j.c.sackett
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 15373
Proposed branch: lp:~jcsackett/launchpad/remove-unused-sharing-functions
Merge into: lp:launchpad
Diff against target: 67 lines (+0/-57)
1 file modified
lib/lp/bugs/model/bug.py (+0/-57)
To merge this branch: bzr merge lp:~jcsackett/launchpad/remove-unused-sharing-functions
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+109030@code.launchpad.net

Commit message

Removes unused functions from bug model that should have been removed when reconcileSubscribers was removed.

Description of the change

Summary
=======
Quite some time ago, the `reconcileSubscribers` method was removed from the
bug model, as it was never used. It used two methods, `getRequiredSubscribers`
and `getAutoRemovedSubscribers`, which were unused anywhere else. As a matter
of pure oversight, these weren't deleted.

Now they are.

Implementation
==============
The methods `reconcileSubscribers` and `getAutoRemovedSubscribers` are removed
from the bug model.

Tests
=====
You don't actually need to run any tests--these were literally not called
anywhere. Just in case though: bin/test -vvct bug

QA
==
No QA. This just kills old unused code.

LoC
===
This only removes code.

Lint
====

Checking for conflicts and issues in changed files.

Linting changed files:
  lib/lp/bugs/model/bug.py

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/bugs/model/bug.py'
2--- lib/lp/bugs/model/bug.py 2012-06-05 02:03:44 +0000
3+++ lib/lp/bugs/model/bug.py 2012-06-06 22:57:19 +0000
4@@ -1816,63 +1816,6 @@
5
6 return True
7
8- def getRequiredSubscribers(self, information_type, who):
9- """Return the mandatory subscribers for a bug with given attributes.
10-
11- When a bug is marked as private or security related, it is required
12- that certain people be subscribed so they can access details about the
13- bug. The rules are:
14- security=true, private=true/false ->
15- subscribers = the reporter + security contact for each task
16- security=false, private=true ->
17- subscribers = the reporter + bug supervisor for each task
18- security=false, private=false ->
19- subscribers = ()
20-
21- If bug supervisor or security contact is unset, fallback to bugtask
22- reporter/owner.
23- """
24- if information_type == InformationType.PUBLIC:
25- return set()
26- result = set()
27- result.add(self.owner)
28- for bugtask in self.bugtasks:
29- maintainer = bugtask.pillar.owner
30- if information_type in SECURITY_INFORMATION_TYPES:
31- result.add(bugtask.pillar.security_contact or maintainer)
32- if information_type in PRIVATE_INFORMATION_TYPES:
33- result.add(bugtask.pillar.bug_supervisor or maintainer)
34- if information_type in PRIVATE_INFORMATION_TYPES:
35- subscribers_for_who = self.getSubscribersForPerson(who)
36- if subscribers_for_who.is_empty():
37- result.add(who)
38- return result
39-
40- def getAutoRemovedSubscribers(self, information_type):
41- """Return the to be removed subscribers for bug with given attributes.
42-
43- When a bug's privacy or security related attributes change, some
44- existing subscribers may need to be automatically removed.
45- The rules are:
46- security=false ->
47- auto removed subscribers = (bugtask security contacts)
48- privacy=false ->
49- auto removed subscribers = (bugtask bug supervisors)
50-
51- """
52- bug_supervisors = []
53- security_contacts = []
54- for_security_related = information_type in SECURITY_INFORMATION_TYPES
55- for_private = information_type in PRIVATE_INFORMATION_TYPES
56- for pillar in self.affected_pillars:
57- if (self.security_related and not for_security_related
58- and pillar.security_contact):
59- security_contacts.append(pillar.security_contact)
60- if (self.private and not for_private
61- and pillar.bug_supervisor):
62- bug_supervisors.append(pillar.bug_supervisor)
63- return bug_supervisors, security_contacts
64-
65 def getBugTask(self, target):
66 """See `IBug`."""
67 for bugtask in self.bugtasks: