Merge lp:~michael.nelson/launchpad/distro-series-difference-schema into lp:launchpad/db-devel
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Michael Nelson on 2010-08-30 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 9718 | ||||
| Proposed branch: | lp:~michael.nelson/launchpad/distro-series-difference-schema | ||||
| Merge into: | lp:launchpad/db-devel | ||||
| Diff against target: |
82 lines (+42/-3) 3 files modified
database/schema/comments.sql (+16/-3) database/schema/patch-2208-07-0.sql (+24/-0) database/schema/security.cfg (+2/-0) |
||||
| To merge this branch: | bzr merge lp:~michael.nelson/launchpad/distro-series-difference-schema | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Brad Crittenden (community) | code | 2010-08-24 | Approve on 2010-08-27 |
| Stuart Bishop | db | 2010-08-27 | Approve on 2010-08-27 |
| Robert Collins | db | 2010-08-27 | Pending |
|
Review via email:
|
|||
Commit Message
Add DistroSeriesDif
Description of the Change
Overview
=======
This branch is a schema patch to support displaying packages with different versions between two distroseries (specifically, a derived distroseries and its parent series).
Details of the UI at:
https:/
Details
=====
Some details regarding the implementation and schema design were discussed on a long-ish email thread:
https:/
The decisions that came out of that discussion were:
1) Lets just store the derived series which references its parent series (rather than generalising it with two references to distroseries - we can always generalise later if and when we need to).
2) Store the source_
3) The actual diff off the two packages is not required (nullable), and will be generated on request. Also, once its created, its not necessarily a diff of the current packages (new versions could be uploaded since the diff was generated). Hence naming it latest_package_diff rather than simply package_diff.
4) The activity_log field was initially a comment field, but it will be used and appended to (1) by scripts, when new uploads are detected that change the state, or (2) when users add comments (eg. "We're waiting for version 1.4"), hence renaming it activity_log. I don't see a reason to add a separate comment model - but you might.
5) Initially we had just one enum for the type of difference (UNIQUE_
No sampledata changes.
The following branch adds the basic model code:
https:/
| Stuart Bishop (stub) wrote : | # |
Confused myself. This is all fine. The difference references the derived distro series it is for. The derived distro series references its parent distro series.
Add the index and you are good to go from my pov.
| Michael Nelson (michael.nelson) wrote : | # |
On Fri, Aug 27, 2010 at 12:03 PM, Stuart Bishop
<email address hidden> wrote:
> Review: Approve db
> Confused myself. This is all fine. The difference references the derived distro series it is for. The derived distro series references its parent distro series.
>
> Add the index and you are good to go from my pov.
Thanks Stuart. Based on our conversation [1] I've updated to remove
the activity_log column and instead added a joining table for messages
for the DistroSeriesDif
based it on the similar BugMessage table, but please check it in case
I've missed something.
[1] 12:04 < noodles775> stub: Why would we want delete permissions? At
the moment I'm planning that these differences will end in a resolved
state, but we wouldn't want to delete them until the derived
distroseries is itself deleted (if it ever is).
12:05 < stub> The derived distribution has a patched version of
firefox. Tomorrow it decides that it should just use the parents
version of firefox.
12:07 < noodles775> Great, so assuming the parents version has a
higher revno, they upload it, this record is marked as resolved and
the activity log is updated, but the record is not deleted, as
tomorrow the parent might upload a new version, and the previous
comments/activity is still useful.
12:07 < stub> ok
12:08 < stub> How big do you think the comments and activity will grow?
12:08 < stub> It will be a pain to split out into a structured format later.
12:10 < stub> If it is append only, storing it as a single text blob
isn't ideal. If it is more a whiteboard or a copy of a text file
stored in a branch, that would be fine I guess.
12:10 < noodles775> On average 4 or 5 lines. If a particular
difference goes through resolved->needs attention-> resolved it would
be a few more.
12:10 < stub> But over time
12:10 < noodles775> Yes, it is just like a whiteboard.
12:11 < stub> ok
12:11 < noodles775> Yep, so if overtime it went through that cycle
(resolved->needs attention-
for each change.
12:11 < noodles775> Do you think its worth adding a separate comment model?
12:12 < noodles775> (from memory the code/bugs guys made the comment
model re-usable... I'll check).
12:14 < noodles775> stub: oh, and I think I misunderstood your comment
above. I am making the activity_log append only.
12:17 < stub> So we would probably be better off with a separate table
containing the activity, one row per addition. Or even a link table
between distroseriesdif
spools.
12:18 < noodles775> Yep, just looking at the message table... I'll do that then.
12:18 < noodles775> Thanks stub.
12:19 < stub> That gives you the infrastructure for attachments, email
interfaces etc. if we want them in the future.
12:20 < noodles775> Yeah, given that the table already exists, it
sounds crazy not to use it.
| Robert Collins (lifeless) wrote : | # |
Michael, 'latest_
uploads could be made that mean its not the latest diff after all.
I haven't looked closely yet, but it seems to me that when you
generate a diff you know the versions you generated it against, and
you should store those, then it *is* a package_diff, not a 'latest_'
one, and we can query easily to see if it is or isn't the latest one.
| Michael Nelson (michael.nelson) wrote : | # |
Hi Robert,
Yes, those versions are stored with the PackageDiff object itself, but do you mean that we should store the exact versions additionally with this DistroSeriesDif
https:/
And yep, I was using 'latest' in the sense that it is the most recently generated package diff, and irrespective of the above, we could rename this simply to package_diff and automatically remove it when it no longer matches the current published versions - I'd not thought of that.
I'll update latest_package_diff -> package_diff, but let me know about the first issue (storing of exact versions within DistroSeriesDif
Cheers,
M.
| Stuart Bishop (stub) wrote : | # |
Drop the UNIQUE (distro_
Drop the index on the message column - one will get created implicitly when the column is declared UNIQUE.
| Michael Nelson (michael.nelson) wrote : | # |
On Mon, Aug 30, 2010 at 9:41 AM, Stuart Bishop
<email address hidden> wrote:
> Drop the UNIQUE (distro_
>
> Drop the index on the message column - one will get created implicitly when the column is declared UNIQUE.
Thanks Stuart. Done in the incremental (as well as renaming
last_package_

Its surprising you don't want delete permissions. How does the derived distribution sync its changes up with its parent distribution?
Having a column called derived_series is confusing. The derived distro series is the child. Having it reference its parent via a column called derived_series seems wrong (The derived distro series is derived from the derived distro series, which is silly). What is the parent distribution of a derived distribution called anyway? Parent or is there some other term?
We should add an index on last_package_diff for garbage collection purposes.
patch-2208-07-0.sql