Merge ~xnox/launchpad:core20 into launchpad:master

Proposed by Dimitri John Ledkov
Status: Merged
Approved by: Colin Watson
Approved revision: bdf8b13e4e8bd55b0690890f4013e6adaeb93f0b
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~xnox/launchpad:core20
Merge into: launchpad:master
Diff against target: 217 lines (+34/-14)
7 files modified
lib/lp/snappy/browser/tests/test_snap.py (+5/-1)
lib/lp/snappy/browser/widgets/snapbuildchannels.py (+1/-1)
lib/lp/snappy/browser/widgets/templates/snapbuildchannels.pt (+4/-0)
lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py (+14/-2)
lib/lp/snappy/interfaces/snap.py (+6/-6)
lib/lp/snappy/interfaces/snapbuild.py (+2/-2)
lib/lp/snappy/interfaces/snapjob.py (+2/-2)
Reviewer Review Type Date Requested Status
Colin Watson (community) Approve
Review via email: mp+375089@code.launchpad.net

Commit message

Add core20 UI support

Description of the change

Add core20 UI support

To post a comment you must log in.
Revision history for this message
Colin Watson (cjwatson) wrote :

Have you confirmed with the snappy team that core16 is actually usable? Last I checked it existed but if you tried to use it in reality it wasn't going to go well for you. As a result I deliberately omitted it from the UI.

review: Needs Information
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

Dropped core16 options.

Revision history for this message
Michael Vogt (mvo) wrote :

Hey, thanks for this PR! I think its fine to leave core16 from the UI for now, we will certainly come back to this one but for now focusing on core20 is more important.

Revision history for this message
Colin Watson (cjwatson) wrote :

LGTM, but https://portal.admin.canonical.com/C122305 needs to be done before this can land.

review: Approve
Revision history for this message
Dimitri John Ledkov (xnox) wrote :

