Merge lp:~julian-edwards/launchpad/ppa-expire-sources into lp:launchpad
| Status: | Merged |
|---|---|
| Approved by: | Brad Crittenden on 2010-01-19 |
| Approved revision: | no longer in the source branch. |
| Merged at revision: | not available |
| Proposed branch: | lp:~julian-edwards/launchpad/ppa-expire-sources |
| Merge into: | lp:launchpad |
| Diff against target: |
316 lines (+131/-36) 4 files modified
cronscripts/expire-ppa-files.py (+1/-1) database/schema/security.cfg (+3/-0) lib/lp/soyuz/scripts/expire_ppa_binaries.py (+57/-2) lib/lp/soyuz/scripts/tests/test_expire_ppa_bins.py (+70/-33) |
| To merge this branch: | bzr merge lp:~julian-edwards/launchpad/ppa-expire-sources |
| Related bugs: |
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Brad Crittenden (community) | code | 2010-01-19 | Approve on 2010-01-19 |
|
Review via email:
|
|||
| Julian Edwards (julian-edwards) wrote : | # |
| Brad Crittenden (bac) wrote : | # |
Hi Julian,
The branch looks good. You mentioned renaming the file but deferred due to time constraints. Seems like it would take 10 seconds so you might as well do it now. expire_
As far as refactoring the SQL it looks like you could use common aliases and then many of your comparisons would be the same, leaving you to just customize the WHERE clauses. Would that help? Or, if it was Storm-i-fied you may find it easier to refactor. Just two lame suggestions.
Otherwise your change looks very well done. Thanks.
| Julian Edwards (julian-edwards) wrote : | # |
On Tuesday 19 January 2010 19:30:24 Brad Crittenden wrote:
> Review: Approve code
> Hi Julian,
>
> The branch looks good. You mentioned renaming the file but deferred due to
> time constraints. Seems like it would take 10 seconds so you might as
> well do it now. expire_
I would have done that if it were not for the fact that the losas also need to
change their crontabs, which makes it a >10 second job :) But still, we'll
take the hit and do it. Thanks for prodding me.
> As far as refactoring the SQL it looks like you could use common aliases
> and then many of your comparisons would be the same, leaving you to just
> customize the WHERE clauses. Would that help?
I tried. It was really unreadable and the refactoring didn't help reduce the
size of the code that much.
> Or, if it was Storm-i-fied
> you may find it easier to refactor. Just two lame suggestions.
I'd love to do that but it's quite hard, STORM doesn't have the EXCEPT
command.
> Otherwise your change looks very well done. Thanks.
Thanks, I'll land this soon!

= Summary =
Expire superseded PPA source files
== Proposed fix ==
This change extends the existing script that expires PPA binaries so that it
expires sources as well.
== Pre-implementation notes ==
None, I suck. Besides, it's trivial.
== Implementation details ==
Fairly straightforward extension of the existing script so that it injects
librarian IDs for sources into the loop that was deleting just the binaries.
My only question to you, my reviewer, is to ask if you can come up with a
decent refactoring of the two nearly identical SQL strings. I tried a bunch
of things but only succeeded in making it totally unreadable.
Finally, the script name is now slightly bogus, but that can be fixed some
other time. The LOSAs are desperate for more librarian space.
== Tests == ppa_bins
bin/test -vvct test_expire_
== Demo and Q/A ==
= Launchpad lint =
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: schema/ security. cfg soyuz/scripts/ tests/test_ expire_ ppa_bins. py soyuz/scripts/ expire_ ppa_binaries. py
database/
lib/lp/
lib/lp/