~launchpad-pqm/launchpad/devel

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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
Filebug view classes
====================

The base class used for all the filebug pages is FileBugViewBase. It
contains enough functionality to file bug, the classes inheriting from
it only adds some more functionality, like adding fields, searching for
similar bug reports, etc.

    >>> from lp.services.webapp.servers import LaunchpadTestRequest
    >>> from lp.bugs.browser.bugtarget import FileBugViewBase
    >>> from lp.registry.interfaces.distribution import IDistributionSet
    >>> ubuntu = getUtility(IDistributionSet).getByName('ubuntu')
    >>> ubuntu_firefox = ubuntu.getSourcePackage('mozilla-firefox')
    >>> bug_data = dict(
    ...     title='Test Title', comment='Test description.')

We define a helper method here so that we can instantiate
FileBugViewBase and use it without any errors occuring, since we're
bypassing most of the view machinery. We also define a mock widget class
for the same purpose.

    >>> class MockWidget:
    ...     def __init__(self, name):
    ...         self.name = name

    >>> def create_view(context, request):
    ...     view = FileBugViewBase(context, request)
    ...     view.widgets = {
    ...         'filecontent': MockWidget(name='filecontent')}
    ...     return view

The validate and action don't use the request when filing the bug, so we
can pass an empty request and pass the data dict to the methods
directly.

    >>> login('no-priv@canonical.com')
    >>> filebug_view = create_view(ubuntu_firefox, LaunchpadTestRequest())
    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> filebug_view.added_bug.description
    u'Test description.'


URLs to additional FileBug elements
-----------------------------------

FileBugViewBase's inline_filebug_base_url returns the base URL for all
inline +filebug work.

    >>> from lp.registry.interfaces.product import IProductSet
    >>> firefox = getUtility(IProductSet).getByName('firefox')
    >>> filebug_view = create_initialized_view(
    ...     firefox, '+filebug')

This property returns the root URL of the current request, so in the
case of this test will return 127.0.0.1.

    >>> print filebug_view.inline_filebug_base_url
    http://127.0.0.1/

FileBugViewBase provides properties that return the URLs of further
useful parts of the +filebug process.

The inline_filebug_form_url property returns the URL of the inline
filebug form so that it may be loaded asynchronously.

    >>> print filebug_view.inline_filebug_form_url
    http://launchpad.dev/firefox/+filebug-inline-form

Similarly, the duplicate_search_url property returns the base URL for
the duplicate search view, which can be used to load the list of
possible duplicates for a bug asynchronously.

    >>> print filebug_view.duplicate_search_url
    http://launchpad.dev/firefox/+filebug-show-similar

For project groups, the URLs returned will refer to the default product
for those project groups.

    >>> from lp.registry.interfaces.projectgroup import IProjectGroupSet
    >>> gnome_project = getUtility(IProjectGroupSet).getByName('gnome')
    >>> gnome_filebug_view = create_initialized_view(
    ...     gnome_project, '+filebug')

    >>> print gnome_filebug_view.inline_filebug_form_url
    http://launchpad.dev/evolution/+filebug-inline-form

    >>> print gnome_filebug_view.duplicate_search_url
    http://launchpad.dev/evolution/+filebug-show-similar


Adding extra info to filed bugs
-------------------------------

It's possible for bug reporting tools to upload a file with debug
information to Launchpad, and pass that information to the filebug page.
When the data is uploaded a token is returned, which is appended to the
+filebug URL, resulting in a URL like '/.../+filebug/12345abcde'. The
+filebug view's publishTraverse method looks up the correct data from
using the token.

The uploaded debug information should be MIME multipart message, where
the Content-Disposition header tells Launchpad what to do with the
different parts.


First inline part
.................

The first inline part will be appended to the bug description.

    >>> debug_data = """MIME-Version: 1.0
    ... Content-type: multipart/mixed; boundary=boundary
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This should be added to the description.
    ...
    ... --boundary--
    ... """
    >>> import transaction
    >>> from lp.services.temporaryblobstorage.interfaces import ITemporaryStorageManager
    >>> token = getUtility(ITemporaryStorageManager).new(debug_data)

We need to commit the transaction since the data will be stored in the
Librarian.

    >>> transaction.commit()

The data is processed by a ProcessApportBlobJob, which the filebug view
can then access to get the parsed data. We'll define a helper method for
processing the blob.

    >>> from zope.component import getUtility
    >>> from lp.bugs.interfaces.apportjob import IProcessApportBlobJobSource

    >>> def process_blob(token):
    ...     blob = getUtility(ITemporaryStorageManager).fetch(token)
    ...     job = getUtility(IProcessApportBlobJobSource).create(blob)
    ...     job.job.start()
    ...     job.run()
    ...     job.job.complete()
    >>> process_blob(token)

