Merge lp:~adeuring/charmworld/fixed-interfaces-mapping into lp:~juju-jitsu/charmworld/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Abel Deuring | ||||
Approved revision: | 383 | ||||
Merged at revision: | 393 | ||||
Proposed branch: | lp:~adeuring/charmworld/fixed-interfaces-mapping | ||||
Merge into: | lp:~juju-jitsu/charmworld/trunk | ||||
Diff against target: |
229 lines (+89/-42) 4 files modified
charmworld/migrations/versions/019_fixed_mapping_for_interfaces.py (+10/-0) charmworld/migrations/versions/tests/test_migrations.py (+44/-0) charmworld/search.py (+30/-20) charmworld/tests/test_search.py (+5/-22) |
||||
To merge this branch: | bzr merge lp:~adeuring/charmworld/fixed-interfaces-mapping | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Abel Deuring (community) | Approve | ||
Benji York (community) | Approve | ||
Review via email: mp+184805@code.launchpad.net |
Commit message
use a static mapping for the charm index.
Description of the change
his branch removes the last remainig dynamic part of the mapping used
by the ElasticSearch index for charms.
The properties "requires" and "provides" of a charm are dictionaries
of the form
{'relation_
which means that each relation name must appear as a property in the mapping.
The ES server gets charm data in the form
{'_id': ...,
'data': real_charm_data
}
ElasticSearchCl
"provides" that are lists of the relation data from charm["provides"]
and charm["requires"], respectively. The relation name is added to
the list entries.
This allows to define a static mapping for the relation data.
test_mapping_
The test itself is now a bit flaky -- it might succeed accidentally:
As the comment for the old version notes, the result of the call of
get_mapping() does not necessarily incorporate possible mapping
changes after data has been added to the index. Hence it might make
sense to add a sleep(0.5) call to the test.
The change of the mapping and the related change of
ElasticSearchCl
This is done in an exodus.
This branch looks good to me.