Merge lp:~jtv/launchpad/bug-798297 into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Jeroen T. Vermeulen |
Approved revision: | no longer in the source branch. |
Merged at revision: | 13381 |
Proposed branch: | lp:~jtv/launchpad/bug-798297 |
Merge into: | lp:launchpad |
Diff against target: |
383 lines (+224/-6) 8 files modified
lib/canonical/launchpad/interfaces/_schema_circular_imports.py (+2/-0) lib/lp/registry/browser/tests/test_distroseries_webservice.py (+15/-0) lib/lp/registry/interfaces/distroseries.py (+24/-0) lib/lp/registry/interfaces/distroseriesdifferencecomment.py (+17/-1) lib/lp/registry/model/distroseries.py (+9/-0) lib/lp/registry/model/distroseriesdifferencecomment.py (+41/-1) lib/lp/registry/tests/test_distroseries.py (+8/-0) lib/lp/registry/tests/test_distroseriesdifferencecomment.py (+108/-4) |
To merge this branch: | bzr merge lp:~jtv/launchpad/bug-798297 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Julian Edwards (community) | Approve | ||
Review via email: mp+66816@code.launchpad.net |
Commit message
[r=julian-edwards][bug=798297] Provide API access to DistroSeriesDif
Description of the change
= Summary =
The Ubuntu people need API access to DistroSeriesDif
We need to provide three kinds of filtering: by distroseries (regardless of exact use), by time the comment was made (to support update polling), and by source package name (to produce per-package timelines).
== Proposed fix ==
Provide all these through the DistroSeries devel API, using a single method.
The combination of filtering by age and distroseries can be awkward, since these two items are at opposite ends of the schema sub-graph that we need for this. Luckily, DistroSeriesDif
It looks as if this will require a Message table scan; I'm not sure how costly that will be but expect that we'll probably want an index to support this.
== Pre-implementation notes ==
Julian says security is not a concern for this method as yet; we'll trust the security machinery to keep anyone out who isn't allowed to view the DistroSeries.
The use-case is very similar to what we have with feeds, so this may also become the basis for future feed support.
== Implementation details ==
We could have the client remember the last-polled DSDComment id, but we prefer not to expose ids and use dates instead.
== Tests ==
{{{
./bin/test -vvc lp.registry.
./bin/test -vvc lp.registry.
}}}
== Demo and Q/A ==
We'll be able to browse (and to a limited extent) query DSDComments for a DistroSeries. They should be filtered appropriately and ordered by creation time.
= Launchpad lint =
Checking for conflicts and issues in changed files.
Linting changed files:
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/canonical
76 + :param since: A date. No comments older than this date will be
77 + returned.
We should probably refer to "timestamp" here instead of "date". This string will appear in +apidoc remember!
138 + @property package_ name(self) : ifferenceCommen tSource` .""" series_ difference. source_ package_ name.name
139 + def source_
140 + """See `IDistroSeriesD
141 + return self.distro_
I'm not sure about the name of this but I can't think of anything better - source_package_name is getting conflated between text and the object everywhere :( However there's precedence in SPPH's exported properties so I guess it doesn't matter here. Just thought I'd mention it anway.
174 + after_msgid = store.find(
175 + Max(Message.id), Message.datecreated < since).one()
If this does cause a scan on Message then we're screwed, Message is a huge table. Looking at the indexes I'm pretty sure it will since there's no index on datecreated. :(
Finally, lovely tests! You just need some more that test the webservice :)