Merge lp://staging/~deryck/launchpad/remove-mentoring-templates-427928 into lp://staging/launchpad

Proposed by Deryck Hodge
Status: Merged
Approved by: Brad Crittenden
Approved revision: no longer in the source branch.
Merged at revision: not available
Proposed branch: lp://staging/~deryck/launchpad/remove-mentoring-templates-427928
Merge into: lp://staging/launchpad
Diff against target: None lines
To merge this branch: bzr merge lp://staging/~deryck/launchpad/remove-mentoring-templates-427928
Reviewer Review Type Date Requested Status
Brad Crittenden (community) code Approve
Review via email: mp+11812@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Deryck Hodge (deryck) wrote :

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

= Summary =

This branch removes the "Offer mentorship" link from the bug page. It
removes the mentoring zcml and templates, and also removes any other
remaining links to the feature in registry or blueprints (since the
pages would now error). This is bug #427928.

The diff is large here, but it's almost all removal of files or removal
of sections of code.

= Launchpad lint =

Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.

Linting changed files:
  lib/lp/registry/browser/configure.zcml
  lib/lp/registry/stories/project/xx-project-index.txt
  lib/lp/blueprints/templates/specification-index.pt
  lib/lp/registry/browser/product.py
  lib/lp/bugs/browser/configure.zcml
  lib/lp/registry/stories/teammembership/xx-private-membership.txt
  lib/lp/registry/browser/person.py
  lib/lp/registry/browser/distribution.py
  lib/lp/bugs/templates/bugtask-index.pt
  lib/lp/registry/browser/project.py
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkqv0AwACgkQ4glRK0DaE8h0GgCcDxwgab0G8VUCWOP42pJXQssW
704AoJtMVjokpkDXqfwlnECO47Uccmco
=M4/s
-----END PGP SIGNATURE-----

Revision history for this message
Brad Crittenden (bac) wrote :

