Merge lp:~jonas-drange/ubuntu-push/lp1554547 into lp:ubuntu-push/automatic

Proposed by Jonas G. Drange
Status: Rejected
Rejected by: Jonas G. Drange
Proposed branch: lp:~jonas-drange/ubuntu-push/lp1554547
Merge into: lp:ubuntu-push/automatic
Diff against target: 232 lines (+137/-16)
5 files modified
bus/systemimage/systemimage.go (+34/-6)
bus/systemimage/systemimage_test.go (+24/-8)
client/client.go (+1/-1)
client/client_test.go (+1/-1)
debian/changelog (+77/-0)
To merge this branch: bzr merge lp:~jonas-drange/ubuntu-push/lp1554547
Reviewer Review Type Date Requested Status
Jonas G. Drange (community) Approve
Review via email: mp+288426@code.launchpad.net

Commit message

deprecate the usage of Info and replace it with Information

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

Looks ok.

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There was a problem validating some authors of the branch. Authors must be either one of the listed Launchpad users, or a member of one of the listed teams on Launchpad.

Persons or Teams:

    contributor-agreement-canonical
    ubuntu-push-hackers

Unaccepted Authors:

    CI Train Bot <email address hidden>
    Rodney Dawes <email address hidden>

Revision history for this message
Jonas G. Drange (jonas-drange) wrote :

Mirror of dobey's ack.

review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There was a problem validating some authors of the branch. Authors must be either one of the listed Launchpad users, or a member of one of the listed teams on Launchpad.

Persons or Teams:

    contributor-agreement-canonical
    ubuntu-push-hackers

Unaccepted Authors:

    CI Train Bot <email address hidden>
    Rodney Dawes <email address hidden>

Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :

There are additional revisions which have not been approved in review. Please seek review and approval of these new revisions.

Unmerged revisions

160. By Jonas G. Drange

fix test failure in client caused by Info -> Information

159. By Jonas G. Drange