Now, if we pass the token to the filebug view, the extra_data attribute
will be set with the actual data.

    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(
    ...     filebug_view.request, token) is filebug_view
    True

    >>> filebug_view.extra_data.extra_description
    u'This should be added to the description.'

    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> print filebug_view.added_bug.description #doctest: -NORMALIZE_WHITESPACE
    Test description.
    <BLANKLINE>
    This should be added to the description.

A notification was added to inform the user about what happened.

    >>> for notification in filebug_view.request.response.notifications:
    ...     print notification.message
    <p class="last">Thank you for your bug report.</p>
    Additional information was added to the bug description.


Other inline parts
..................

If there are more than one inline part, those will be added as comments
to the bug.

    >>> debug_data = """MIME-Version: 1.0
    ... Content-type: multipart/mixed; boundary=boundary
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This should be added to the description.
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This should be added as a comment.
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This should be added as another comment.
    ...
    ... --boundary--
    ... """
    >>> token = getUtility(ITemporaryStorageManager).new(debug_data)
    >>> transaction.commit()

    >>> process_blob(token)
    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request,
    ...     token) is filebug_view
    True

    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)

    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> print filebug_view.added_bug.description #doctest: -NORMALIZE_WHITESPACE
    Test description.
    <BLANKLINE>
    This should be added to the description.

    >>> for comment in filebug_view.added_bug.messages[1:]:
    ...     print "Comment by %s: %s" % (
    ...         comment.owner.displayname, comment.text_contents)
    Comment by No Privileges Person: This should be added as a comment.
    Comment by No Privileges Person: This should be added as another comment.

Notifications were added to inform the user about what happened.

    >>> for notification in filebug_view.request.response.notifications:
    ...     print notification.message
    <p class="last">Thank you for your bug report.</p>
    Additional information was added to the bug description.
    A comment with additional information was added to the bug report.
    A comment with additional information was added to the bug report.


Attachments
...........

All the parts that have a 'Content-disposition: attachment' header will
get added as attachments to the bug. The attachment description can be
specified using a Content-description header, but it's not required.

    >>> debug_data = """MIME-Version: 1.0
    ... Content-type: multipart/mixed; boundary=boundary
    ...
    ... --boundary
    ... Content-disposition: attachment; filename='attachment1'
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This is an attachment.
    ...
    ... --boundary
    ... Content-disposition: attachment; filename='attachment2'
    ... Content-description: Attachment description.
    ... Content-type: text/plain; charset=ISO-8859-1
    ... 
    ... This is another attachment, with a description.
    ...
    ... --boundary--
    ... """
    >>> token = getUtility(ITemporaryStorageManager).new(debug_data)
    >>> transaction.commit()

    >>> process_blob(token)
    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request,
    ...     token) is filebug_view
    True

    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)

Since the attachments are stored in the Librarian, we need to commit the
transaction in order to access them.

    >>> transaction.commit()

    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> print filebug_view.added_bug.description
    Test description.

The attachments got added, with the charsets preserved, and the one that
didn't specify a description got an autogenerated one.

    >>> for attachment in filebug_view.added_bug.attachments_unpopulated:
    ...     print "Filename: %s" % attachment.libraryfile.filename
    ...     print "Content type: %s" % attachment.libraryfile.mimetype
    ...     print "Description: %s" % attachment.title
    ...     print "Contents:\n%s" % attachment.libraryfile.read()
    ...     print
    Filename: attachment1
    Content type: text/plain; charset=utf-8
    Description: attachment1
    Contents:
    This is an attachment.
    <BLANKLINE>
    Filename: attachment2
    Content type: text/plain; charset=ISO-8859-1
    Description: Attachment description.
    Contents:
    This is another attachment, with a description.
    <BLANKLINE>

Notifications were added to inform the user about what happened.

    >>> for notification in filebug_view.request.response.notifications:
    ...     print notification.message
    <p class="last">Thank you for your bug report.</p>
    The file "attachment1" was attached to the bug report.
    The file "attachment2" was attached to the bug report.

The attachments are all added to the same comment.

    >>> for comment in filebug_view.added_bug.messages[1:]:
    ...     print "Comment by %s: %s attachment(s)" % (
    ...         comment.owner.displayname, comment.bugattachments.count())
    Comment by No Privileges Person: 2 attachment(s)


Private Bugs
............

