Merge lp:~rharding/charmworld/bundle-metadata2 into lp:~juju-jitsu/charmworld/trunk
Status: | Merged |
---|---|
Approved by: | Richard Harding |
Approved revision: | 414 |
Merged at revision: | 406 |
Proposed branch: | lp:~rharding/charmworld/bundle-metadata2 |
Merge into: | lp:~juju-jitsu/charmworld/trunk |
Diff against target: |
383 lines (+232/-8) 5 files modified
charmworld/models.py (+67/-4) charmworld/testing/factory.py (+1/-1) charmworld/tests/test_models.py (+118/-1) charmworld/views/api.py (+22/-0) charmworld/views/tests/test_api.py (+24/-2) |
To merge this branch: | bzr merge lp:~rharding/charmworld/bundle-metadata2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Gui Bot | continuous-integration | Approve | |
Benji York (community) | Approve | ||
Review via email: mp+189406@code.launchpad.net |
Commit message
Add extra file/charm_metadata support to the bundle details api call.
Description of the change
Add extra file/charm_metadata support to the bundle details api call.
The bundle details view needs to provide metadata for the Gui to properly render the token and information about it. This provides the list of files (to find the README for instance) in the bundle as well as charm details of the charms in the bundle.
The charms are keyed off their keys in the bundle services list so that the gui can match from the name used in the bundle to the charm model in the charm_metadata.
The charms are formatted per the normal charm_details method by casting to a Charm object and then running through _format_charm.
QA:
http://
Should output a new large suite of json for each charm in the bundle. It should also show the list of files so that the front end can implement a hasIcon as per the way gui handles charms. It also allows searching for the README file (README, readme.md, etc) just as we do with the charms in the Gui.
The branch looks good. I saw a few little things that deserve your
attention.
Lines 44 and 85 of the diff: The name "data" is somewhat
information-free, maybe bundle_data would be more informative.
Line 45 of the diff: The docstring summery might be better rendered as
"Construct a query that specifies a charm from data about that charm."
Line 47 of the diff: The bulleted lists in the docstring have
inconsistent indentation.
Lines 64 and 77 of the diff: Please capitalize the sentence in the
comment.
Line 71 of the diff: I would be paranoid and pass "/trunk" to the that-in- the-trunk" won't
.endswith() call so a branch name like "who-is-
be matched.
Line 196 of the diff: It would be slightly better to use .assertIsNone().
Line 357 of the diff: There is an extra space after the colon. I think
lint will pick that up, so you should run lint to see if there is more.
Line 205 of the diff: The TestBundleLoadi ngCharms test case could use a
test that shows what a request with too-little information to find a
charm will produce.