1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
= Bug Privileged Statuses =
Some statuses, e.g. Won't Fix, are restricted. Only members of the Bug
Supervisor team may change a bug to that status.
>>> from lp.bugs.tests.bug import print_bug_affects_table
>>> def print_highlighted_bugtask(browser):
... print_bug_affects_table(browser.contents, highlighted_only=True)
== Unprivileged users ==
>>> user_browser.open(
... 'http://bugs.launchpad.dev/ubuntu/+source/'
... 'mozilla-firefox/+bug/1/+editstatus')
>>> status_control = user_browser.getControl('Status')
>>> print status_control.displayValue
['New']
An unprivileged user can confirm the bug:
>>> status_control.displayValue = ['Confirmed']
>>> user_browser.getControl('Save Changes').click()
>>> print user_browser.url
http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/1
>>> print_highlighted_bugtask(user_browser)
mozilla-firefox (Ubuntu) ... Confirmed Medium Unassigned ...
But he cannot change the status to Won't Fix or to Triaged, and so
those statuses are not shown in the UI:
>>> user_browser.open(
... 'http://bugs.launchpad.dev/ubuntu/+source/'
... 'mozilla-firefox/+bug/1/+editstatus')
>>> status_control = user_browser.getControl('Status')
>>> print status_control.displayValue
['Confirmed']
>>> status_control.displayValue = ["Won't Fix"]
Traceback (most recent call last):
...
ItemNotFoundError: Won't Fix
>>> status_control.displayValue = ["Triaged"]
Traceback (most recent call last):
...
ItemNotFoundError: Triaged
== Bug Supervisor ==
Ubuntu needs a Bug Supervisor first of all:
>>> admin_browser.open('http://bugs.launchpad.dev/ubuntu/+bugsupervisor')
>>> admin_browser.getControl('Bug Supervisor').value = (
... 'test@canonical.com')
>>> admin_browser.getControl('Change').click()
>>> print extract_text(find_tag_by_id(admin_browser.contents, 'bug-supervisor'))
Bug supervisor:
Sample Person
The new Bug Supervisor for Ubuntu can change the status to Won't Fix:
>>> bug_supervisor_browser = setupBrowser(
... auth='Basic test@canonical.com:test')
>>> bug_supervisor_browser.open(
... 'http://bugs.launchpad.dev/ubuntu/+source/'
... 'mozilla-firefox/+bug/1/+editstatus')
>>> status_control = bug_supervisor_browser.getControl('Status')
>>> print status_control.displayValue
['Confirmed']
>>> status_control.displayValue = ["Won't Fix"]
>>> bug_supervisor_browser.getControl('Save Changes').click()
>>> print bug_supervisor_browser.url
http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/1
>>> print_highlighted_bugtask(bug_supervisor_browser)
mozilla-firefox (Ubuntu) ... Won't Fix Medium Unassigned ...
Now the bug has been changed, a regular user can see the Won't Fix
status. Earlier it was not even displayed as an option.
>>> user_browser.open(
... 'http://bugs.launchpad.dev/ubuntu/+source/'
... 'mozilla-firefox/+bug/1/+editstatus')
>>> status_control = user_browser.getControl('Status')
>>> print status_control.displayValue
["Won't Fix"]
And a regular user can change other aspects of the bug:
>>> package_control = user_browser.getControl(
... name='ubuntu_mozilla-firefox.target.package')
>>> print package_control.value
mozilla-firefox
>>> package_control.value = 'iceweasel'
>>> user_browser.getControl('Save Changes').click()
>>> print bug_supervisor_browser.url
http://bugs.launchpad.dev/ubuntu/+source/mozilla-firefox/+bug/1
>>> print_highlighted_bugtask(bug_supervisor_browser)
mozilla-firefox (Ubuntu) ... Won't Fix Medium Unassigned ...
The Bug Supervisor for Ubuntu can also change the status to Triaged:
>>> bug_supervisor_browser.open(
... 'http://bugs.launchpad.dev/ubuntu/+source/'
... 'iceweasel/+bug/1/+editstatus')
>>> status_control = bug_supervisor_browser.getControl('Status')
>>> print status_control.displayValue
["Won't Fix"]
>>> status_control.displayValue = ["Triaged"]
>>> bug_supervisor_browser.getControl('Save Changes').click()
>>> print bug_supervisor_browser.url
http://bugs.launchpad.dev/ubuntu/+source/iceweasel/+bug/1
>>> print_highlighted_bugtask(bug_supervisor_browser)
iceweasel (Ubuntu) ... Triaged Medium Unassigned ...
|