Merge lp://staging/~bryce/launchpad/api-docs-fixes-bug into lp://staging/launchpad

Proposed by Bryce Harrington
Status: Merged
Approved by: Bryce Harrington
Approved revision: no longer in the source branch.
Merged at revision: 10960
Proposed branch: lp://staging/~bryce/launchpad/api-docs-fixes-bug
Merge into: lp://staging/launchpad
Diff against target: 231 lines (+30/-22)
9 files modified
lib/lp/bugs/browser/bug.py (+1/-1)
lib/lp/bugs/doc/bugmessage.txt (+1/-1)
lib/lp/bugs/interfaces/bug.py (+20/-12)
lib/lp/bugs/interfaces/bugtask.py (+1/-1)
lib/lp/bugs/interfaces/malone.py (+1/-1)
lib/lp/code/doc/branch-visibility.txt (+1/-1)
lib/lp/code/model/tests/test_branchnamespace.py (+3/-3)
lib/lp/code/stories/branches/xx-branch-edit-privacy.txt (+1/-1)
lib/lp/registry/browser/team.py (+1/-1)
To merge this branch: bzr merge lp://staging/~bryce/launchpad/api-docs-fixes-bug
Reviewer Review Type Date Requested Status
Eleanor Berger (community) code Approve
Review via email: mp+25798@code.staging.launchpad.net

Commit message

Flesh out docs for interfaces/bugs.py and fix various spelling errors.

Description of the change

Further improvements to the API documentation and spelling fixes.

Most notably includes fleshing out docs of interfaces/bugs.py, and fixing the spelling of 'visiblity' which appears throughout the codebase including in a user-visible string (reported as bug #455203), and clarifying that setCommentVisibility() is an admin-only function (#373508).

To post a comment you must log in.
Revision history for this message
Eleanor Berger (intellectronica) wrote :

Bryce, all-in-all very nice improvements. There are a few potential problems though, resulting from the way interfaces are used in the UI. In Zope (and Launchpad), the same interfaces that are used to define objects can be used for publishing these objects. Many Launchpad forms, for example, use the Description attribute of fields to render the descriptive text next the field (the same goes for Title). The advantage of this approach is that you don't need to describe the same field twice. The disadvantage, is that the title and description you use must be appropriate both for use in the model and for use in the UI. Some of the titles and descriptions you've added might not be appropriate for the UI (the description for tags, for example, that appears on a bug's +edit page). For the same reason, some of the changes you've made are likely to require changes to pagetests, which I think you haven't adjusted yet in this branch. I think that the changes are good in most cases, but let's go once over the visible changes and make sure they work fine, and perhaps also submit this for UI-review.

b.t.w If you find places where you think the description should be different, all hope is not lost - it is still possible to customize the appearance of fields in the UI by changing them in the relevant classes in the the browser package.

review: Needs Information (code)
Revision history for this message
Bryce Harrington (bryce) wrote :

Hrm, that's distressing. Is there any way to differentiate between items that only show up on the API docs vs. ones that also show up in the web UI?

Personally, while it seems convenient and time-saving to reuse the web UI strings for the API docs, if the side-effect is making it harder to update the API docs, then it sort of seems like there is a risk that people will be reticent to improve the documentation for the API calls, lest it risk impacting the web UI.

Anyway, if I can find a way to discern which strings are used by the web UI, I can strip out those changes from this branch.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

Bryce, with the docstrings you've removed from the diff you can land this branch. Thanks for improving the API documentation, I know for sure that it makes life much better for users.

For the future, I think it's still worth trying to come up with a way to update the documentation for only the API (without affecting the documentation of the interface itself). Perhaps by adding a new decorator, or passing an extra description to the `exported` decorator - that way you'll be able to provide even better documentation to the API which now you must avoid.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.