Create DistroSeriesDifferences via script
Bug #623391 reported by
Michael Nelson
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Medium
|
Jeroen T. Vermeulen |
Bug Description
For:
https:/
we will need some sort of job/cronjob that queries for all packages that are different between a derived distroseries and its parent series, and creates/updates DistroSeriesDif
Related branches
lp:~jtv/launchpad/bug-623391
- Abel Deuring (community): Approve (code)
-
Diff: 772 lines (+756/-0)3 files modifiedlib/lp/registry/scripts/populate_distroseriesdiff.py (+270/-0)
lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py (+470/-0)
scripts/populate-distroseriesdiff.py (+16/-0)
lp:~jtv/launchpad/bug-623391-transactions
- Abel Deuring (community): Approve (code)
-
Diff: 159 lines (+89/-5)2 files modifiedlib/lp/registry/scripts/populate_distroseriesdiff.py (+43/-4)
lib/lp/registry/scripts/tests/test_populate_distroseriesdiff.py (+46/-1)
summary: |
- DistroSeriesDifferences need to be created by a script + Create DistroSeriesDifferences via script |
Changed in launchpad: | |
status: | Triaged → In Progress |
assignee: | nobody → Jeroen T. Vermeulen (jtv) |
milestone: | none → 11.04 |
tags: | added: derivation |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
I'm very glad you're fixing this, and my first thought about your approach was "oh great!"
But I'm having two second thoughts as well.
One of these is: the "Or" in the vocab's central query is a performance hazard. "OR" of ten is. The TeamParticipation table makes everyone a member of themselves, so the transitive- ownership check will also show all direct-ownership cases. Yet the query plan probably won't be able to avoid fetching data for the transitive check, so you may be getting one query for the price of two.
The other is: the change is pretty fundamental to the vocabulary. If the parameter you're passing is always going to be a literal, why not make this a separate vocab and use inheritance to express the commonality? It also means you don't have to kludge around the difference in query conditions.
Putting these two together, I would say: keep the current dictionary as it is. Create a separate one that's generalized for team-owned branches. It's going to be faster and easier to read, and maybe someday we'll decide that we don't actually need the direct-ownership one as much as we thought.