Merge lp:~jcsackett/launchpad/deprecate-remaining-official-bools into lp:launchpad
Status: | Merged |
---|---|
Approved by: | Paul Hummer |
Approved revision: | no longer in the source branch. |
Merged at revision: | 11528 |
Proposed branch: | lp:~jcsackett/launchpad/deprecate-remaining-official-bools |
Merge into: | lp:launchpad |
Diff against target: |
632 lines (+121/-109) 19 files modified
lib/lp/answers/browser/questiontarget.py (+2/-1) lib/lp/answers/doc/question.txt (+5/-5) lib/lp/answers/doc/questionsets.txt (+8/-8) lib/lp/registry/browser/distribution.py (+2/-2) lib/lp/registry/browser/pillar.py (+21/-16) lib/lp/registry/browser/productseries.py (+1/-1) lib/lp/registry/browser/tests/distribution-views.txt (+3/-2) lib/lp/registry/browser/tests/pillar-views.txt (+20/-20) lib/lp/registry/browser/tests/product-views.txt (+3/-2) lib/lp/registry/browser/tests/productseries-views.txt (+7/-7) lib/lp/registry/browser/tests/projectgroup-views.txt (+4/-2) lib/lp/registry/doc/distribution.txt (+15/-14) lib/lp/registry/doc/product.txt (+14/-14) lib/lp/registry/templates/distribution-index.pt (+3/-3) lib/lp/registry/templates/distribution-search.pt (+2/-2) lib/lp/registry/templates/distroseries-index.pt (+2/-1) lib/lp/registry/templates/product-index.pt (+3/-3) lib/lp/registry/templates/productseries-index.pt (+1/-1) lib/lp/registry/templates/project-index.pt (+5/-5) |
To merge this branch: | bzr merge lp:~jcsackett/launchpad/deprecate-remaining-official-bools |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | Approve | ||
Review via email: mp+34436@code.launchpad.net |
Commit message
Replaces use of official_answers and official_blueprints with their usage enum equivalents.
Description of the change
= Summary =
Replaces, where possible, usage of official_blueprints and official_answers with their usage enum equivalents.
== Proposed fix ==
Where code uses one of the above mentioned bools, use the enum instead so that we can take advantage of richer data.
== Pre-implementation notes ==
Spoke with Curtis Hovey (sinzui) and Brad Crittenden (bac).
== Implementation details ==
As in Proposed fix.
SQL queries using the official_<app> booleans have been left alone until data migration occurs.
== Tests ==
No new tests written.
To fully test the refactor:
bin/test -m lp.registry
bin/test -m lp.answers
bin/test -m lp.blueprints
== Demo and Q/A ==
In Launchpad.dev, there should be no apparent changes to any views related to answers or blueprints.
== 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/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
lib/lp/
25 @@ -72,13 +72,13 @@ official_ answers official_ answers answers_ usage.name answers_ usage.name
26 ==============
27
28 A product or distribution may be officially supported by the community using
29 -the Answer Tracker. This status is set by the official_answers attribute on
30 +the Answer Tracker. This status is set by the answers_usage attribute on
31 the IProduct and IDistribution.
32
33 - >>> ubuntu.
34 - True
35 - >>> firefox.
36 - True
37 + >>> ubuntu.
38 + 'LAUNCHPAD'
39 + >>> firefox.
40 + 'LAUNCHPAD'
I'd rather you print these than just getting the value.
342 === modified file 'lib/lp/ registry/ browser/ tests/productse ries-views. txt' registry/ browser/ tests/productse ries-views. txt 2010-08-27 19:19:27 +0000 registry/ browser/ tests/productse ries-views. txt 2010-09-02 16:47:49 +0000 volvedMenu when product. owner) official_ answers = True official_ blueprints = True answers_ usage = ServiceUsage. LAUNCHPAD blueprints_ usage = ServiceUsage. LAUNCHPAD official_ malone = True official_ rosetta = True answers blueprints usage.name _usage. name
343 --- lib/lp/
344 +++ lib/lp/
345 @@ -23,18 +23,19 @@
346 The ProductSeries involvement view uses the ProductSeriesIn
347 rendering links:
348
349 + >>> from lp.app.enums import ServiceUsage
350 >>> login_person(
351 - >>> product.
352 - >>> product.
353 + >>> product.
354 + >>> product.
355 >>> product.
356 >>> product.
357 >>> view = create_view(series, '+get-involved')
358
359 - # official_answers is always false for product series.
360 - >>> print view.official_
361 - False
362 - >>> print view.official_
363 - True
364 + # answers_usage is never LAUNCHPAD for product series.
365 + >>> print view.answers_
366 + UNKNOWN
367 + >>> print view.blueprints
368 + 'LAUNCHPAD'
Hm, how does this work? If you're printing the value here, why are you still getting quotes?
So I think I'd rather you print all the values instead of getting them as strings, and I think you might need to run these tests to make sure you're getting the right values. I suspect in some case you're printing something and expecting the quoted value instead of the string.
Thanks for updating the doctests. One more doctest up to date.