These changes look good Deryck. Thanks for getting rid of the unused feature.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/blueprints/templates/specification-index.pt'
--- lib/lp/blueprints/templates/specification-index.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/blueprints/templates/specification-index.pt 2009-09-14 13:43:43 +0000
@@ -188,29 +188,6 @@
188 </tal:block>188 </tal:block>
189 </ul>189 </ul>
190190
191 <tal:mentors define="mentoring_offers context/mentoring_offers"
192 condition="mentoring_offers">
193 <p>
194 <img src="/@@/mentoring" alt="Mentoring"
195 title="People have offered to mentor this work" />
196 <b>Mentors:</b>
197 <tal:block repeat="mentoring_offer mentoring_offers">
198 <a tal:replace="structure mentoring_offer/owner/fmt:link">foobar</a>
199 </tal:block>
200 </p>
201 <tal:block condition="not: context/is_complete">
202 <p tal:condition="view/userIsMentor">
203 &raquo;
204 <a href="+retractmentoring">Retract my offer of mentorship</a>
205 </p>
206 </tal:block>
207 </tal:mentors>
208
209 <p tal:condition="view/userCanMentor">
210 &raquo; <a href="+mentor">Offer to mentor someone implementing
211 this blueprint</a>
212 </p>
213
214 <h2>Whiteboard191 <h2>Whiteboard
215 <a tal:define="link context_menu/whiteboard"192 <a tal:define="link context_menu/whiteboard"
216 tal:condition="link/enabled"193 tal:condition="link/enabled"
217194
=== modified file 'lib/lp/bugs/browser/configure.zcml'
--- lib/lp/bugs/browser/configure.zcml 2009-09-12 01:57:22 +0000
+++ lib/lp/bugs/browser/configure.zcml 2009-09-14 12:19:55 +0000
@@ -888,58 +888,6 @@
888 attribute_to_parent="bug"888 attribute_to_parent="bug"
889 rootsite="bugs"/>889 rootsite="bugs"/>
890 <facet890 <facet
891 facet="overview">
892 <browser:pages
893 for="canonical.launchpad.interfaces.IHasMentoringOffers"
894 class="lp.registry.browser.mentoringoffer.HasMentoringOffersView"
895 permission="zope.Public">
896 <browser:page
897 name="+mentoring"
898 template="../templates/hasmentoringoffers-mentoring.pt"/>
899 </browser:pages>
900 <browser:page
901 name="+retractmentoring"
902 for="canonical.launchpad.interfaces.ICanBeMentored"
903 class="lp.registry.browser.mentoringoffer.MentoringOfferRetractView"
904 permission="launchpad.AnyPerson"
905 template="../templates/canbementored-retractmentoring.pt"/>
906 <browser:page
907 name="+mentor"
908 for="canonical.launchpad.interfaces.ICanBeMentored"
909 class="lp.registry.browser.mentoringoffer.MentoringOfferAddView"
910 permission="launchpad.AnyPerson"
911 template="../templates/canbementored-mentoringoffer.pt">
912 </browser:page>
913 <browser:url
914 for="canonical.launchpad.interfaces.IMentoringOfferSet"
915 path_expression="string:+mentoring"
916 parent_utility="canonical.launchpad.interfaces.ILaunchpadRoot"/>
917 <browser:menus
918 module="lp.registry.browser.mentoringoffer"
919 classes="
920 MentoringOfferSetFacets
921 MentoringOfferSetOverviewMenu"/>
922 <browser:defaultView
923 for="canonical.launchpad.interfaces.IMentoringOfferSet"
924 name="+mentoring"/>
925 <browser:pages
926 for="canonical.launchpad.interfaces.IMentoringOfferSet"
927 class="lp.registry.browser.mentoringoffer.MentoringOfferSetView"
928 permission="launchpad.Admin">
929
930 <!-- this is repeated here from IHasMentoringOffers because it has a
931 different (and stricter) permission. We want only admins to see the
932 overall mentoring picture. -->
933
934 <browser:page
935 name="+mentoring"
936 template="../templates/hasmentoringoffers-mentoring.pt"/>
937 <browser:page
938 name="+success"
939 template="../templates/mentoringofferset-success.pt"/>
940 </browser:pages>
941 </facet>
942 <facet
943 facet="bugs">891 facet="bugs">
944 <browser:menus892 <browser:menus
945 module="lp.bugs.browser.bug"893 module="lp.bugs.browser.bug"
946894
=== modified file 'lib/lp/bugs/templates/bugtask-index.pt'
--- lib/lp/bugs/templates/bugtask-index.pt 2009-08-12 11:49:59 +0000
+++ lib/lp/bugs/templates/bugtask-index.pt 2009-09-14 12:19:55 +0000
@@ -393,26 +393,6 @@
393 </tal:comment-list-truncated>393 </tal:comment-list-truncated>
394 </tal:comments>394 </tal:comments>
395395
396 <div id="mentoring" style="margin-top: 4em">
397 <tal:mentors define="mentoring_offers context/bug/mentoring_offers"
398 condition="mentoring_offers">
399 <p>
400 <b>Mentors:</b>
401 <tal:block repeat="mentoring_offer mentoring_offers">
402 <a tal:replace="structure mentoring_offer/owner/fmt:link">foobar</a>
403 </tal:block>
404 </p>
405 <tal:block condition="not: context/bug/is_complete">
406 <div tal:condition="view/userIsMentor" class="actions">
407 <img class="inlineLinkIcon sprite remove" alt=""/><a href="+retractmentoring">Retract my offer of mentorship</a>
408 </div>
409 </tal:block>
410 </tal:mentors>
411 <p tal:define="link context_menu/offermentoring"
412 tal:condition="link/enabled"
413 tal:content="structure link/render"
414 />
415 </div>
416 <div class="related">396 <div class="related">
417 <h2>What next?</h2>397 <h2>What next?</h2>
418 <ul>398 <ul>
419399
=== removed file 'lib/lp/bugs/templates/canbementored-mentoringoffer.pt'
--- lib/lp/bugs/templates/canbementored-mentoringoffer.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/bugs/templates/canbementored-mentoringoffer.pt 1970-01-01 00:00:00 +0000
@@ -1,34 +0,0 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="context/@@main_template/master"
10 i18n:domain="launchpad"
11>
12
13<body>
14
15<div metal:fill-slot="main">
16
17 <div tal:content="structure context/fmt:link" />
18 <h1>Offer to mentor this work</h1>
19
20 <div metal:use-macro="context/@@launchpad_form/form">
21
22 <p metal:fill-slot="extra_info" class="documentDescription">
23 Select the team which would most benefit from this work being
24 completed. People wishing to join this team will be able to see your
25 offer in a list of similar ones, and thus be able to prove their
26 suitability for team membership more efficiently.
27 </p>
28
29 </div>
30
31</div>
32
33</body>
34</html>
350
=== removed file 'lib/lp/bugs/templates/canbementored-retractmentoring.pt'
--- lib/lp/bugs/templates/canbementored-retractmentoring.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/bugs/templates/canbementored-retractmentoring.pt 1970-01-01 00:00:00 +0000
@@ -1,43 +0,0 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="context/@@main_template/master"
10 i18n:domain="launchpad"
11>
12
13<body>
14
15<div metal:fill-slot="main">
16
17 <div tal:content="structure context/fmt:link" />
18
19 <tal:are_mentor condition="view/userIsMentor">
20 <div metal:use-macro="context/@@launchpad_form/form">
21
22 <p metal:fill-slot="extra_info" class="documentDescription">
23 When you retract your offer of mentoring, it will disappear
24 immediately from both project and team mentorship listings.
25 </p>
26
27 </div>
28 </tal:are_mentor>
29
30 <tal:not_mentor condition="not: view/userIsMentor">
31
32 <h1>You have not offered to mentor this work</h1>
33
34 <p>
35 You cannot retract an offer you have not yet made.
36 </p>
37
38 </tal:not_mentor>
39
40</div>
41
42</body>
43</html>
440
=== removed file 'lib/lp/bugs/templates/hasmentoringoffers-mentoring.pt'
--- lib/lp/bugs/templates/hasmentoringoffers-mentoring.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/bugs/templates/hasmentoringoffers-mentoring.pt 1970-01-01 00:00:00 +0000
@@ -1,142 +0,0 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="view/macro:page/onecolumn"
10 i18n:domain="launchpad"
11>
12
13<body>
14
15<div metal:fill-slot="help">
16 <p>
17 Launchpad lets you keep track of offers of mentorship from members of
18 your community. Anybody who is a member of a team can offer to mentor
19 work on a bug or a blueprint. Launchpad then keeps track of those
20 offers, and you can use its listings as a convenient starting place for
21 new contributors.
22 </p>
23
24 <p>
25 Read the
26 <a href="https://help.launchpad.net/MentoringManagement/">mentoring
27 management documentation</a> for more detailed information.
28 </p>
29</div>
30
31<metal:leftportlets fill-slot="portlets_one">
32</metal:leftportlets>
33
34<metal:rightportlets fill-slot="portlets_two">
35</metal:rightportlets>
36
37
38<div metal:fill-slot="main">
39
40<h1>Offers of help and mentoring</h1>
41
42<tal:def_batch define="batch view/batched_offers;
43 total batch/batch/total">
44
45<tal:mentoring_available condition="total">
46
47 <p tal:condition="view/is_pillar">
48 This list describes bugs and blueprints in
49 <span tal:replace="context/displayname">Mozilla</span>
50 that someone has offered to mentor. If you are a new contributor to
51 <span tal:replace="context/displayname">Mozilla</span>
52 and would like to know how to help, then this is a good place to start.
53 Each of these items is likely to be a bite-sized piece of work which
54 would be well-received by the community, and for which you know you will
55 get good assistance and review.
56 </p>
57 <p tal:condition="view/is_person">
58 This list describes bugs and blueprints that
59 <span tal:replace="context/displayname">Foo Bar</span>
60 has offered to mentor.
61 </p>
62 <p tal:condition="view/is_team">
63 This list describes bugs and blueprints which people have offered to
64 mentor. If you would like to join "<span
65 tal:replace="context/title">Foo Bar</span>" then these would be
66 good items to work on - they are likely to be bite-sized and you know
67 who you can approach to discuss the implementation.
68 </p>
69 <p tal:condition="view/is_manager">
70 This is an overview of all mentorship offers currently outstanding in
71 Launchpad. It shows only offers on incomplete work. You can also see a
72 list of <a href="+success">recent successes</a> - items that are just
73 recently completed and for which mentorship had been offered.
74 </p>
75
76 <tal:navigation replace="structure batch/@@+navigation-links-upper" />
77 <table class="listing" id="mentorships">
78 <thead>
79 <tr>
80 <th tal:condition="view/show_date">When</th>
81 <th tal:condition="view/show_team">For</th>
82 <th tal:condition="view/show_person">By</th>
83 <th tal:condition="view/show_work">What</th>
84 </tr>
85 </thead>
86 <tbody>
87 <tr tal:repeat="offer batch/currentBatch">
88 <td tal:condition="view/show_date">
89 <span tal:content="offer/date_created/fmt:approximatedate"
90 tal:attributes="title offer/date_created/fmt:datetime">
91 2007-15-13
92 </span>
93 </td>
94 <td tal:condition="view/show_team">
95 <a tal:replace="structure offer/team/fmt:link">foobar</a>
96 </td>
97 <td tal:condition="view/show_person">
98 <a tal:replace="structure offer/owner/fmt:link">foobar</a>
99 </td>
100 <td tal:condition="view/show_work">
101 <div tal:replace="structure offer/target/@@+listing-column" />
102 </td>
103 </tr>
104 </tbody>
105 </table>
106 <tal:navigation replace="structure batch/@@+navigation-links-lower" />
107
108</tal:mentoring_available>
109
110<tal:no_mentoring condition="not: total">
111 <p tal:condition="not:view/is_person">
112 Nobody has yet offered to mentor work for
113 <span tal:replace="context/displayname">Mozilla</span>.
114 </p>
115 <p tal:condition="view/is_person">
116 <span tal:replace="context/title" /> has not offered to mentor work on
117 any bugs or blueprints.
118 </p>
119
120 <p>
121 You can <a href="https://help.launchpad.net/MentoringManagement">learn
122 more about this capability in Launchpad</a>, which allows you to
123 create an "onramp" of
124 bite-sized chunks of work for new people who want to contribute or to
125 prove their worth.
126 </p>
127
128 <p>
129 In summary, you can encourage members of your teams to offer mentoring
130 on bugs and blueprints that they know how to fix or implement, but which
131 they don't have time to get to personally. This list then makes a good
132 starting point for new community members who want to make a contribution
133 but don't know where to start.
134 </p>
135
136</tal:no_mentoring>
137
138</tal:def_batch>
139</div>
140
141</body>
142</html>
1430
=== removed file 'lib/lp/bugs/templates/mentoringofferset-success.pt'
--- lib/lp/bugs/templates/mentoringofferset-success.pt 2009-07-17 17:59:07 +0000
+++ lib/lp/bugs/templates/mentoringofferset-success.pt 1970-01-01 00:00:00 +0000
@@ -1,79 +0,0 @@
1<html
2 xmlns="http://www.w3.org/1999/xhtml"
3 xmlns:tal="http://xml.zope.org/namespaces/tal"
4 xmlns:metal="http://xml.zope.org/namespaces/metal"
5 xmlns:i18n="http://xml.zope.org/namespaces/i18n"
6 xml:lang="en"
7 lang="en"
8 dir="ltr"
9 metal:use-macro="context/@@main_template/master"
10 i18n:domain="launchpad"
11>
12
13<body>
14
15<metal:heading fill-slot="pageheading">
16 <h1>Successful mentorships</h1>
17</metal:heading>
18
19<div metal:fill-slot="main">
20
21<tal:def_offers define="
22 batch view/batched_successes;
23 offer_count context/recent_completed_mentorships/count">
24<tal:mentoring_available condition="offer_count">
25
26 <p>
27 This list describes bugs and features in
28 <span tal:replace="context/displayname">Mozilla</span>
29 which have been completed with the help of mentorship.
30 </p>
31
32 <h2>Mentorships</h2>
33
34 <tal:navigation replace="structure batch/@@+navigation-links-upper" />
35 <table class="listing" id="mentorships">
36 <thead>
37 <tr>
38 <th>Date</th>
39 <th>For</th>
40 <th>By</th>
41 <th>What</th>
42 </tr>
43 </thead>
44 <tbody>
45 <tr tal:repeat="offer batch/currentBatch">
46 <td>
47 <span tal:content="offer/date_created/fmt:date"
48 tal:attributes="title offer/date_created/fmt:time">
49 2007-15-13
50 </span>
51 </td>
52 <td>
53 <a tal:replace="structure offer/team/fmt:link">foobar</a>
54 </td>
55 <td>
56 <a tal:replace="structure offer/owner/fmt:link">foobar</a>
57 </td>
58 <td>
59 <div tal:replace="structure offer/target/@@+listing-column" />
60 </td>
61 </tr>
62 </tbody>
63 </table>
64 <tal:navigation replace="structure batch/@@+navigation-links-lower" />
65
66</tal:mentoring_available>
67
68<tal:no_mentoring condition="not: offer_count">
69 <p>
70 Nobody has yet completed any bug fixes or feature implementations
71 in <span tal:replace="context/displayname">Mozilla</span> with the help
72 of mentorship.
73 </p>
74</tal:no_mentoring>
75</tal:def_offers>
76
77</div>
78</body>
79</html>
800
=== modified file 'lib/lp/registry/browser/configure.zcml'
--- lib/lp/registry/browser/configure.zcml 2009-09-12 01:57:22 +0000
+++ lib/lp/registry/browser/configure.zcml 2009-09-14 12:55:10 +0000
@@ -751,12 +751,10 @@
751 PersonSetActionNavigationMenu751 PersonSetActionNavigationMenu
752 PersonSetContextMenu752 PersonSetContextMenu
753 PersonSpecsMenu753 PersonSpecsMenu
754 TeamBugsMenu
755 TeamEditMenu754 TeamEditMenu
756 TeamIndexMenu755 TeamIndexMenu
757 TeamOverviewMenu756 TeamOverviewMenu
758 TeamOverviewNavigationMenu757 TeamOverviewNavigationMenu
759 TeamSpecsMenu
760 "/>758 "/>
761 <browser:menus759 <browser:menus
762 module="lp.registry.browser.menu"760 module="lp.registry.browser.menu"
763761
=== modified file 'lib/lp/registry/browser/distribution.py'
--- lib/lp/registry/browser/distribution.py 2009-09-10 18:53:09 +0000
+++ lib/lp/registry/browser/distribution.py 2009-09-14 12:55:10 +0000
@@ -292,7 +292,7 @@
292 links = ['edit', 'branding', 'driver', 'search', 'allpkgs', 'members',292 links = ['edit', 'branding', 'driver', 'search', 'allpkgs', 'members',
293 'mirror_admin', 'reassign', 'addseries', 'series', 'milestones',293 'mirror_admin', 'reassign', 'addseries', 'series', 'milestones',
294 'top_contributors',294 'top_contributors',
295 'mentorship', 'builds', 'cdimage_mirrors', 'archive_mirrors',295 'builds', 'cdimage_mirrors', 'archive_mirrors',
296 'pending_review_mirrors', 'disabled_mirrors',296 'pending_review_mirrors', 'disabled_mirrors',
297 'unofficial_mirrors', 'newmirror', 'announce', 'announcements',297 'unofficial_mirrors', 'newmirror', 'announce', 'announcements',
298 'ppas',]298 'ppas',]
@@ -322,10 +322,6 @@
322 text = 'More contributors'322 text = 'More contributors'
323 return Link('+topcontributors', text, icon='info')323 return Link('+topcontributors', text, icon='info')
324324
325 def mentorship(self):
326 text = 'Mentoring available'
327 return Link('+mentoring', text, icon='info')
328
329 def cdimage_mirrors(self):325 def cdimage_mirrors(self):
330 text = 'CD mirrors'326 text = 'CD mirrors'
331 return Link('+cdmirrors', text, icon='info')327 return Link('+cdmirrors', text, icon='info')
332328
=== modified file 'lib/lp/registry/browser/person.py'
--- lib/lp/registry/browser/person.py 2009-09-12 01:57:22 +0000
+++ lib/lp/registry/browser/person.py 2009-09-14 12:55:10 +0000
@@ -82,7 +82,6 @@
82 'TeamOverviewNavigationMenu',82 'TeamOverviewNavigationMenu',
83 'TeamOverviewMenu',83 'TeamOverviewMenu',
84 'TeamReassignmentView',84 'TeamReassignmentView',
85 'TeamSpecsMenu',
86 'archive_to_person',85 'archive_to_person',
87 ]86 ]
8887
@@ -719,7 +718,7 @@
719 usedfor = IPerson718 usedfor = IPerson
720 facet = 'bugs'719 facet = 'bugs'
721 links = ['assignedbugs', 'commentedbugs', 'reportedbugs',720 links = ['assignedbugs', 'commentedbugs', 'reportedbugs',
722 'subscribedbugs', 'relatedbugs', 'softwarebugs', 'mentoring']721 'subscribedbugs', 'relatedbugs', 'softwarebugs']
723722
724 def relatedbugs(self):723 def relatedbugs(self):
725 text = 'List all related bugs'724 text = 'List all related bugs'
@@ -750,13 +749,6 @@
750 % self.context.displayname)749 % self.context.displayname)
751 return Link('+subscribedbugs', text, summary=summary)750 return Link('+subscribedbugs', text, summary=summary)
752751
753 def mentoring(self):
754 text = 'Mentoring offered'
755 summary = ('Lists bugs for which %s has offered to mentor someone.'
756 % self.context.displayname)
757 enabled = bool(self.context.mentoring_offers)
758 return Link('+mentoring', text, enabled=enabled, summary=summary)
759
760 def commentedbugs(self):752 def commentedbugs(self):
761 text = 'List commented bugs'753 text = 'List commented bugs'
762 summary = ('Lists bug reports on which %s has commented.'754 summary = ('Lists bug reports on which %s has commented.'
@@ -770,7 +762,7 @@
770 facet = 'specifications'762 facet = 'specifications'
771 links = ['assignee', 'drafter', 'approver',763 links = ['assignee', 'drafter', 'approver',
772 'subscriber', 'registrant', 'feedback',764 'subscriber', 'registrant', 'feedback',
773 'workload', 'mentoring']765 'workload']
774766
775 def registrant(self):767 def registrant(self):
776 text = 'Registrant'768 text = 'Registrant'
@@ -804,43 +796,12 @@
804 self.context.displayname)796 self.context.displayname)
805 return Link('+specfeedback', text, summary, icon='info')797 return Link('+specfeedback', text, summary, icon='info')
806798
807 def mentoring(self):
808 text = 'Mentoring offered'
809 enabled = bool(self.context.mentoring_offers)
810 return Link('+mentoring', text, enabled=enabled, icon='info')
811
812 def workload(self):799 def workload(self):
813 text = 'Workload'800 text = 'Workload'
814 summary = 'Show all specification work assigned'801 summary = 'Show all specification work assigned'
815 return Link('+specworkload', text, summary, icon='info')802 return Link('+specworkload', text, summary, icon='info')
816803
817804
818class TeamSpecsMenu(PersonSpecsMenu):
819
820 usedfor = ITeam
821 facet = 'specifications'
822
823 def mentoring(self):
824 target = '+mentoring'
825 text = 'Mentoring offered'
826 summary = 'Offers of mentorship for prospective team members'
827 return Link(target, text, summary=summary, icon='info')
828
829
830class TeamBugsMenu(PersonBugsMenu):
831
832 usedfor = ITeam
833 facet = 'bugs'
834 links = ['assignedbugs', 'relatedbugs', 'softwarebugs', 'subscribedbugs',
835 'mentorships']
836
837 def mentorships(self):
838 target = '+mentoring'
839 text = 'Mentoring offered'
840 summary = 'Offers of mentorship for prospective team members'
841 return Link(target, text, summary=summary, icon='info')
842
843
844class CommonMenuLinks:805class CommonMenuLinks:
845806
846 @property807 @property
@@ -901,9 +862,8 @@
901 'editemailaddresses', 'editlanguages', 'editwikinames',862 'editemailaddresses', 'editlanguages', 'editwikinames',
902 'editircnicknames', 'editjabberids', 'editpassword',863 'editircnicknames', 'editjabberids', 'editpassword',
903 'editsshkeys', 'editpgpkeys', 'editlocation', 'memberships',864 'editsshkeys', 'editpgpkeys', 'editlocation', 'memberships',
904 'mentoringoffers', 'codesofconduct', 'karma',865 'codesofconduct', 'karma', 'administer', 'projects',
905 'administer', 'projects', 'activate_ppa', 'maintained',866 'activate_ppa', 'maintained', 'view_ppa_subscriptions']
906 'view_ppa_subscriptions']
907867
908 @enabled_with_permission('launchpad.Edit')868 @enabled_with_permission('launchpad.Edit')
909 def edit(self):869 def edit(self):
@@ -972,12 +932,6 @@
972 text = 'Show team participation'932 text = 'Show team participation'
973 return Link(target, text, icon='info')933 return Link(target, text, icon='info')
974934
975 def mentoringoffers(self):
976 target = '+mentoring'
977 text = 'Mentoring offered'
978 enabled = bool(self.context.mentoring_offers)
979 return Link(target, text, enabled=enabled, icon='info')
980
981 @enabled_with_permission('launchpad.Special')935 @enabled_with_permission('launchpad.Special')
982 def editsshkeys(self):936 def editsshkeys(self):
983 target = '+editsshkeys'937 target = '+editsshkeys'
@@ -1199,12 +1153,6 @@
1199 text = 'Show team participation'1153 text = 'Show team participation'
1200 return Link(target, text, icon='info')1154 return Link(target, text, icon='info')
12011155
1202 def mentorships(self):
1203 target = '+mentoring'
1204 text = 'Mentoring available'
1205 summary = 'Offers of mentorship for prospective team members'
1206 return Link(target, text, summary=summary, icon='info')
1207
1208 @enabled_with_permission('launchpad.View')1156 @enabled_with_permission('launchpad.View')
1209 def mugshots(self):1157 def mugshots(self):
1210 target = '+mugshots'1158 target = '+mugshots'
@@ -1296,7 +1244,7 @@
1296 'memberships', 'received_invitations',1244 'memberships', 'received_invitations',
1297 'editemail', 'configure_mailing_list', 'moderate_mailing_list',1245 'editemail', 'configure_mailing_list', 'moderate_mailing_list',
1298 'editlanguages', 'map', 'polls',1246 'editlanguages', 'map', 'polls',
1299 'add_poll', 'join', 'leave', 'add_my_teams', 'mentorships',1247 'add_poll', 'join', 'leave', 'add_my_teams',
1300 'reassign', 'projects', 'activate_ppa', 'maintained', 'ppa']1248 'reassign', 'projects', 'activate_ppa', 'maintained', 'ppa']
13011249
13021250
13031251
=== modified file 'lib/lp/registry/browser/product.py'
--- lib/lp/registry/browser/product.py 2009-09-08 12:30:13 +0000
+++ lib/lp/registry/browser/product.py 2009-09-14 12:55:10 +0000
@@ -377,7 +377,6 @@
377 'edit',377 'edit',
378 'reassign',378 'reassign',
379 'top_contributors',379 'top_contributors',
380 'mentorship',
381 'distributions',380 'distributions',
382 'packages',381 'packages',
383 'series',382 'series',
@@ -399,10 +398,6 @@
399 text = 'Packaging information'398 text = 'Packaging information'
400 return Link('+distributions', text, icon='info')399 return Link('+distributions', text, icon='info')
401400
402 def mentorship(self):
403 text = 'Mentoring available'
404 return Link('+mentoring', text, icon='info')
405
406 def packages(self):401 def packages(self):
407 text = 'Show distribution packages'402 text = 'Show distribution packages'
408 return Link('+packages', text, icon='info')403 return Link('+packages', text, icon='info')
409404
=== modified file 'lib/lp/registry/browser/project.py'
--- lib/lp/registry/browser/project.py 2009-09-04 02:20:59 +0000
+++ lib/lp/registry/browser/project.py 2009-09-14 12:55:10 +0000
@@ -189,7 +189,7 @@
189 usedfor = IProject189 usedfor = IProject
190 facet = 'overview'190 facet = 'overview'
191 links = [191 links = [
192 'branding', 'driver', 'reassign', 'top_contributors', 'mentorship',192 'branding', 'driver', 'reassign', 'top_contributors',
193 'announce', 'announcements', 'branch_visibility', 'rdf',193 'announce', 'announcements', 'branch_visibility', 'rdf',
194 'new_product', 'administer', 'milestones']194 'new_product', 'administer', 'milestones']
195195
@@ -202,15 +202,6 @@
202 text = 'More contributors'202 text = 'More contributors'
203 return Link('+topcontributors', text, icon='info')203 return Link('+topcontributors', text, icon='info')
204204
205 def mentorship(self):
206 text = 'Mentoring available'
207
208 # We disable this link if the project has no products. This is for
209 # consistency with the way the overview buttons behave in the same
210 # circumstances.
211 return Link('+mentoring', text, icon='info',
212 enabled=self.context.hasProducts())
213
214 @enabled_with_permission('launchpad.Edit')205 @enabled_with_permission('launchpad.Edit')
215 def announce(self):206 def announce(self):
216 text = 'Make announcement'207 text = 'Make announcement'
217208
=== removed directory 'lib/lp/registry/stories/mentoring'
=== removed file 'lib/lp/registry/stories/mentoring/mentoring.txt'
--- lib/lp/registry/stories/mentoring/mentoring.txt 2009-06-12 16:36:02 +0000
+++ lib/lp/registry/stories/mentoring/mentoring.txt 1970-01-01 00:00:00 +0000
@@ -1,601 +0,0 @@
1= Mentorship =
2
3Launchpad allows people who are members of a team to offer to mentor anyone
4implementing a particular bug or blueprint.
5
6The menu text, and the links within a page to offer mentoring, should all
7use standardised text:
8
9 >>> menu_mentoring_offer = 'Offer mentorship'
10 >>> menu_mentoring_retract = 'Retract mentorship'
11 >>> page_mentoring_offer = 'Offer to mentor someone'
12 >>> page_mentoring_retract = 'Retract my offer of mentorship'
13
14You have to be logged in to see the offers of mentoring. Let's try viewing
15the bug and spec as an anonymous user. We should see neither the page link
16nor the menu link to offer mentoring.
17
18 >>> anon_browser.open('http://bugs.launchpad.dev/tomcat/+bug/2')
19 >>> anon_browser.getLink('Offer to mentor someone fixing this bug')
20 Traceback (most recent call last):
21 ...
22 LinkNotFoundError
23 >>> page_mentoring_offer not in anon_browser.contents
24 True
25 >>> anon_browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
26 >>> page_mentoring_offer not in anon_browser.contents
27 True
28
29However, a person who is a member of any teams should have the ability to
30offer mentorship. Since they can offer mentorship, they should not be able
31to retract it at the same time.
32
33 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
34 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/2')
35 >>> print browser.getLink(menu_mentoring_offer).url
36 http://bugs.launchpad.dev/tomcat/+bug/2/+mentor
37 >>> page_mentoring_retract in browser.contents
38 False
39 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
40 >>> page_mentoring_offer in browser.contents
41 True
42 >>> page_mentoring_retract in browser.contents
43 False
44
45We confirm that a person who is not a member of any teams will not see the
46ability to offer mentorship:
47
48 >>> browser = setupBrowser(auth="Basic no-team-memberships@test.com:test")
49 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/2')
50 >>> page_mentoring_offer in browser.contents
51 False
52 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
53 >>> page_mentoring_offer in browser.contents
54 False
55
56
57We should never see the ability to offer mentorship when the bug or
58spec is complete. For the bug, we will just take a look at Bug #8 which is
59complete.
60
61 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
62 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/8')
63 >>> browser.getLink(menu_mentoring_offer)
64 Traceback (most recent call last):
65 ...
66 LinkNotFoundError
67 >>> page_mentoring_offer in browser.contents
68 False
69
70Now let's look at a spec which is complete:
71
72 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/thinclient-local-devices')
73 >>> page_mentoring_offer in browser.contents
74 False
75
76
77In the case of bugs, we should not be able to offer mentorship on a bug
78which is a duplicate:
79
80 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/6')
81 >>> browser.getLink(menu_mentoring_offer)
82 Traceback (most recent call last):
83 ...
84 LinkNotFoundError
85 >>> page_mentoring_offer in browser.contents
86 False
87
88== Making offers of mentorship ==
89
90So, we have established that a person who is a team member can offer
91membership in the right bugs and specs. Let's make sure those pages work all
92right.
93
94First, we will make an offer of mentorship on a bug.
95
96 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
97 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/2')
98 >>> browser.getLink(menu_mentoring_offer).click()
99 >>> print browser.url
100 http://bugs.launchpad.dev/tomcat/+bug/2/+mentor
101 >>> print browser.title
102 Offer to mentor this work
103 >>> browser.getControl('Offer Mentoring').click()
104 >>> print browser.url
105 http://bugs.launchpad.dev/tomcat/+bug/2
106 >>> 'Blackhole Trash folder' in browser.title
107 True
108
109We should see the listing of mentors, now:
110
111 >>> 'Mentors:' in browser.contents
112 True
113
114And most importantly, we should no longer be able to offer mentoring on this
115bug, because we are ALREADY a mentor!
116
117 >>> browser.getLink(menu_mentoring_offer)
118 Traceback (most recent call last):
119 ...
120 LinkNotFoundError
121 >>> page_mentoring_offer not in browser.contents
122 True
123
124Similarly, because we are now a mentor, we should see a menu and page link
125which allow us to retract this offer of mentorship.
126
127 >>> print browser.getLink('Retract my offer of mentorship').url
128 http://bugs.launchpad.dev/tomcat/+bug/2/+retractmentoring
129 >>> page_mentoring_retract in browser.contents
130 True
131
132However, somebody ELSE should still be able to offer mentoring, and not yet
133retract mentoring:
134
135 >>> browser = setupBrowser(auth="Basic test@canonical.com:test")
136 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/2')
137 >>> print browser.getLink(menu_mentoring_offer).url
138 http://bugs.launchpad.dev/tomcat/+bug/2/+mentor
139 >>> browser.getLink('Retract my offer of mentorship')
140 Traceback (most recent call last):
141 ...
142 LinkNotFoundError
143 >>> page_mentoring_retract in browser.contents
144 False
145
146Now, let's repeat the whole exercise with a Blueprint.
147
148 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
149 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
150 >>> browser.getLink('Offer to mentor someone implementing this blueprint').click()
151 >>> print browser.title
152 Offer to mentor this work
153 >>> back_link = browser.getLink('Facilitate mass installs')
154 >>> back_link.url
155 'http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation'
156 >>> browser.getControl('Offer Mentoring').click()
157 >>> 'Facilitate mass installs' in browser.title
158 True
159
160We should see the listing of mentors, now:
161
162 >>> 'Mentors:' in browser.contents
163 True
164
165And most importantly, we should no longer be able to offer mentoring on this
166Blueprint, because we are ALREADY a mentor!
167
168 >>> 'Offer to mentor someone implementing this blueprint' not in browser.contents
169 True
170
171Similarly, because we are now a mentor, we should see a menu and page link
172which allow us to retract this offer of mentorship.
173
174 >>> 'Retract my offer of mentorship' in browser.contents
175 True
176
177However, somebody ELSE should still be able to offer mentoring, and not yet
178retract mentoring:
179
180 >>> browser = setupBrowser(auth="Basic test@canonical.com:test")
181 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
182 >>> 'Offer to mentor someone implementing' in browser.contents
183 True
184 >>> 'Retract my offer of mentorship' in browser.contents
185 False
186
187
188== Mentorship Listings ==
189
190OK, now we have a bunch of mentorships in the system. Let's make sure all
191the listing pages are working.
192
193First, any offers should show up on the page of the person making the offer.
194
195 >>> anon_browser.open('http://launchpad.dev/~one-membership/+mentoring')
196 >>> print anon_browser.title
197 Mentoring offered by One Membership
198 >>> 'Blackhole Trash folder' in anon_browser.contents
199 True
200 >>> 'cluster-installation' in anon_browser.contents
201 True
202
203They should also show up on the page for the team which is the beneficiary
204of this mentorship.
205
206 >>> anon_browser.open('http://launchpad.dev/~simple-team/+mentoring')
207 >>> print anon_browser.title
208 Mentoring available for newcomers to Simple Team
209 >>> 'Blackhole Trash folder' in anon_browser.contents
210 True
211 >>> 'cluster-installation' in anon_browser.contents
212 True
213
214
215There is also a listing of mentorships available for a product:
216
217 >>> anon_browser.open('http://launchpad.dev/tomcat/+mentoring')
218 >>> print anon_browser.title
219 Mentoring available in Tomcat
220 >>> 'Blackhole Trash folder' in anon_browser.contents
221 True
222
223And for a project:
224
225 >>> anon_browser.open('http://launchpad.dev/apache/+mentoring')
226 >>> print anon_browser.title
227 Mentoring available in Apache
228 >>> 'Blackhole Trash folder' in anon_browser.contents
229 True
230
231And for a distribution
232
233 >>> anon_browser.open('http://launchpad.dev/kubuntu/+mentoring')
234 >>> print anon_browser.title
235 Mentoring available in Kubuntu
236 >>> 'cluster-installation' in anon_browser.contents
237 True
238
239
240We also have the special Mentorship Manager. This is only acessible to
241launchpad Admins:
242
243 >>> user_browser.open('http://launchpad.dev/+mentoring/')
244 Traceback (most recent call last):
245 ...
246 Unauthorized:...
247
248
249When we login as an admin, we can see listed here all the outstanding
250mentorship offers:
251
252 >>> admin_browser.open('http://launchpad.dev/+mentoring/')
253 >>> print admin_browser.title
254 Mentoring available in the Launchpad Mentorship Manager
255 >>> 'Blackhole Trash folder' in admin_browser.contents
256 True
257 >>> 'cluster-installation' in admin_browser.contents
258 True
259
260
261== Mentorships on private bugs ==
262
263When a bug for which mentoring was offered is marked private, it
264will no longer show up on any of these listings.
265
266We are going to now poke into the back of the db's head, and "privatise" the
267bug we have been using.
268
269 >>> from canonical.launchpad.interfaces import (
270 ... BugTaskStatus, IPersonSet, IBugSet, IDistributionSet, ILaunchBag)
271 >>> from canonical.launchpad.ftests import login, logout, syncUpdate
272 >>> from canonical.database.sqlbase import flush_database_updates
273 >>> login('foo.bar@canonical.com')
274 >>> from zope.component import getUtility
275 >>> distroset = getUtility(IDistributionSet)
276 >>> personset = getUtility(IPersonSet)
277 >>> bugset = getUtility(IBugSet)
278 >>> foo_bar = personset.getByEmail('foo.bar@canonical.com')
279 >>> kubuntu = distroset.getByName('kubuntu')
280 >>> bug_2 = bugset.get(2)
281 >>> bug_2.private
282 False
283 >>> bug_2.setPrivate(True, getUtility(ILaunchBag).user)
284 True
285 >>> syncUpdate(bug_2)
286 >>> bug_2.private
287 True
288 >>> logout()
289
290Right, brain surgery completed. The bug is now private.
291
292This bug should not show in the "mentorship available" listing:
293
294 >>> admin_browser.open('http://launchpad.dev/+mentoring')
295 >>> print admin_browser.title
296 Mentoring available in the Launchpad Mentorship Manager
297 >>> 'Blackhole Trash folder' in admin_browser.contents
298 False
299
300 #>>> 'cluster-installation' in admin_browser.contents
301 #False
302
303Nor in any of the listings which previously showed the bug:
304
305 >>> anon_browser.open('http://launchpad.dev/~one-membership/+mentoring')
306 >>> print anon_browser.title
307 Mentoring offered by One Membership
308 >>> 'Blackhole Trash folder' in anon_browser.contents
309 False
310
311 #>>> 'cluster-installation' in anon_browser.contents
312 #False
313
314Including on the page for the team which is the beneficiary
315of this mentorship.
316
317 >>> anon_browser.open('http://launchpad.dev/~simple-team/+mentoring')
318 >>> print anon_browser.title
319 Mentoring available for newcomers to Simple Team
320 >>> 'Blackhole Trash folder' in anon_browser.contents
321 False
322
323 #>>> 'cluster-installation' in anon_browser.contents
324 #False
325
326Or the listing of mentorships available for a product:
327
328 >>> anon_browser.open('http://launchpad.dev/tomcat/+mentoring')
329 >>> print anon_browser.title
330 Mentoring available in Tomcat
331 >>> 'Blackhole Trash folder' in anon_browser.contents
332 False
333
334Or for a project:
335
336 >>> anon_browser.open('http://launchpad.dev/apache/+mentoring')
337 >>> print anon_browser.title
338 Mentoring available in Apache
339 >>> 'Blackhole Trash folder' in anon_browser.contents
340 False
341
342Or for a distribution:
343
344 >>> anon_browser.open('http://launchpad.dev/debian/+mentoring')
345 >>> print anon_browser.title
346 Mentoring available in Debian
347 >>> 'Blackhole Trash folder' in anon_browser.contents
348 False
349
350Let's make this bug public again:
351
352 >>> login('foo.bar@canonical.com')
353 >>> bug_2.setPrivate(False, getUtility(ILaunchBag).user)
354 True
355 >>> syncUpdate(bug_2)
356 >>> bug_2.private
357 False
358 >>> logout()
359
360== Completed mentorships ==
361
362When a bug or blueprint, for which mentoring was offered, is complete, it
363will no longer show up on any of these listings except for the "recent
364successes" list (if the mentorship was offered less than a year ago).
365
366We are going to now poke into the back of the db's head, and "complete" the
367bug and the blueprint we have been using.
368
369 >>> from canonical.launchpad.interfaces import (
370 ... ILaunchBag, SpecificationImplementationStatus)
371 >>> login('foo.bar@canonical.com')
372 >>> spec_1 = kubuntu.getSpecification('cluster-installation')
373 >>> bug_2.is_complete
374 False
375 >>> spec_1.is_complete
376 False
377 >>> for task in bug_2.bugtasks:
378 ... if task.conjoined_master is None:
379 ... task.transitionToStatus(
380 ... BugTaskStatus.FIXRELEASED, getUtility(ILaunchBag).user)
381 >>> flush_database_updates()
382 >>> bug_2.is_complete
383 True
384 >>> spec_1.implementation_status = \
385 ... SpecificationImplementationStatus.IMPLEMENTED
386 >>> newstate = spec_1.updateLifecycleStatus(foo_bar)
387 >>> syncUpdate(spec_1)
388 >>> spec_1.is_complete
389 True
390 >>> logout()
391
392Right, brain surgery completed. The spec and the bug are now complete.
393
394So, first, these completed items should show up in the Mentorship Manager's
395"recent successes" listing:
396
397 >>> admin_browser.open('http://launchpad.dev/+mentoring/+success')
398 >>> print admin_browser.title
399 Successful mentorships over the past year.
400 >>> 'Blackhole Trash folder' in admin_browser.contents
401 True
402 >>> 'cluster-installation' in admin_browser.contents
403 True
404
405But not in the "mentorship available" listing:
406
407 >>> admin_browser.open('http://launchpad.dev/+mentoring')
408 >>> print admin_browser.title
409 Mentoring available in the Launchpad Mentorship Manager
410 >>> 'Blackhole Trash folder' in admin_browser.contents
411 False
412 >>> 'cluster-installation' in admin_browser.contents
413 False
414
415Nor in any of the listings which previously showed these items:
416
417 >>> anon_browser.open('http://launchpad.dev/~one-membership/+mentoring')
418 >>> print anon_browser.title
419 Mentoring offered by One Membership
420 >>> 'Blackhole Trash folder' in anon_browser.contents
421 False
422 >>> 'cluster-installation' in anon_browser.contents
423 False
424
425They should also show up on the page for the team which is the beneficiary
426of this mentorship.
427
428 >>> anon_browser.open('http://launchpad.dev/~simple-team/+mentoring')
429 >>> print anon_browser.title
430 Mentoring available for newcomers to Simple Team
431 >>> 'Blackhole Trash folder' in anon_browser.contents
432 False
433 >>> 'cluster-installation' in anon_browser.contents
434 False
435
436
437There is also a listing of mentorships available for a product:
438
439 >>> anon_browser.open('http://launchpad.dev/tomcat/+mentoring')
440 >>> print anon_browser.title
441 Mentoring available in Tomcat
442 >>> 'Blackhole Trash folder' in anon_browser.contents
443 False
444
445And for a project:
446
447 >>> anon_browser.open('http://launchpad.dev/apache/+mentoring')
448 >>> print anon_browser.title
449 Mentoring available in Apache
450 >>> 'Blackhole Trash folder' in anon_browser.contents
451 False
452
453And for a distribution
454
455 >>> anon_browser.open('http://launchpad.dev/kubuntu/+mentoring')
456 >>> print anon_browser.title
457 Mentoring available in Kubuntu
458 >>> 'cluster-installation' in anon_browser.contents
459 False
460
461== Retraction of mentoring ==
462
463When an item is complete, the mentors will still be listed but you cannot
464retract mentoring that you have offered.
465
466 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
467 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
468 >>> 'Mentors:' in browser.contents
469 True
470 >>> 'Retract my offer of mentorship' in browser.contents
471 False
472 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/2')
473 >>> 'Mentors:' in browser.contents
474 True
475 >>> browser.getLink('Retract my offer of mentorship')
476 Traceback (most recent call last):
477 ...
478 LinkNotFoundError
479 >>> page_mentoring_retract in browser.contents
480 False
481
482
483Finally, though, we do want to test the retraction mechanism, so we will
484re-open the bug and change the state of the spec so that neither is
485complete. This should allow us to retract our offer of mentoring in both
486cases.
487
488 >>> login('foo.bar@canonical.com')
489 >>> for task in bug_2.bugtasks:
490 ... if task.conjoined_master is None:
491 ... task.transitionToStatus(
492 ... BugTaskStatus.CONFIRMED, getUtility(ILaunchBag).user)
493 >>> flush_database_updates()
494 >>> bug_2.is_complete
495 False
496 >>> spec_1.implementation_status = \
497 ... SpecificationImplementationStatus.NOTSTARTED
498 >>> newstate = spec_1.updateLifecycleStatus(foo_bar)
499 >>> syncUpdate(spec_1)
500 >>> spec_1.is_complete
501 False
502 >>> logout()
503
504
505Right. Let's retract the offer of mentorship from the specification. It
506should take us back to the blueprint page, and we should be able to offer
507mentoring again.
508
509 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
510 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
511 >>> browser.getLink('Retract my offer of mentorship').click()
512 >>> print browser.title
513 Retract offer of mentorship
514 >>> back_link = browser.getLink('Facilitate mass installs')
515 >>> back_link.url
516 'http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation'
517 >>> browser.getControl('Retract Mentoring').click()
518 >>> 'Facilitate mass installs' in browser.title
519 True
520 >>> 'Offer to mentor someone implementing' in browser.contents
521 True
522
523And finally let's do it on the bug.
524
525 >>> browser.open('http://bugs.launchpad.dev/tomcat/+bug/2')
526 >>> browser.getLink('Retract my offer of mentorship').click()
527 >>> print browser.title
528 Retract offer of mentorship
529 >>> browser.getControl('Retract Mentoring').click()
530 >>> 'Blackhole Trash folder' in browser.title
531 True
532 >>> print browser.getLink(menu_mentoring_offer).url
533 http://bugs.launchpad.dev/tomcat/+bug/2/+mentor
534
535
536Subscribing when offering mentorship
537====================================
538
539When you offer to mentor some work, you are offered the option to subscribe
540to that bug or blueprint. We will demonstrate this in action.
541
542 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
543 >>> browser.open('http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation')
544
545First we show that 'One Membership' is not initially a subscriber to the
546blueprint:
547
548 >>> subs = find_portlet(browser.contents, 'Subscribers')
549 >>> print subs
550 None
551
552Now we offer mentoring, and along the way we request to be subscribed:
553
554 >>> browser.getLink('Offer to mentor someone implementing this blueprint').click()
555 >>> browser.getControl(name='field.subscription_request').value = True
556 >>> browser.getControl('Offer Mentoring').click()
557 >>> browser.url
558 'http://blueprints.launchpad.dev/kubuntu/+spec/cluster-installation'
559
560And now 'One Membership' is a subscriber:
561
562 >>> subscribers = find_tags_by_class(browser.contents, 'subscriber')
563 >>> for subscriber in subscribers:
564 ... a_tags = subscriber.findAll('a')
565 ... img = a_tags[0].first('img')
566 ... print img['src'],
567 ... print a_tags[1].string
568 /@@/subscriber-inessential One Membership
569
570
571
572Now let's do the same with a bug.
573
574 >>> browser = setupBrowser(auth="Basic one-membership@test.com:test")
575 >>> browser.open('http://bugs.launchpad.dev/ubuntu/+source/linux-source-2.6.15/+bug/10')
576
577First we show that 'One Membership' is not initially a subscriber to the
578bug:
579
580 >>> from lp.bugs.tests.bug import print_direct_subscribers
581
582 >>> browser.open('http://launchpad.dev/bugs/10/+bug-portlet-subscribers-content')
583 >>> print_direct_subscribers(browser.contents)
584 Foo Bar (Subscribed by Launchpad Janitor)
585
586Now we offer mentoring, and along the way we request to be subscribed:
587
588 >>> browser.open('http://bugs.launchpad.dev/ubuntu/+source/linux-source-2.6.15/+bug/10')
589 >>> browser.getLink(menu_mentoring_offer).click()
590 >>> browser.getControl(name='field.subscription_request').value = True
591 >>> browser.getControl('Offer Mentoring').click()
592 >>> browser.url
593 'http://bugs.launchpad.dev/ubuntu/+source/linux-source-2.6.15/+bug/10'
594
595And now 'One Membership' is a subscriber:
596
597 >>> browser.open('http://launchpad.dev/bugs/10/+bug-portlet-subscribers-content')
598 >>> print_direct_subscribers(browser.contents)
599 One Membership (Subscribed themselves) (Unsubscribe One Membership)
600 Foo Bar (Subscribed by Launchpad Janitor)
601
6020
=== modified file 'lib/lp/registry/stories/project/xx-project-index.txt'
--- lib/lp/registry/stories/project/xx-project-index.txt 2009-09-10 20:12:12 +0000
+++ lib/lp/registry/stories/project/xx-project-index.txt 2009-09-14 13:07:55 +0000
@@ -101,10 +101,6 @@
101 Traceback (most recent call last):101 Traceback (most recent call last):
102 ..102 ..
103 LinkNotFoundError...103 LinkNotFoundError...
104 >>> user_browser.getLink(url='+mentoring')
105 Traceback (most recent call last):
106 ..
107 LinkNotFoundError...
108104
109Also, the bugs, blueprints, translations and answers facets will be disabled:105Also, the bugs, blueprints, translations and answers facets will be disabled:
110106
111107
=== modified file 'lib/lp/registry/stories/teammembership/xx-private-membership.txt'
--- lib/lp/registry/stories/teammembership/xx-private-membership.txt 2009-09-10 13:17:51 +0000
+++ lib/lp/registry/stories/teammembership/xx-private-membership.txt 2009-09-14 13:07:55 +0000
@@ -224,24 +224,6 @@
224 &nbsp;Other Team224 &nbsp;Other Team
225225
226226
227== Restrict Mentorship ==
228
229To prevent leaking information about a team's private membership,
230no user can select that team when offering mentorship for a bug
231or a blueprint.
232
233Even the owner of the team with private membership should not see
234MyTeam as an option in the +mentor form.
235
236 >>> owner_browser.open(
237 ... 'http://answers.launchpad.dev/firefox/+bug/1/+mentor')
238 >>> team_select = find_tag_by_id(owner_browser.contents, 'field.team')
239 >>> for option in team_select.findAll('option'):
240 ... print option['value']
241 hwdb-team
242 otherteam
243
244
245== Preventing Private Team Information Leakage ==227== Preventing Private Team Information Leakage ==
246228
247To prevent leaking information about a team's private membership,229To prevent leaking information about a team's private membership,