Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(526)

Issue 8641044: Return only valid charms in elasticsearch results.

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by abel.deuring
Modified:
9 years, 6 months ago
Reviewers:
abentley, mp+158951
Visibility:
Public.

Description

Return only valid charms in elasticsearch results. For each (possible) charm it knows about, charmworld records its status in the main charm store (store.juju.ubuntu.com), but we did not use this status information. One important detail we ignored is if the charm store says that a given charm is valid, or if it exists at all. We store this kind of status information as a dictionary charm['store_data']; if the store "sees" an error, this dictionary has the key 'errors'. This branch adds an additional elasticsearch filter to the "search expression" used by ElasticSearchClient.api_search() and ElasticSearchClient.search() that ensures that only valid charms are returned in search results. This behaviour can be changed by setting the new parameter valid_charm_only to False. As a drive-by fix, I changed the the conversion from a datetime instance to "seconds since the Unix epoch" so that the local timezone is not used. This fixes a failure of test_api.TestAPI0Charms.test_charms() that is not related to my changes. https://code.launchpad.net/~adeuring/charmworld/check-charm-exists-in-store-1160527/+merge/158951 (do not edit description out of merge proposal)

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+59 lines, -15 lines) Patch
A [revision details] View 1 chunk +2 lines, -0 lines 0 comments Download
M charmworld/search.py View 3 chunks +11 lines, -5 lines 0 comments Download
M charmworld/test_search.py View 1 chunk +29 lines, -0 lines 0 comments Download
M charmworld/testing/factory.py View 6 chunks +17 lines, -10 lines 0 comments Download

Messages

Total messages: 2
abel.deuring
Please take a look.
11 years, 1 month ago (2013-04-15 15:02:29 UTC) #1
abentley
11 years, 1 month ago (2013-04-15 15:20:23 UTC) #2
On 2013/04/15 15:02:29, abel.deuring wrote:
> Please take a look.

lgtm
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b