Merge lp:~abentley/charmworld/remove-doctype-attribute into lp:~juju-jitsu/charmworld/trunk

Proposed by Aaron Bentley
Status: Merged
Approved by: Aaron Bentley
Approved revision: 345
Merged at revision: 345
Proposed branch: lp:~abentley/charmworld/remove-doctype-attribute
Merge into: lp:~juju-jitsu/charmworld/trunk
Diff against target: 151 lines (+0/-15)
8 files modified
charmworld/jobs/lp.py (+0/-2)
charmworld/jobs/tests/test_lp.py (+0/-5)
charmworld/models.py (+0/-2)
charmworld/testing/factory.py (+0/-2)
charmworld/tests/test_models.py (+0/-1)
charmworld/tests/test_search.py (+0/-1)
charmworld/views/tests/test_api.py (+0/-1)
charmworld/views/tests/test_charms.py (+0/-1)
To merge this branch: bzr merge lp:~abentley/charmworld/remove-doctype-attribute
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+179814@code.launchpad.net

Commit message

Remove doctype attribute.

Description of the change

This branch removes the doctype attribute from the code, but not from existing data. An "exodus" is required to do that, because Elasticsearch does not support bulk updates. My upcoming charm versioning branch includes an exodus, so I will update the exodus to also remove doctype. There is no harm leaving the attribute in existing data until then. It will simply be ignored.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmworld/jobs/lp.py'
--- charmworld/jobs/lp.py 2013-07-22 20:49:00 +0000
+++ charmworld/jobs/lp.py 2013-08-12 21:27:19 +0000
@@ -65,7 +65,6 @@
65 continue65 continue
6666
67 data['branch_deleted'] = False67 data['branch_deleted'] = False
68 data['doctype'] = 'charm'
69 charms.append(data)68 charms.append(data)
70 return charms, baskets69 return charms, baskets
7170
@@ -84,7 +83,6 @@
84 charm['promulgated'] = False83 charm['promulgated'] = False
85 charm['distro_series'] = []84 charm['distro_series'] = []
86 charm['branch_deleted'] = True85 charm['branch_deleted'] = True
87 charm['doctype'] = 'charm'
88 yield charm86 yield charm
8987
9088
9189
=== modified file 'charmworld/jobs/tests/test_lp.py'
--- charmworld/jobs/tests/test_lp.py 2013-08-09 18:53:40 +0000
+++ charmworld/jobs/tests/test_lp.py 2013-08-12 21:27:19 +0000
@@ -61,7 +61,6 @@
61 'bname': u'trunk',61 'bname': u'trunk',
62 'commit': u'ja@appflower.com-20120329093714-s2m9e28dwotmijqc',62 'commit': u'ja@appflower.com-20120329093714-s2m9e28dwotmijqc',
63 'distro_series': [],63 'distro_series': [],
64 'doctype': 'charm',
65 'promulgated': False}], charms)64 'promulgated': False}], charms)
6665
67 def test_request_promulgated_charm(self):66 def test_request_promulgated_charm(self):
@@ -84,7 +83,6 @@
84 'bname': u'trunk',83 'bname': u'trunk',
85 'commit': u'ja@appflower.com-20120329093714-s2m9e28dwotmijqc',84 'commit': u'ja@appflower.com-20120329093714-s2m9e28dwotmijqc',
86 'distro_series': ['precise'],85 'distro_series': ['precise'],
87 'doctype': 'charm',
88 'promulgated': True}], charms)86 'promulgated': True}], charms)
8987
90 def test_all_branch_data_parse_failure(self):88 def test_all_branch_data_parse_failure(self):
@@ -225,7 +223,6 @@
225 'branch_deleted': False,223 'branch_deleted': False,
226 'bname': 'trunk',224 'bname': 'trunk',
227 'commit': 'owner@example.com-series-c1',225 'commit': 'owner@example.com-series-c1',
228 'doctype': 'charm',
229 'distro_series': ['series'],226 'distro_series': ['series'],
230 'name': 'c1',227 'name': 'c1',
231 'owner': 'owner',228 'owner': 'owner',
@@ -237,7 +234,6 @@
237 'branch_deleted': True,234 'branch_deleted': True,
238 'bname': 'trunk',235 'bname': 'trunk',
239 'distro_series': [],236 'distro_series': [],
240 'doctype': 'charm',
241 'name': 'c2',237 'name': 'c2',
242 'owner': 'owner',238 'owner': 'owner',
243 'series': 'series',239 'series': 'series',
@@ -250,7 +246,6 @@
250 'bname': 'trunk',246 'bname': 'trunk',
251 'commit': 'owner@example.com-series-c3',247 'commit': 'owner@example.com-series-c3',
252 'distro_series': [],248 'distro_series': [],
253 'doctype': 'charm',
254 'name': 'c3',249 'name': 'c3',
255 'owner': 'owner',250 'owner': 'owner',
256 'promulgated': False,251 'promulgated': False,
257252
=== modified file 'charmworld/models.py'
--- charmworld/models.py 2013-08-09 21:01:58 +0000
+++ charmworld/models.py 2013-08-12 21:27:19 +0000
@@ -220,7 +220,6 @@
220 'owner': '',220 'owner': '',
221 'promulgated': False,221 'promulgated': False,
222 'series': '',222 'series': '',
223 'doctype': 'charm',
224223
225 # Provided by the update charm job.224 # Provided by the update charm job.
226 'date_created': None,225 'date_created': None,
@@ -1184,7 +1183,6 @@
1184 'data': dict(),1183 'data': dict(),
1185 'promulgated': False,1184 'promulgated': False,
1186 'branch_deleted': False,1185 'branch_deleted': False,
1187 'doctype': 'bundle',
1188 }1186 }
11891187
1190 def __init__(self, data):1188 def __init__(self, data):
11911189
=== modified file 'charmworld/testing/factory.py'
--- charmworld/testing/factory.py 2013-08-11 23:10:37 +0000
+++ charmworld/testing/factory.py 2013-08-12 21:27:19 +0000
@@ -253,7 +253,6 @@
253 "categories": categories,253 "categories": categories,
254 "changes": changes,254 "changes": changes,
255 "description": description,255 "description": description,
256 "doctype": "charm",
257 "hooks": [256 "hooks": [
258 "install",257 "install",
259 "start",258 "start",
@@ -327,7 +326,6 @@
327 branch_deleted=branch_deleted,326 branch_deleted=branch_deleted,
328 data=data,327 data=data,
329 description=description,328 description=description,
330 doctype='bundle',
331 inherits=inherits,329 inherits=inherits,
332 name=name,330 name=name,
333 owner=owner,331 owner=owner,
334332
=== modified file 'charmworld/tests/test_models.py'
--- charmworld/tests/test_models.py 2013-08-09 20:47:40 +0000
+++ charmworld/tests/test_models.py 2013-08-12 21:27:19 +0000
@@ -1558,7 +1558,6 @@
1558 'inherits': 'main-mysql',1558 'inherits': 'main-mysql',
1559 'title': 'Tiny bundle',1559 'title': 'Tiny bundle',
1560 'description': 'My Tiny Bundle',1560 'description': 'My Tiny Bundle',
1561 'doctype': 'bundle',
1562 'data': {1561 'data': {
1563 'services': dict(apache=1),1562 'services': dict(apache=1),
1564 'relations': dict(a=1),1563 'relations': dict(a=1),
15651564
=== modified file 'charmworld/tests/test_search.py'
--- charmworld/tests/test_search.py 2013-08-09 20:47:40 +0000
+++ charmworld/tests/test_search.py 2013-08-12 21:27:19 +0000
@@ -252,7 +252,6 @@
252 charm['provides']['website']['interface'] = 'gopher'252 charm['provides']['website']['interface'] = 'gopher'
253 charm['requires']['database']['interface'] = 'reiserfs'253 charm['requires']['database']['interface'] = 'reiserfs'
254 charm['_id'] = 'asdf'254 charm['_id'] = 'asdf'
255 charm['doctype'] = 'bogustype'
256 # Best-effort ensure there's no overlap between search terms255 # Best-effort ensure there's no overlap between search terms
257 items = charm.items()256 items = charm.items()
258 for num, (key, value) in enumerate(items):257 for num, (key, value) in enumerate(items):
259258
=== modified file 'charmworld/views/tests/test_api.py'
--- charmworld/views/tests/test_api.py 2013-08-09 20:47:40 +0000
+++ charmworld/views/tests/test_api.py 2013-08-12 21:27:19 +0000
@@ -644,7 +644,6 @@
644 series='precise',644 series='precise',
645 ),645 ),
646 description='',646 description='',
647 doctype='bundle',
648 promulgated=False,647 promulgated=False,
649 branch_deleted=False,648 branch_deleted=False,
650 )649 )
651650
=== modified file 'charmworld/views/tests/test_charms.py'
--- charmworld/views/tests/test_charms.py 2013-08-09 13:25:55 +0000
+++ charmworld/views/tests/test_charms.py 2013-08-12 21:27:19 +0000
@@ -70,7 +70,6 @@
70 }70 }
71 }71 }
72 },72 },
73 'doctype': 'charm',
74 'downloads': 0,73 'downloads': 0,
75 'downloads_in_past_7_days': 0,74 'downloads_in_past_7_days': 0,
76 'downloads_in_past_30_days': 0,75 'downloads_in_past_30_days': 0,

Subscribers

People subscribed via source and target branches