Merge lp:~sinzui/launchpad/revision-karma-2 into lp:launchpad
| Status: | Merged | ||||
|---|---|---|---|---|---|
| Approved by: | Curtis Hovey on 2012-12-04 | ||||
| Approved revision: | no longer in the source branch. | ||||
| Merged at revision: | 16339 | ||||
| Proposed branch: | lp:~sinzui/launchpad/revision-karma-2 | ||||
| Merge into: | lp:launchpad | ||||
| Diff against target: |
74 lines (+12/-19) 3 files modified
lib/lp/code/model/revision.py (+1/-1) lib/lp/code/model/tests/test_revision.py (+9/-0) lib/lp/code/scripts/revisionkarma.py (+2/-18) |
||||
| To merge this branch: | bzr merge lp:~sinzui/launchpad/revision-karma-2 | ||||
| Related bugs: |
|
| Reviewer | Review Type | Date Requested | Status |
|---|---|---|---|
| Richard Harding (community) | 2012-12-04 | Approve on 2012-12-04 | |
|
Review via email:
|
|||
Commit Message
Ensure allocated_karma() is called for all revisions
Description of the Change
allocate-
running, because the query in RevisionSet
getRevisionsNee
Right now, we have 21.1 million revisions. 15.9 million of these are
flagged as not having karma allocated. These 15.9 million revisions are
the combination of revisions that have never been processed, or only
exist in +junk branches, or only exist in branches owned by invalid
people. Each run, the scanner needs to check all 15.9 million revisions.
-------
RULES
Pre-
* This is a follow up branch to address a case seen on qastaging.
* The script assumes that returning None from allocateKarma()
is bad because Lp will eternally process the revision. This
is not bad anymore because the method has set rev.allocated_karma
to True.
* The script will look up the revision's branch, but since lookup
ignores junk branches, the branch can be None. This is okay
because we want to ensure rev.allocated_karma is still called
to ensure Lp does not reprocess the revision.
QA
* As a webops to run
.
for qastaging's script host (gandwana).
* Verify there are no errors after a 5 minutes. The proc
can be killed since we do not need to Verify all 15 million
revisions.
LoC
I have a 10,000 line credit this week.
LINT
lib/
lib/
lib/
TEST
./bin/test -vc -t TestRevisionKarma lp.code.
./bin/test -vc lp.code.
IMPLEMENTATION
I updated allocateKarma() to not attempt to add karma if there is no
community branch for the revision. I updated the script to continue
processing revisions because the call to allocateKarma() did set
rev.allocated_karma to True.
lib/
lib/
lib/
