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
1=== modified file 'charmworld/jobs/lp.py'
2--- charmworld/jobs/lp.py 2013-07-22 20:49:00 +0000
3+++ charmworld/jobs/lp.py 2013-08-12 21:27:19 +0000
4@@ -65,7 +65,6 @@
5 continue
6
7 data['branch_deleted'] = False
8- data['doctype'] = 'charm'
9 charms.append(data)
10 return charms, baskets
11
12@@ -84,7 +83,6 @@
13 charm['promulgated'] = False
14 charm['distro_series'] = []
15 charm['branch_deleted'] = True
16- charm['doctype'] = 'charm'
17 yield charm
18
19
20
21=== modified file 'charmworld/jobs/tests/test_lp.py'
22--- charmworld/jobs/tests/test_lp.py 2013-08-09 18:53:40 +0000
23+++ charmworld/jobs/tests/test_lp.py 2013-08-12 21:27:19 +0000
24@@ -61,7 +61,6 @@
25 'bname': u'trunk',
26 'commit': u'ja@appflower.com-20120329093714-s2m9e28dwotmijqc',
27 'distro_series': [],
28- 'doctype': 'charm',
29 'promulgated': False}], charms)
30
31 def test_request_promulgated_charm(self):
32@@ -84,7 +83,6 @@
33 'bname': u'trunk',
34 'commit': u'ja@appflower.com-20120329093714-s2m9e28dwotmijqc',
35 'distro_series': ['precise'],
36- 'doctype': 'charm',
37 'promulgated': True}], charms)
38
39 def test_all_branch_data_parse_failure(self):
40@@ -225,7 +223,6 @@
41 'branch_deleted': False,
42 'bname': 'trunk',
43 'commit': 'owner@example.com-series-c1',
44- 'doctype': 'charm',
45 'distro_series': ['series'],
46 'name': 'c1',
47 'owner': 'owner',
48@@ -237,7 +234,6 @@
49 'branch_deleted': True,
50 'bname': 'trunk',
51 'distro_series': [],
52- 'doctype': 'charm',
53 'name': 'c2',
54 'owner': 'owner',
55 'series': 'series',
56@@ -250,7 +246,6 @@
57 'bname': 'trunk',
58 'commit': 'owner@example.com-series-c3',
59 'distro_series': [],
60- 'doctype': 'charm',
61 'name': 'c3',
62 'owner': 'owner',
63 'promulgated': False,
64
65=== modified file 'charmworld/models.py'
66--- charmworld/models.py 2013-08-09 21:01:58 +0000
67+++ charmworld/models.py 2013-08-12 21:27:19 +0000
68@@ -220,7 +220,6 @@
69 'owner': '',
70 'promulgated': False,
71 'series': '',
72- 'doctype': 'charm',
73
74 # Provided by the update charm job.
75 'date_created': None,
76@@ -1184,7 +1183,6 @@
77 'data': dict(),
78 'promulgated': False,
79 'branch_deleted': False,
80- 'doctype': 'bundle',
81 }
82
83 def __init__(self, data):
84
85=== modified file 'charmworld/testing/factory.py'
86--- charmworld/testing/factory.py 2013-08-11 23:10:37 +0000
87+++ charmworld/testing/factory.py 2013-08-12 21:27:19 +0000
88@@ -253,7 +253,6 @@
89 "categories": categories,
90 "changes": changes,
91 "description": description,
92- "doctype": "charm",
93 "hooks": [
94 "install",
95 "start",
96@@ -327,7 +326,6 @@
97 branch_deleted=branch_deleted,
98 data=data,
99 description=description,
100- doctype='bundle',
101 inherits=inherits,
102 name=name,
103 owner=owner,
104
105=== modified file 'charmworld/tests/test_models.py'
106--- charmworld/tests/test_models.py 2013-08-09 20:47:40 +0000
107+++ charmworld/tests/test_models.py 2013-08-12 21:27:19 +0000
108@@ -1558,7 +1558,6 @@
109 'inherits': 'main-mysql',
110 'title': 'Tiny bundle',
111 'description': 'My Tiny Bundle',
112- 'doctype': 'bundle',
113 'data': {
114 'services': dict(apache=1),
115 'relations': dict(a=1),
116
117=== modified file 'charmworld/tests/test_search.py'
118--- charmworld/tests/test_search.py 2013-08-09 20:47:40 +0000
119+++ charmworld/tests/test_search.py 2013-08-12 21:27:19 +0000
120@@ -252,7 +252,6 @@
121 charm['provides']['website']['interface'] = 'gopher'
122 charm['requires']['database']['interface'] = 'reiserfs'
123 charm['_id'] = 'asdf'
124- charm['doctype'] = 'bogustype'
125 # Best-effort ensure there's no overlap between search terms
126 items = charm.items()
127 for num, (key, value) in enumerate(items):
128
129=== modified file 'charmworld/views/tests/test_api.py'
130--- charmworld/views/tests/test_api.py 2013-08-09 20:47:40 +0000
131+++ charmworld/views/tests/test_api.py 2013-08-12 21:27:19 +0000
132@@ -644,7 +644,6 @@
133 series='precise',
134 ),
135 description='',
136- doctype='bundle',
137 promulgated=False,
138 branch_deleted=False,
139 )
140
141=== modified file 'charmworld/views/tests/test_charms.py'
142--- charmworld/views/tests/test_charms.py 2013-08-09 13:25:55 +0000
143+++ charmworld/views/tests/test_charms.py 2013-08-12 21:27:19 +0000
144@@ -70,7 +70,6 @@
145 }
146 }
147 },
148- 'doctype': 'charm',
149 'downloads': 0,
150 'downloads_in_past_7_days': 0,
151 'downloads_in_past_30_days': 0,

Subscribers

People subscribed via source and target branches