RT is now marked as done.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/lp/snappy/browser/tests/test_snap.py b/lib/lp/snappy/browser/tests/test_snap.py
2index bffd4d1..339ab44 100644
3--- a/lib/lp/snappy/browser/tests/test_snap.py
4+++ b/lib/lp/snappy/browser/tests/test_snap.py
5@@ -431,6 +431,8 @@ class TestSnapAddView(BaseTestSnapView):
6 browser.getControl(
7 name="field.auto_build_channels.core18").value = "beta"
8 browser.getControl(
9+ name="field.auto_build_channels.core20").value = "edge/feature"
10+ browser.getControl(
11 name="field.auto_build_channels.snapcraft").value = "edge"
12 browser.getControl("Create snap package").click()
13
14@@ -447,7 +449,8 @@ class TestSnapAddView(BaseTestSnapView):
15 MatchesTagText(content, "auto_build_pocket"))
16 self.assertThat(
17 "Source snap channels for automatic builds:\nEdit snap package\n"
18- "core\nstable\ncore18\nbeta\nsnapcraft\nedge\n",
19+ "core\nstable\ncore18\nbeta\n"
20+ "core20\nedge/feature\nsnapcraft\nedge\n",
21 MatchesTagText(content, "auto_build_channels"))
22
23 @responses.activate
24@@ -1674,6 +1677,7 @@ class TestSnapRequestBuildsView(BaseTestSnapView):
25 Source snap channels:
26 core
27 core18
28+ core20
29 snapcraft
30 The channels to use for build tools when building the snap
31 package.
32diff --git a/lib/lp/snappy/browser/widgets/snapbuildchannels.py b/lib/lp/snappy/browser/widgets/snapbuildchannels.py
33index 368f9ab..fb1e600 100644
34--- a/lib/lp/snappy/browser/widgets/snapbuildchannels.py
35+++ b/lib/lp/snappy/browser/widgets/snapbuildchannels.py
36@@ -36,7 +36,7 @@ class SnapBuildChannelsWidget(BrowserWidget, InputWidget):
37
38 template = ViewPageTemplateFile("templates/snapbuildchannels.pt")
39 hint = False
40- snap_names = ["core", "core18", "snapcraft"]
41+ snap_names = ["core", "core18", "core20", "snapcraft"]
42 _widgets_set_up = False
43
44 def __init__(self, context, request):
45diff --git a/lib/lp/snappy/browser/widgets/templates/snapbuildchannels.pt b/lib/lp/snappy/browser/widgets/templates/snapbuildchannels.pt
46index 48b5d41..28700a3 100644
47--- a/lib/lp/snappy/browser/widgets/templates/snapbuildchannels.pt
48+++ b/lib/lp/snappy/browser/widgets/templates/snapbuildchannels.pt
49@@ -12,6 +12,10 @@
50 <td><div tal:content="structure view/core18_widget" /></td>
51 </tr>
52 <tr>
53+ <td>core20</td>
54+ <td><div tal:content="structure view/core20_widget" /></td>
55+ </tr>
56+ <tr>
57 <td>snapcraft</td>
58 <td><div tal:content="structure view/snapcraft_widget" /></td>
59 </tr>
60diff --git a/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py b/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py
61index 3cac446..b9231d7 100644
62--- a/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py
63+++ b/lib/lp/snappy/browser/widgets/tests/test_snapbuildchannelswidget.py
64@@ -90,6 +90,7 @@ class TestSnapBuildChannelsWidget(TestCaseWithFactory):
65 self.assertTrue(self.widget._widgets_set_up)
66 self.assertIsNotNone(getattr(self.widget, "core_widget", None))
67 self.assertIsNotNone(getattr(self.widget, "core18_widget", None))
68+ self.assertIsNotNone(getattr(self.widget, "core20_widget", None))
69 self.assertIsNotNone(getattr(self.widget, "snapcraft_widget", None))
70
71 def test_setUpSubWidgets_second_call(self):
72@@ -99,33 +100,39 @@ class TestSnapBuildChannelsWidget(TestCaseWithFactory):
73 self.widget.setUpSubWidgets()
74 self.assertIsNone(getattr(self.widget, "core_widget", None))
75 self.assertIsNone(getattr(self.widget, "core18_widget", None))
76+ self.assertIsNone(getattr(self.widget, "core20_widget", None))
77 self.assertIsNone(getattr(self.widget, "snapcraft_widget", None))
78
79 def test_setRenderedValue_None(self):
80 self.widget.setRenderedValue(None)
81 self.assertIsNone(self.widget.core_widget._getCurrentValue())
82 self.assertIsNone(self.widget.core18_widget._getCurrentValue())
83+ self.assertIsNone(self.widget.core20_widget._getCurrentValue())
84 self.assertIsNone(self.widget.snapcraft_widget._getCurrentValue())
85
86 def test_setRenderedValue_empty(self):
87 self.widget.setRenderedValue({})
88 self.assertIsNone(self.widget.core_widget._getCurrentValue())
89 self.assertIsNone(self.widget.core18_widget._getCurrentValue())
90+ self.assertIsNone(self.widget.core20_widget._getCurrentValue())
91 self.assertIsNone(self.widget.snapcraft_widget._getCurrentValue())
92
93 def test_setRenderedValue_one_channel(self):
94 self.widget.setRenderedValue({"snapcraft": "stable"})
95 self.assertIsNone(self.widget.core_widget._getCurrentValue())
96 self.assertIsNone(self.widget.core18_widget._getCurrentValue())
97+ self.assertIsNone(self.widget.core20_widget._getCurrentValue())
98 self.assertEqual(
99 "stable", self.widget.snapcraft_widget._getCurrentValue())
100
101 def test_setRenderedValue_all_channels(self):
102 self.widget.setRenderedValue(
103- {"core": "candidate", "core18": "beta", "snapcraft": "stable"})
104+ {"core": "candidate", "core18": "beta", "core20": "edge",
105+ "snapcraft": "stable"})
106 self.assertEqual(
107 "candidate", self.widget.core_widget._getCurrentValue())
108 self.assertEqual("beta", self.widget.core18_widget._getCurrentValue())
109+ self.assertEqual("edge", self.widget.core20_widget._getCurrentValue())
110 self.assertEqual(
111 "stable", self.widget.snapcraft_widget._getCurrentValue())
112
113@@ -147,6 +154,7 @@ class TestSnapBuildChannelsWidget(TestCaseWithFactory):
114 form = {
115 "field.auto_build_channels.core": "",
116 "field.auto_build_channels.core18": "beta",
117+ "field.auto_build_channels.core20": "edge",
118 "field.auto_build_channels.snapcraft": "stable",
119 }
120 self.widget.request = LaunchpadTestRequest(form=form)
121@@ -156,11 +164,13 @@ class TestSnapBuildChannelsWidget(TestCaseWithFactory):
122 form = {
123 "field.auto_build_channels.core": "",
124 "field.auto_build_channels.core18": "beta",
125+ "field.auto_build_channels.core20": "edge",
126 "field.auto_build_channels.snapcraft": "stable",
127 }
128 self.widget.request = LaunchpadTestRequest(form=form)
129 self.assertEqual(
130- {"core18": "beta", "snapcraft": "stable"},
131+ {"core18": "beta", "core20": "edge",
132+ "snapcraft": "stable"},
133 self.widget.getInputValue())
134
135 def test_call(self):
136@@ -168,12 +178,14 @@ class TestSnapBuildChannelsWidget(TestCaseWithFactory):
137 markup = self.widget()
138 self.assertIsNotNone(self.widget.core_widget)
139 self.assertIsNotNone(self.widget.core18_widget)
140+ self.assertIsNotNone(self.widget.core20_widget)
141 self.assertIsNotNone(self.widget.snapcraft_widget)
142 soup = BeautifulSoup(markup)
143 fields = soup.findAll(["input"], {"id": re.compile(".*")})
144 expected_ids = [
145 "field.auto_build_channels.core",
146 "field.auto_build_channels.core18",
147+ "field.auto_build_channels.core20",
148 "field.auto_build_channels.snapcraft",
149 ]
150 ids = [field["id"] for field in fields]
151diff --git a/lib/lp/snappy/interfaces/snap.py b/lib/lp/snappy/interfaces/snap.py
152index 70626c9..b408462 100644
153--- a/lib/lp/snappy/interfaces/snap.py
154+++ b/lib/lp/snappy/interfaces/snap.py
155@@ -394,8 +394,8 @@ class ISnapView(Interface):
156 title=_("Source snap channels to use for this build."),
157 description=_(
158 "A dictionary mapping snap names to channels to use for this "
159- "build. Currently only 'core', 'core18', and 'snapcraft' "
160- "keys are supported."),
161+ "build. Currently only 'core', 'core18', 'core20' "
162+ "and 'snapcraft' keys are supported."),
163 key_type=TextLine(), required=False))
164 # Really ISnapBuild, patched in lp.snappy.interfaces.webservice.
165 @export_factory_operation(Interface, [])
166@@ -423,8 +423,8 @@ class ISnapView(Interface):
167 title=_("Source snap channels to use for this build."),
168 description=_(
169 "A dictionary mapping snap names to channels to use for this "
170- "build. Currently only 'core', 'core18', and 'snapcraft' "
171- "keys are supported."),
172+ "build. Currently only 'core', 'core18', 'core20' "
173+ "and 'snapcraft' keys are supported."),
174 key_type=TextLine(), required=False))
175 @export_factory_operation(ISnapBuildRequest, [])
176 @operation_for_version("devel")
177@@ -755,8 +755,8 @@ class ISnapEditableAttributes(IHasOwner):
178 key_type=TextLine(), required=False, readonly=False,
179 description=_(
180 "A dictionary mapping snap names to channels to use when building "
181- "this snap package. Currently only 'core', 'core18', and "
182- "'snapcraft' keys are supported.")))
183+ "this snap package. Currently only 'core', 'core18', "
184+ "'core20' and 'snapcraft' keys are supported.")))
185
186 is_stale = Bool(
187 title=_("Snap package is stale and is due to be rebuilt."),
188diff --git a/lib/lp/snappy/interfaces/snapbuild.py b/lib/lp/snappy/interfaces/snapbuild.py
189index fdd9c86..f52e006 100644
190--- a/lib/lp/snappy/interfaces/snapbuild.py
191+++ b/lib/lp/snappy/interfaces/snapbuild.py
192@@ -169,8 +169,8 @@ class ISnapBuildView(IPackageBuild):
193 title=_("Source snap channels to use for this build."),
194 description=_(
195 "A dictionary mapping snap names to channels to use for this "
196- "build. Currently only 'core', 'core18', and 'snapcraft' keys "
197- "are supported."),
198+ "build. Currently only 'core', 'core18', 'core20' "
199+ "and 'snapcraft' keys are supported."),
200 key_type=TextLine()))
201
202 virtualized = Bool(
203diff --git a/lib/lp/snappy/interfaces/snapjob.py b/lib/lp/snappy/interfaces/snapjob.py
204index 276362a..8a10143 100644
205--- a/lib/lp/snappy/interfaces/snapjob.py
206+++ b/lib/lp/snappy/interfaces/snapjob.py
207@@ -75,8 +75,8 @@ class ISnapRequestBuildsJob(IRunnableJob):
208 title=_("Source snap channels to use for these builds."),
209 description=_(
210 "A dictionary mapping snap names to channels to use for these "
211- "builds. Currently only 'core', 'core18', and 'snapcraft' keys "
212- "are supported."),
213+ "builds. Currently only 'core', 'core18', 'core20' "
214+ "and 'snapcraft' keys are supported."),
215 key_type=TextLine(), required=False, readonly=True)
216
217 architectures = Set(

Subscribers

People subscribed via source and target branches

to status/vote changes: