Merge lp:~bryce/launchpad/api-doc-fixes into lp:launchpad

Proposed by Bryce Harrington
Status: Merged
Approved by: Bryce Harrington
Approved revision: no longer in the source branch.
Merged at revision: 10882
Proposed branch: lp:~bryce/launchpad/api-doc-fixes
Merge into: lp:launchpad
Diff against target: 122 lines (+36/-12)
2 files modified
lib/lp/bugs/interfaces/bugtarget.py (+3/-3)
lib/lp/bugs/interfaces/bugtask.py (+33/-9)
To merge this branch: bzr merge lp:~bryce/launchpad/api-doc-fixes
Reviewer Review Type Date Requested Status
Abel Deuring (community) code Approve
Review via email: mp+24786@code.launchpad.net

Commit message

Improve the bugtask searchTask() parameter documentation, to clarify some items and fill in stub text.

Description of the change

This fills in stub docs for some of the bugtask search fields and makes them a bit more consistent with other api documentation.

To post a comment you must log in.
Revision history for this message
Abel Deuring (adeuring) wrote :

Hi Bryce,

thanks for improving and cleaning up the docs!

I have mostly formal nitpicks: "make lint" says that several lines are too long:

lib/lp/bugs/interfaces/bugtask.py
    780: [C0301] Line too long (87/78)
    789: [C0301] Line too long (90/78)
    822: [C0301] Line too long (97/78)
    827: [C0301] Line too long (190/78)
    834: [C0301] Line too long (90/78)
    842: [C0301] Line too long (87/78)
    864: [C0301] Line too long (136/78)

Could you break the string up so that the line length does not exceed 78 characters? Our typical style looks like this:

    status = List(
        title=_('Status'),
        description=_(
            'Show only bugs with the given status value or list of values.'),
        value_type=Choice(
            title=_('Status'),
            vocabulary=BugTaskStatusSearch,
            default=BugTaskStatusSearch.NEW),
        default=list(DEFAULT_SEARCH_BUGTASK_STATUSES),
        required=False)
    importance = List(
        title=_('Importance'),
        description=_(
            'Show only bugs with the given importance or list of '
            'importances.'),
        value_type=IBugTask['importance'],
        required=False)

> @@ -800,7 +806,7 @@
> statusexplanation = TextLine(
> title=_("Status notes"), required=False)
> has_patch = Bool(
> - title=_('Show only bugs with patches available'), required=False,
> + title=_('Show only bugs with patch attachments.'), required=False,
> default=False)

I am not sure if we should combine the words "patch" and "attachment" in this context: A bug page has two portlets called "patches" and "bug attachments", thus distiguishing between patches and other|ordinary|regular attachments. Naive users might be confused by the term "patch attachment": does it means only patches, or does it mean patches aand/or other attchments? I would prefer to keep the old text to avoid this possible confusion. Alternatively, we could change the text in the portlets to "patch attachments" and "non-patch attachments" or "other attachments" or similar for the sake of consistency and to make the distinction between patches and other attachments more obvious.

Revision history for this message
Bryce Harrington (bryce) wrote :

Thanks Abel,

1. I've wrapped the lines and re-checked with make lint.

2. I reverted back to the old wording for 'with patches available'

Revision history for this message
Abel Deuring (adeuring) wrote :

Hi Bryce,

thanks for the additional changes! The branch looks good now

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/interfaces/bugtarget.py'
2--- lib/lp/bugs/interfaces/bugtarget.py 2010-04-13 16:49:31 +0000
3+++ lib/lp/bugs/interfaces/bugtarget.py 2010-05-08 01:43:41 +0000
4@@ -156,12 +156,12 @@
5 hardware_is_linked_to_bug=Bool(
6 title=(
7 u"Search for bugs which are linked to hardware reports "
8- "wich contain the given device or whcih contain a device"
9- "contolled by the given driver."),
10+ "which contain the given device or whcih contain a device"
11+ "controlled by the given driver."),
12 required=False),
13 linked_branches=Choice(
14 title=(
15- u"Search for bugs that are linked to branches or for bugs"
16+ u"Search for bugs that are linked to branches or for bugs "
17 "that are not linked to branches."),
18 vocabulary=BugBranchSearch, required=False))
19 @operation_returns_collection_of(IBugTask)
20
21=== modified file 'lib/lp/bugs/interfaces/bugtask.py'
22--- lib/lp/bugs/interfaces/bugtask.py 2010-04-19 14:47:49 +0000
23+++ lib/lp/bugs/interfaces/bugtask.py 2010-05-08 01:43:41 +0000
24@@ -774,9 +774,11 @@
25
26 class IBugTaskSearchBase(Interface):
27 """The basic search controls."""
28- searchtext = TextLine(title=_("Bug ID or text:"), required=False)
29+ searchtext = TextLine(title=_("Bug ID or search text."), required=False)
30 status = List(
31 title=_('Status'),
32+ description=_('Show only bugs with the given status value '
33+ 'or list of values.'),
34 value_type=Choice(
35 title=_('Status'),
36 vocabulary=BugTaskStatusSearch,
37@@ -785,14 +787,20 @@
38 required=False)
39 importance = List(
40 title=_('Importance'),
41+ description=_('Show only bugs with the given importance'
42+ 'or list of importances.'),
43 value_type=IBugTask['importance'],
44 required=False)
45 assignee = Choice(
46- title=_('Assignee'), vocabulary='ValidAssignee', required=False)
47+ title=_('Assignee'),
48+ description=_('Person entity assigned for this bug.'),
49+ vocabulary='ValidAssignee', required=False)
50 bug_reporter = Choice(
51- title=_('Bug Reporter'), vocabulary='ValidAssignee', required=False)
52+ title=_('Bug reporter'),
53+ description=_('Person entity that filed the bug report.'),
54+ vocabulary='ValidAssignee', required=False)
55 omit_dupes = Bool(
56- title=_('Omit duplicate bugs'), required=False,
57+ title=_('Omit bugs marked as duplicate,'), required=False,
58 default=True)
59 omit_targeted = Bool(
60 title=_('Omit bugs targeted to series'), required=False,
61@@ -800,7 +808,7 @@
62 statusexplanation = TextLine(
63 title=_("Status notes"), required=False)
64 has_patch = Bool(
65- title=_('Show only bugs with patches available'), required=False,
66+ title=_('Show only bugs with patches available.'), required=False,
67 default=False)
68 has_no_package = Bool(
69 title=_('Exclude bugs with packages specified'),
70@@ -808,24 +816,38 @@
71 milestone_assignment = Choice(
72 title=_('Target'), vocabulary="Milestone", required=False)
73 milestone = List(
74- title=_('Target'), value_type=IBugTask['milestone'], required=False)
75+ title=_('Milestone'),
76+ description=_('Show only bug tasks targeted to this milestone.'),
77+ value_type=IBugTask['milestone'], required=False)
78 component = List(
79- title=_('Component'), value_type=IComponent['name'], required=False)
80+ title=_('Component'),
81+ description=_('Distribution package archive grouping. '
82+ 'E.g. main, universe, multiverse'),
83+ value_type=IComponent['name'], required=False)
84 tag = List(title=_("Tag"), value_type=SearchTag(), required=False)
85 status_upstream = List(
86- title=_('Status Upstream'),
87+ title=_('Status upstream'),
88+ description=_('Indicates the status of any remote watches '
89+ 'associated with the bug. Possible values '
90+ 'include: pending_bugwatch, hide_upstream, '
91+ 'resolved_upstream, and open_upstream.'),
92 value_type=Choice(vocabulary=UPSTREAM_STATUS_VOCABULARY),
93 required=False)
94 has_cve = Bool(
95 title=_('Show only bugs associated with a CVE'), required=False)
96 bug_supervisor = Choice(
97 title=_('Bug supervisor'), vocabulary='ValidPersonOrTeam',
98+ description=_('Show only bugs in packages this person or team '
99+ 'is subscribed to.'),
100 required=False)
101 bug_commenter = Choice(
102 title=_('Bug commenter'), vocabulary='ValidPersonOrTeam',
103+ description=_('Show only bugs commented on by this person.'),
104 required=False)
105 subscriber = Choice(
106 title=_('Bug subscriber'), vocabulary='ValidPersonOrTeam',
107+ description=_('Show only bugs this person or team '
108+ 'is directly subscribed to.'),
109 required=False)
110 affects_me = Bool(
111 title=_('Show only bugs affecting me'), required=False)
112@@ -847,7 +869,9 @@
113 one value can be selected.)
114 """
115 tag = List(
116- title=_("Tags"), description=_("Separated by whitespace."),
117+ title=_("Tags"),
118+ description=_("String or list of strings for tags to search. "
119+ "To exclude, prepend a '-', e.g. '-unwantedtag'"),
120 value_type=SearchTag(), required=False)
121 tags_combinator = Choice(
122 title=_("Tags combination"),