We can specify whether a bug is private by providing Private field in
the message.

    >>> debug_data = """MIME-Version: 1.0
    ... Content-type: multipart/mixed; boundary=boundary
    ... Private: yes
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This bug should be private.
    ...
    ... --boundary--
    ... """
    >>> token = getUtility(ITemporaryStorageManager).new(debug_data)
    >>> transaction.commit()

    >>> process_blob(token)
    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request,
    ...     token) is filebug_view
    True

    >>> filebug_view.extra_data.extra_description
    u'This bug should be private.'

    >>> filebug_view.extra_data.private
    True

    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> print filebug_view.added_bug.description #doctest: -NORMALIZE_WHITESPACE
    Test description.
    <BLANKLINE>
    This bug should be private.

    >>> filebug_view.added_bug.private
    True

    >>> filebug_view.added_bug.security_related
    False

Since the bug was marked private before it was filed, only the bug
reporter has been subscribed to the bug and there should be no indirect
subscribers.

    >>> for subscriber in filebug_view.added_bug.getDirectSubscribers():
    ...     print subscriber.displayname
    No Privileges Person

    >>> filebug_view.added_bug.getIndirectSubscribers()
    []

The user will be notified that the bug has been marked as private.

    >>> print filebug_view.request.response.notifications[2].message
    This bug report has been marked private...

We can also specify that a bug is public via the same field.

    >>> debug_data = """MIME-Version: 1.0
    ... Content-type: multipart/mixed; boundary=boundary
    ... Private: no
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This bug should be public.
    ...
    ... --boundary--
    ... """
    >>> token = getUtility(ITemporaryStorageManager).new(debug_data)
    >>> transaction.commit()

    >>> process_blob(token)
    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request,
    ...     token) is filebug_view
    True

    >>> filebug_view.extra_data.extra_description
    u'This bug should be public.'

    >>> filebug_view.extra_data.private
    False

    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> print filebug_view.added_bug.description #doctest: -NORMALIZE_WHITESPACE
    Test description.
    <BLANKLINE>
    This bug should be public.

    >>> filebug_view.added_bug.private
    False

Since this bug is public, both the reporter and the bug supervisor have
been subscribed.

    >>> for subscriber in filebug_view.added_bug.getDirectSubscribers():
    ...     print subscriber.displayname
    No Privileges Person

    >>> for subscriber in filebug_view.added_bug.getIndirectSubscribers():
    ...     print subscriber.displayname
    Foo Bar
    Ubuntu Team


Subscriptions
.............

We can also subscribe someone to this bug when we file it by using a
Subscribe field in the message. Multiple people can be specified and
they can be identified by their Launchpad name or their e-mail address.

    >>> debug_data = """MIME-Version: 1.0
    ... Content-type: multipart/mixed; boundary=boundary
    ... Subscribers: ddaa test@canonical.com
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... Other people are interested in this bug.
    ...
    ... --boundary--
    ... """
    >>> token = getUtility(ITemporaryStorageManager).new(debug_data)
    >>> transaction.commit()

    >>> process_blob(token)
    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request,
    ...     token) is filebug_view
    True

    >>> filebug_view.extra_data.extra_description
    u'Other people are interested in this bug.'

    >>> for subscriber in filebug_view.extra_data.subscribers:
    ...     print subscriber
    ddaa
    test@canonical.com

    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> print filebug_view.added_bug.description #doctest: -NORMALIZE_WHITESPACE
    Test description.
    <BLANKLINE>
    Other people are interested in this bug.

As well as the reporter, both Sample Person and David Allouche have been
subscribed to the bug.

    >>> for subscriber in filebug_view.added_bug.getDirectSubscribers():
    ...     print subscriber.displayname
    David Allouche
    No Privileges Person
    Sample Person

The user will be notified that Sample Person and David Allouche has been
subscribed to this bug.

    >>> for notification in filebug_view.request.response.notifications:
    ...     print notification.message
    <p class="last">Thank you for your bug report.</p>
    Additional information was added to the bug description.
    David Allouche has been subscribed to this bug.
    Sample Person has been subscribed to this bug.


Subscribers to Private bugs
...........................

The Private and Subscriber fields are intended to be used together to
subscribe certain people and teams to bugs when they are filed.

    >>> debug_data = """MIME-Version: 1.0
    ... Content-type: multipart/mixed; boundary=boundary
    ... Private: yes
    ... Subscribers: mark
    ...
    ... --boundary
    ... Content-disposition: inline
    ... Content-type: text/plain; charset=utf-8
    ... 
    ... This bug should be private, and Mark Shuttleworth subscribed.
    ...
    ... --boundary--
    ... """
    >>> token = getUtility(ITemporaryStorageManager).new(debug_data)
    >>> transaction.commit()

    >>> process_blob(token)
    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request,
    ...     token) is filebug_view
    True

    >>> filebug_view.extra_data.extra_description
    u'This bug should be private, and Mark Shuttleworth subscribed.'

    >>> filebug_view.extra_data.private
    True

    >>> for subscriber in filebug_view.extra_data.subscribers:
    ...     print subscriber
    mark

    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> print filebug_view.added_bug.description #doctest: -NORMALIZE_WHITESPACE
    Test description.
    <BLANKLINE>
    This bug should be private, and Mark Shuttleworth subscribed.

    >>> filebug_view.added_bug.private
    True

    >>> filebug_view.added_bug.security_related
    False

