Merge lp://staging/~sinzui/launchpad/search-and-rescue into lp://staging/launchpad

Proposed by Curtis Hovey
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 12140
Proposed branch: lp://staging/~sinzui/launchpad/search-and-rescue
Merge into: lp://staging/launchpad
Diff against target: 388 lines (+287/-41)
7 files modified
lib/lp/registry/doc/vocabularies.txt (+0/-41)
lib/lp/registry/tests/test_pillar_vocabularies.py (+119/-0)
lib/lp/registry/tests/test_product_vocabularies.py (+64/-0)
lib/lp/registry/tests/test_sourcepackagename_vocabulary.py (+38/-0)
lib/lp/registry/vocabularies.py (+14/-0)
lib/lp/soyuz/model/binaryandsourcepackagename.py (+6/-0)
lib/lp/soyuz/tests/test_binaryandsourcepackagename.py (+46/-0)
To merge this branch: bzr merge lp://staging/~sinzui/launchpad/search-and-rescue
Reviewer Review Type Date Requested Status
Jelmer Vernooij (community) code Approve
Review via email: mp+44422@code.staging.launchpad.net

Description of the change

Case insensitive lookups for pillars and packages.

    Launchpad bug:
        https://bugs.launchpad.net/bugs/150945
        https://bugs.launchpad.net/bugs/404158
        https://bugs.launchpad.net/bugs/192615
    Pre-implementation: no one
    Test command: ./bin/test -vv \
      -t regexp

Bug #150945 [Searching for "Exaile" on Bugs front page turns up empty]
    https://bugs.launchpad.net/ when searching for the project "Exaile",
    I get told that there is no project by that name. /exaile does exist.

Bug #404158 [There is no project in Launchpad named "Launchpad"]
    "Also affects other project" and entering "Launchpad"
    into the box results in error. /launchpad does exist.

Bug #192615 [Reporting bug on capitalized package name returns an error]
    Enter "Xorg" or "fireFox" for the package name. "There is 1 error". There
    was no clue whatsoever what the error was or how I should fix it.
    xorg and firefox packages do exist.

--------------------------------------------------------------------

RULES

Launchpad name fields are always lowercase. In huge vocabularies that
support getTermByToken(), that method could lower case the user entered
term.

Bug #150945 [Searching for "Exaile" on Bugs front page turns up empty]
    * Lowercase the input before searching the product vocab.

Bug #404158 [There is no project in Launchpad named "Launchpad"]
    * Lowercase the input before searching the pillar vocabs.

Bug #192615 [Reporting bug on capitalized package name returns an error]
    * Lowercase the input before searching the package name vocabs.

QA

Bug #150945 [Searching for "Exaile" on Bugs front page turns up empty]
    * Visit https://bugs.launchpad.net/
    * Search in the Exaile project
    * Verify bugs are listed

Bug #404158 [There is no project in Launchpad named "Launchpad"]
    * Visit a non-launchpad bug.
    * Choose "Also affects other project" and enter Launchpad
    * Verify launchpad is matched.

Bug #192615 [Reporting bug on capitalized package name returns an error]
    * Visit https://bugs.qastaging.launchpad.net/ubuntu/+filebug
    * Enter Xorg
    * Verify the bug is reported.

LINT

    lib/lp/registry/vocabularies.py
    lib/lp/registry/doc/vocabularies.txt
    lib/lp/registry/tests/test_pillar_vocabularies.py
    lib/lp/registry/tests/test_product_vocabularies.py
    lib/lp/registry/tests/test_sourcepackagename_vocabulary.py
    lib/lp/soyuz/model/binaryandsourcepackagename.py
    lib/lp/soyuz/tests/test_binaryandsourcepackagename.py

IMPLEMENTATION

Bug #150945 [Searching for "Exaile" on Bugs front page turns up empty]
    Updated getTermByToken in the base vocab. Added tests for the pillar
    vocabularies.
    lib/lp/registry/vocabularies.py
    lib/lp/registry/tests/test_pillar_vocabularies.py

Bug #404158 [There is no project in Launchpad named "Launchpad"]
    Lowercased the token entered by the user in getTermByToken. Updated test
    coverage, and deleted redundant tests.
    lib/lp/registry/vocabularies.py
    lib/lp/registry/doc/vocabularies.txt
    lib/lp/registry/tests/test_product_vocabularies.py

Bug #192615 [Reporting bug on capitalized package name returns an error]
    Updated getTermByToken in the two vocabs and added tests.
    lib/lp/registry/vocabularies.py
    lib/lp/registry/tests/test_sourcepackagename_vocabulary.py
    lib/lp/soyuz/model/binaryandsourcepackagename.py
    lib/lp/soyuz/tests/test_binaryandsourcepackagename.py

To post a comment you must log in.
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Thanks, nice paper cut fix.

I did notice a couple of minor typos in comments.

s/porduct/product/
s/porject/project/
s/discluded/excluded/

TestDistributionOrProductOrProjectGroupVocabulary's docstring says "Test for ...", that should probably be "Tests for ..."

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.