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
=== modified file 'bus/systemimage/systemimage.go'
--- bus/systemimage/systemimage.go 2015-01-21 17:21:42 +0000
+++ bus/systemimage/systemimage.go 2016-03-09 15:34:29 +0000
@@ -18,6 +18,9 @@
18package systemimage18package systemimage
1919
20import (20import (
21 "strconv"
22 "strings"
23
21 "launchpad.net/ubuntu-push/bus"24 "launchpad.net/ubuntu-push/bus"
22 "launchpad.net/ubuntu-push/logger"25 "launchpad.net/ubuntu-push/logger"
23)26)
@@ -37,11 +40,12 @@
37 // xxx channel_target missing40 // xxx channel_target missing
38 LastUpdate string41 LastUpdate string
39 VersionDetail map[string]string42 VersionDetail map[string]string
43 Raw map[string]string
40}44}
4145
42// A SystemImage exposes the a subset of system-image service.46// A SystemImage exposes the a subset of system-image service.
43type SystemImage interface {47type SystemImage interface {
44 Info() (*InfoResult, error)48 Information() (*InfoResult, error)
45}49}
4650
47type systemImage struct {51type systemImage struct {
@@ -56,13 +60,37 @@
5660
57var _ SystemImage = &systemImage{} // ensures it conforms61var _ SystemImage = &systemImage{} // ensures it conforms
5862
59func (si *systemImage) Info() (*InfoResult, error) {63func (si *systemImage) Information() (*InfoResult, error) {
60 si.log.Debugf("invoking Info")64 si.log.Debugf("invoking Information")
61 res := &InfoResult{}65 m := map[string]string{}
62 err := si.endp.Call("Info", bus.Args(), &res.BuildNumber, &res.Device, &res.Channel, &res.LastUpdate, &res.VersionDetail)66 err := si.endp.Call("Information", bus.Args(), &m)
67
63 if err != nil {68 if err != nil {
64 si.log.Errorf("Info failed: %v", err)69 si.log.Errorf("Information failed: %v", err)
65 return nil, err70 return nil, err
66 }71 }
72
73 res := &InfoResult{}
74
75 bn, err := strconv.ParseInt(m["current_build_number"], 10, 32)
76 if err == nil {
77 res.BuildNumber = int32(bn)
78 } else {
79 res.BuildNumber = -1
80 }
81
82 res.Device = m["device_name"]
83 res.Channel = m["channel_name"]
84 res.LastUpdate = m["last_update_date"]
85 res.VersionDetail = map[string]string{}
86
87 // Split version detail key=value,key2=value2 into a string map
88 vals := strings.Split(m["version_detail"], ",")
89 for _, val := range vals {
90 pairs := strings.Split(val, "=")
91 res.VersionDetail[pairs[0]] = pairs[1]
92 }
93 res.Raw = m
94
67 return res, err95 return res, err
68}96}
6997
=== modified file 'bus/systemimage/systemimage_test.go'
--- bus/systemimage/systemimage_test.go 2014-04-02 08:46:48 +0000
+++ bus/systemimage/systemimage_test.go 2016-03-09 15:34:29 +0000
@@ -41,22 +41,38 @@
41}41}
4242
43func (s *SISuite) TestWorks(c *C) {43func (s *SISuite) TestWorks(c *C) {
44 endp := testibus.NewMultiValuedTestingEndpoint(nil, condition.Work(true), []interface{}{int32(101), "mako", "daily", "Unknown", map[string]string{}})44 m := map[string]string{
45 "version_detail": "ubuntu=20160304.2,device=20160304.2,custom=20160304.2,version=381",
46 "last_update_date": "2016-03-04 15:25:31",
47 "last_check_date": "2016-03-08 04:30:34",
48 "target_version_detail": "-1",
49 "device_name": "mako",
50 "target_build_number": "-1",
51 "channel_name": "ubuntu-touch/rc-proposed/ubuntu",
52 "current_build_number": "381",
53 }
54 endp := testibus.NewMultiValuedTestingEndpoint(nil, condition.Work(true), []interface{}{m})
45 si := New(endp, s.log)55 si := New(endp, s.log)
46 res, err := si.Info()56 res, err := si.Information()
47 c.Assert(err, IsNil)57 c.Assert(err, IsNil)
48 c.Check(res, DeepEquals, &InfoResult{58 c.Check(res, DeepEquals, &InfoResult{
49 BuildNumber: 101,59 BuildNumber: 381,
50 Device: "mako",60 Device: "mako",
51 Channel: "daily",61 Channel: "ubuntu-touch/rc-proposed/ubuntu",
52 LastUpdate: "Unknown",62 LastUpdate: "2016-03-04 15:25:31",
53 VersionDetail: map[string]string{},63 VersionDetail: map[string]string{
64 "ubuntu": "20160304.2",
65 "device": "20160304.2",
66 "custom": "20160304.2",
67 "version": "381",
68 },
69 Raw: m,
54 })70 })
55}71}
5672
57func (s *SISuite) TestFailsIfCallFails(c *C) {73func (s *SISuite) TestFailsIfCallFails(c *C) {
58 endp := testibus.NewTestingEndpoint(nil, condition.Work(false))74 endp := testibus.NewTestingEndpoint(nil, condition.Work(false))
59 si := New(endp, s.log)75 si := New(endp, s.log)
60 _, err := si.Info()76 _, err := si.Information()
61 c.Check(err, NotNil)77 c.Check(err, NotNil)
62}78}
6379
=== modified file 'client/client.go'
--- client/client.go 2015-09-30 14:44:14 +0000
+++ client/client.go 2016-03-09 15:34:29 +0000
@@ -292,7 +292,7 @@
292 go cs.Track(client.connCh)292 go cs.Track(client.connCh)
293 util.NewAutoRedialer(client.systemImageEndp).Redial()293 util.NewAutoRedialer(client.systemImageEndp).Redial()
294 sysimg := systemimage.New(client.systemImageEndp, client.log)294 sysimg := systemimage.New(client.systemImageEndp, client.log)
295 info, err := sysimg.Info()295 info, err := sysimg.Information()
296 if err != nil {296 if err != nil {
297 return err297 return err
298 }298 }
299299
=== modified file 'client/client_test.go'
--- client/client_test.go 2015-10-01 20:16:49 +0000
+++ client/client_test.go 2016-03-09 15:34:29 +0000
@@ -674,7 +674,7 @@
674 dbus.ObjectPath("hello"),674 dbus.ObjectPath("hello"),
675 )675 )
676 siCond := condition.Fail2Work(2)676 siCond := condition.Fail2Work(2)
677 siEndp := testibus.NewMultiValuedTestingEndpoint(siCond, condition.Work(true), []interface{}{int32(101), "mako", "daily", "Unknown", map[string]string{}})677 siEndp := testibus.NewMultiValuedTestingEndpoint(siCond, condition.Work(true), []interface{}{map[string]string{}})
678 tickerCh := make(chan []interface{})678 tickerCh := make(chan []interface{})
679 nopTickerCh := make(chan []interface{})679 nopTickerCh := make(chan []interface{})
680 testibus.SetWatchSource(cEndp, "StateChanged", tickerCh)680 testibus.SetWatchSource(cEndp, "StateChanged", tickerCh)
681681
=== modified file 'debian/changelog'
--- debian/changelog 2015-11-20 18:02:47 +0000
+++ debian/changelog 2016-03-09 15:34:29 +0000
@@ -1,3 +1,80 @@
1ubuntu-push (0.68+16.04.20160114-0ubuntu1) xenial; urgency=medium
2
3 * Handle gccgo on s390x. (LP: #1517189, #1469398)
4
5 -- Rodney Dawes <ci-train-bot@canonical.com> Thu, 14 Jan 2016 21:13:22 +0000
6
7ubuntu-push (0.68+16.04.20151210-0ubuntu1) xenial; urgency=medium
8
9 [ jonas-drange ]
10 * use Notifications dbus API to play sounds (LP: #1517189, #1469398)
11
12 -- Jonas G. Drange <ci-train-bot@canonical.com> Thu, 10 Dec 2015 10:16:28 +0000
13
14ubuntu-push (0.68+16.04.20151203-0ubuntu1) xenial; urgency=medium
15
16 [ CI Train Bot ]
17 * New rebuild forced.
18
19 [ jonas-drange ]
20 * present a notification even though the screen is locked (LP:
21 #1517189, #1469398)
22
23 -- Jonas G. Drange <ci-train-bot@canonical.com> Thu, 03 Dec 2015 14:56:24 +0000
24
25ubuntu-push (0.68+16.04.20151130-0ubuntu1) xenial; urgency=medium
26
27 [ CI Train Bot ]
28 * Add support for signing methods other than POST via argv[2]. Test
29 fixes for Go 1.5. Avoid losing notifications when screen is locked.
30 Fix lp:1469398 by using the connectivity state. Fix case where a
31 failed powerd wakeup request would deadlock step(). Assert whether
32 or not there's a connection using the same method as local
33 connectivity package. (LP: #1517189, #1469398)
34 * New rebuild forced.
35
36 [ John R. Lenton ]
37 * Add support for signing methods other than POST via argv[2]. Test
38 fixes for Go 1.5. Avoid losing notifications when screen is locked.
39 Fix lp:1469398 by using the connectivity state. Fix case where a
40 failed powerd wakeup request would deadlock step(). Assert whether
41 or not there's a connection using the same method as local
42 connectivity package. (LP: #1517189, #1469398)
43
44 [ Michael Hudson-Doyle ]
45 * Add support for signing methods other than POST via argv[2]. Test
46 fixes for Go 1.5. Avoid losing notifications when screen is locked.
47 Fix lp:1469398 by using the connectivity state. Fix case where a
48 failed powerd wakeup request would deadlock step(). Assert whether
49 or not there's a connection using the same method as local
50 connectivity package. (LP: #1517189, #1469398)
51
52 [ Rodney Dawes ]
53 * Add support for signing methods other than POST via argv[2]. Test
54 fixes for Go 1.5. Avoid losing notifications when screen is locked.
55 Fix lp:1469398 by using the connectivity state. Fix case where a
56 failed powerd wakeup request would deadlock step(). Assert whether
57 or not there's a connection using the same method as local
58 connectivity package. (LP: #1517189, #1469398)
59
60 [ Samuele Pedroni (Canonical Services Ltd.) ]
61 * Add support for signing methods other than POST via argv[2]. Test
62 fixes for Go 1.5. Avoid losing notifications when screen is locked.
63 Fix lp:1469398 by using the connectivity state. Fix case where a
64 failed powerd wakeup request would deadlock step(). Assert whether
65 or not there's a connection using the same method as local
66 connectivity package. (LP: #1517189, #1469398)
67
68 [ jonas-drange ]
69 * Add support for signing methods other than POST via argv[2]. Test
70 fixes for Go 1.5. Avoid losing notifications when screen is locked.
71 Fix lp:1469398 by using the connectivity state. Fix case where a
72 failed powerd wakeup request would deadlock step(). Assert whether
73 or not there's a connection using the same method as local
74 connectivity package. (LP: #1517189, #1469398)
75
76 -- Timo Jyrinki <timo.jyrinki@canonical.com> Mon, 30 Nov 2015 21:16:20 +0000
77
1ubuntu-push (0.68+15.10.20150814.1-0ubuntu1) wily; urgency=medium78ubuntu-push (0.68+15.10.20150814.1-0ubuntu1) wily; urgency=medium
279
3 [ CI Train Bot ]80 [ CI Train Bot ]

Subscribers

People subscribed via source and target branches