As well as the reporter, Mark Shuttleworth should have been subscribed
to the bug.

    >>> for subscriber in filebug_view.added_bug.getDirectSubscribers():
    ...     print subscriber.displayname
    Mark Shuttleworth
    No Privileges Person

Since the bug is private, there should be no indirect subscribers.

    >>> filebug_view.added_bug.getIndirectSubscribers()
    []

The user will be notified that Mark Shuttleworth has been subscribed to
this bug and that the bug has been marked as private.

    >>> for notification in filebug_view.request.response.notifications:
    ...     print notification.message
    <p class="last">Thank you for your bug report.</p>
    Additional information was added to the bug description.
    Mark Shuttleworth has been subscribed to this bug.
    This bug report has been marked private...


publishTraverse()
-----------------

As already seen above, it's the FileBugViewBase's publishTraverse that
finds the right blob to use.

    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request,
    ...     token) is filebug_view
    True

    >>> filebug_view.extra_data_token == token
    True

    >>> filebug_view.extra_data is not None
    True

Since the view itself is returned, it will handle further traversals as
well, so if we call the method again, it represents a URL like
'.../+filebug/token/foo', which should raise a NotFound error.

    >>> filebug_view.publishTraverse(filebug_view.request, token)
    Traceback (most recent call last):
    ...
    NotFound:...


Not found tokens
................

If publishTraverse is called with a token that can't be found, a
NotFound error is raised.

    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.publishTraverse(filebug_view.request, 'no-such-token')
    Traceback (most recent call last):
    ...
    NotFound:...


Adding tags to filed bugs
-------------------------

    >>> bug_data = dict(
    ...     title=u'Test Title', comment=u'Test description.',
    ...     tags=[u'foo', u'bar'])

The validate and action don't use the request when filing the bug, so we
can pass an empty request and pass the data dict to the methods
directly.

    >>> login('no-priv@canonical.com')
    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Test Title'

    >>> filebug_view.added_bug.description
    u'Test description.'

    >>> for tag in filebug_view.added_bug.tags:
    ...     print tag
    bar
    foo


Filing security bugs
--------------------

The base class allows security bugs to be filed.

    >>> bug_data = dict(
    ...     title=u'Security bug', comment=u'Test description.',
    ...     security_related=True)

    >>> filebug_view = create_initialized_view(ubuntu_firefox, '+filebug')
    >>> filebug_view.validate(bug_data) is None
    True

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> filebug_view.added_bug.title
    u'Security bug'

    >>> filebug_view.added_bug.security_related
    True


Extra fields for privileged users
---------------------------------

Privileged users are offered several extra options when filing bugs.

    >>> owner = factory.makePerson(name=u'bug-superdude')
    >>> person = factory.makePerson()
    >>> product = factory.makeProduct(owner=owner)

    >>> login_person(person)
    >>> filebug_view = create_initialized_view(product, '+filebug')
    >>> normal_fields = set(filebug_view.field_names)
    >>> login_person(owner)
    >>> filebug_view = create_initialized_view(product, '+filebug')
    >>> owner_fields = set(filebug_view.field_names)
    >>> product.setBugSupervisor(owner, owner)
    >>> supervisor_fields = set(filebug_view.field_names)

Privileged users get all the same fields as normal users, plus a few extra.

    >>> owner_fields == supervisor_fields
    True
    >>> supervisor_fields.issuperset(normal_fields)
    True

    >>> for field in sorted(supervisor_fields - normal_fields):
    ...     print field
    assignee
    importance
    milestone
    status

Bugs can be filed with settings for all these extra fields.

    >>> from lp.bugs.interfaces.bugtask import (
    ...     BugTaskImportance, BugTaskStatus)

    >>> milestone = factory.makeMilestone(
    ...     product=product, name=u'bug-superdude-milestone')

    >>> bug_data = dict(
    ...     title=u'Extra Fields Bug', comment=u'Test description.',
    ...     assignee=owner, importance=BugTaskImportance.HIGH,
    ...     milestone=milestone, status=BugTaskStatus.TRIAGED)
    >>> print filebug_view.validate(bug_data)
    None

    >>> filebug_view.submit_bug_action.success(bug_data)
    >>> [added_bugtask] = filebug_view.added_bug.bugtasks

    >>> print added_bugtask.status.title
    Triaged

    >>> print added_bugtask.importance.title
    High

    >>> print added_bugtask.assignee.name
    bug-superdude

    >>> print added_bugtask.milestone.name
    bug-superdude-milestone