Merge lp:~sinzui/launchpad/system-bug-comments-api into lp:launchpad
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Curtis Hovey | ||||
Approved revision: | no longer in the source branch. | ||||
Merged at revision: | 16331 | ||||
Proposed branch: | lp:~sinzui/launchpad/system-bug-comments-api | ||||
Merge into: | lp:launchpad | ||||
Diff against target: |
73 lines (+32/-0) 3 files modified
lib/lp/bugs/tests/test_bug_messages_webservice.py (+19/-0) lib/lp/services/messages/interfaces/message.py (+9/-0) lib/lp/services/messages/model/message.py (+4/-0) |
||||
To merge this branch: | bzr merge lp:~sinzui/launchpad/system-bug-comments-api | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Brad Crittenden (community) | Approve | ||
Review via email: mp+137308@code.launchpad.net |
Commit message
Do not make links to a message's parent message.
Description of the change
A bug message is accessible over the API via two approaches. Iterating
over bug.messages or directly loading the message via its URL
(eg, +bug/1004834/
NoCanonicalUrl (OOPS-2f0df95d0ba20796d46cfe2a1b3c3fa1) because the parent
message is not one of the bug's messages, it it does not have an index number.
bug.message returns IIndexedMessage which sets the parent to None to enforce
non-threaded messaging in bugs, but the latter case an IMessage which is
threaded. Both IIndexedMessage and IMessage claim to be bug messages, but
we know that the DB is storing all messages in the table.
-------
RULES
Pre-
* IMessage was exported as an accident of exporting bug messages, and
they are now permanently in the API. They claim to just be bug messages
as can be seen by their URL.
* Since bug messages are not threaded, and we cannot unexport the
parent attribute, we can follow IIndexedMessage's example by ensuring
None is the value returned.
* Export a replacement parent attr on the API that retrofits the beta
api to return None.
QA
* visit https:/
* Verify the page loads.
LoC
I have a 16,000 line credit this week.
LINT
lib/
lib/
lib/
TEST
./bin/test -vvc -t MessageTraversal lp.bugs.
IMPLEMENTATION
I added getAPIParent to IMessage and exported it using accessor_
to ensure the API never sees a parent message.
lib/
lib/
lib/
Hi Curtis,
* typo: representtion
* typo: s/it is might/it might
Otherwise it looks good. Thanks.