deprecate the Info usage

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bus/systemimage/systemimage.go'
2--- bus/systemimage/systemimage.go 2015-01-21 17:21:42 +0000
3+++ bus/systemimage/systemimage.go 2016-03-09 15:34:29 +0000
4@@ -18,6 +18,9 @@
5 package systemimage
6
7 import (
8+ "strconv"
9+ "strings"
10+
11 "launchpad.net/ubuntu-push/bus"
12 "launchpad.net/ubuntu-push/logger"
13 )
14@@ -37,11 +40,12 @@
15 // xxx channel_target missing
16 LastUpdate string
17 VersionDetail map[string]string
18+ Raw map[string]string
19 }
20
21 // A SystemImage exposes the a subset of system-image service.
22 type SystemImage interface {
23- Info() (*InfoResult, error)
24+ Information() (*InfoResult, error)
25 }
26
27 type systemImage struct {
28@@ -56,13 +60,37 @@
29
30 var _ SystemImage = &systemImage{} // ensures it conforms
31
32-func (si *systemImage) Info() (*InfoResult, error) {
33- si.log.Debugf("invoking Info")
34- res := &InfoResult{}
35- err := si.endp.Call("Info", bus.Args(), &res.BuildNumber, &res.Device, &res.Channel, &res.LastUpdate, &res.VersionDetail)
36+func (si *systemImage) Information() (*InfoResult, error) {
37+ si.log.Debugf("invoking Information")
38+ m := map[string]string{}
39+ err := si.endp.Call("Information", bus.Args(), &m)
40+
41 if err != nil {
42- si.log.Errorf("Info failed: %v", err)
43+ si.log.Errorf("Information failed: %v", err)
44 return nil, err
45 }
46+
47+ res := &InfoResult{}
48+
49+ bn, err := strconv.ParseInt(m["current_build_number"], 10, 32)
50+ if err == nil {
51+ res.BuildNumber = int32(bn)
52+ } else {
53+ res.BuildNumber = -1
54+ }
55+
56+ res.Device = m["device_name"]
57+ res.Channel = m["channel_name"]
58+ res.LastUpdate = m["last_update_date"]
59+ res.VersionDetail = map[string]string{}
60+
61+ // Split version detail key=value,key2=value2 into a string map
62+ vals := strings.Split(m["version_detail"], ",")
63+ for _, val := range vals {
64+ pairs := strings.Split(val, "=")
65+ res.VersionDetail[pairs[0]] = pairs[1]
66+ }
67+ res.Raw = m
68+
69 return res, err
70 }
71
72=== modified file 'bus/systemimage/systemimage_test.go'
73--- bus/systemimage/systemimage_test.go 2014-04-02 08:46:48 +0000
74+++ bus/systemimage/systemimage_test.go 2016-03-09 15:34:29 +0000
75@@ -41,22 +41,38 @@
76 }
77
78 func (s *SISuite) TestWorks(c *C) {
79- endp := testibus.NewMultiValuedTestingEndpoint(nil, condition.Work(true), []interface{}{int32(101), "mako", "daily", "Unknown", map[string]string{}})
80+ m := map[string]string{
81+ "version_detail": "ubuntu=20160304.2,device=20160304.2,custom=20160304.2,version=381",
82+ "last_update_date": "2016-03-04 15:25:31",
83+ "last_check_date": "2016-03-08 04:30:34",
84+ "target_version_detail": "-1",
85+ "device_name": "mako",
86+ "target_build_number": "-1",
87+ "channel_name": "ubuntu-touch/rc-proposed/ubuntu",
88+ "current_build_number": "381",
89+ }
90+ endp := testibus.NewMultiValuedTestingEndpoint(nil, condition.Work(true), []interface{}{m})
91 si := New(endp, s.log)
92- res, err := si.Info()
93+ res, err := si.Information()
94 c.Assert(err, IsNil)
95 c.Check(res, DeepEquals, &InfoResult{
96- BuildNumber: 101,
97- Device: "mako",
98- Channel: "daily",
99- LastUpdate: "Unknown",
100- VersionDetail: map[string]string{},
101+ BuildNumber: 381,
102+ Device: "mako",
103+ Channel: "ubuntu-touch/rc-proposed/ubuntu",
104+ LastUpdate: "2016-03-04 15:25:31",
105+ VersionDetail: map[string]string{
106+ "ubuntu": "20160304.2",
107+ "device": "20160304.2",
108+ "custom": "20160304.2",
109+ "version": "381",
110+ },
111+ Raw: m,
112 })
113 }
114
115 func (s *SISuite) TestFailsIfCallFails(c *C) {
116 endp := testibus.NewTestingEndpoint(nil, condition.Work(false))
117 si := New(endp, s.log)
118- _, err := si.Info()
119+ _, err := si.Information()
120 c.Check(err, NotNil)
121 }
122
123=== modified file 'client/client.go'
124--- client/client.go 2015-09-30 14:44:14 +0000
125+++ client/client.go 2016-03-09 15:34:29 +0000
126@@ -292,7 +292,7 @@
127 go cs.Track(client.connCh)
128 util.NewAutoRedialer(client.systemImageEndp).Redial()
129 sysimg := systemimage.New(client.systemImageEndp, client.log)
130- info, err := sysimg.Info()
131+ info, err := sysimg.Information()
132 if err != nil {
133 return err
134 }
135
136=== modified file 'client/client_test.go'
137--- client/client_test.go 2015-10-01 20:16:49 +0000
138+++ client/client_test.go 2016-03-09 15:34:29 +0000
139@@ -674,7 +674,7 @@
140 dbus.ObjectPath("hello"),
141 )
142 siCond := condition.Fail2Work(2)
143- siEndp := testibus.NewMultiValuedTestingEndpoint(siCond, condition.Work(true), []interface{}{int32(101), "mako", "daily", "Unknown", map[string]string{}})
144+ siEndp := testibus.NewMultiValuedTestingEndpoint(siCond, condition.Work(true), []interface{}{map[string]string{}})
145 tickerCh := make(chan []interface{})
146 nopTickerCh := make(chan []interface{})
147 testibus.SetWatchSource(cEndp, "StateChanged", tickerCh)
148
149=== modified file 'debian/changelog'
150--- debian/changelog 2015-11-20 18:02:47 +0000
151+++ debian/changelog 2016-03-09 15:34:29 +0000
152@@ -1,3 +1,80 @@
153+ubuntu-push (0.68+16.04.20160114-0ubuntu1) xenial; urgency=medium
154+
155+ * Handle gccgo on s390x. (LP: #1517189, #1469398)
156+
157+ -- Rodney Dawes <ci-train-bot@canonical.com> Thu, 14 Jan 2016 21:13:22 +0000
158+
159+ubuntu-push (0.68+16.04.20151210-0ubuntu1) xenial; urgency=medium
160+
161+ [ jonas-drange ]
162+ * use Notifications dbus API to play sounds (LP: #1517189, #1469398)
163+
164+ -- Jonas G. Drange <ci-train-bot@canonical.com> Thu, 10 Dec 2015 10:16:28 +0000
165+
166+ubuntu-push (0.68+16.04.20151203-0ubuntu1) xenial; urgency=medium
167+
168+ [ CI Train Bot ]
169+ * New rebuild forced.
170+
171+ [ jonas-drange ]
172+ * present a notification even though the screen is locked (LP:
173+ #1517189, #1469398)
174+
175+ -- Jonas G. Drange <ci-train-bot@canonical.com> Thu, 03 Dec 2015 14:56:24 +0000
176+
177+ubuntu-push (0.68+16.04.20151130-0ubuntu1) xenial; urgency=medium
178+
179+ [ CI Train Bot ]
180+ * Add support for signing methods other than POST via argv[2]. Test
181+ fixes for Go 1.5. Avoid losing notifications when screen is locked.
182+ Fix lp:1469398 by using the connectivity state. Fix case where a
183+ failed powerd wakeup request would deadlock step(). Assert whether
184+ or not there's a connection using the same method as local
185+ connectivity package. (LP: #1517189, #1469398)
186+ * New rebuild forced.
187+
188+ [ John R. Lenton ]
189+ * Add support for signing methods other than POST via argv[2]. Test
190+ fixes for Go 1.5. Avoid losing notifications when screen is locked.
191+ Fix lp:1469398 by using the connectivity state. Fix case where a
192+ failed powerd wakeup request would deadlock step(). Assert whether
193+ or not there's a connection using the same method as local
194+ connectivity package. (LP: #1517189, #1469398)
195+
196+ [ Michael Hudson-Doyle ]
197+ * Add support for signing methods other than POST via argv[2]. Test
198+ fixes for Go 1.5. Avoid losing notifications when screen is locked.
199+ Fix lp:1469398 by using the connectivity state. Fix case where a
200+ failed powerd wakeup request would deadlock step(). Assert whether
201+ or not there's a connection using the same method as local
202+ connectivity package. (LP: #1517189, #1469398)
203+
204+ [ Rodney Dawes ]
205+ * Add support for signing methods other than POST via argv[2]. Test
206+ fixes for Go 1.5. Avoid losing notifications when screen is locked.
207+ Fix lp:1469398 by using the connectivity state. Fix case where a
208+ failed powerd wakeup request would deadlock step(). Assert whether
209+ or not there's a connection using the same method as local
210+ connectivity package. (LP: #1517189, #1469398)
211+
212+ [ Samuele Pedroni (Canonical Services Ltd.) ]
213+ * Add support for signing methods other than POST via argv[2]. Test
214+ fixes for Go 1.5. Avoid losing notifications when screen is locked.
215+ Fix lp:1469398 by using the connectivity state. Fix case where a
216+ failed powerd wakeup request would deadlock step(). Assert whether
217+ or not there's a connection using the same method as local
218+ connectivity package. (LP: #1517189, #1469398)
219+
220+ [ jonas-drange ]
221+ * Add support for signing methods other than POST via argv[2]. Test
222+ fixes for Go 1.5. Avoid losing notifications when screen is locked.
223+ Fix lp:1469398 by using the connectivity state. Fix case where a
224+ failed powerd wakeup request would deadlock step(). Assert whether
225+ or not there's a connection using the same method as local
226+ connectivity package. (LP: #1517189, #1469398)
227+
228+ -- Timo Jyrinki <timo.jyrinki@canonical.com> Mon, 30 Nov 2015 21:16:20 +0000
229+
230 ubuntu-push (0.68+15.10.20150814.1-0ubuntu1) wily; urgency=medium
231
232 [ CI Train Bot ]

Subscribers

People subscribed via source and target branches