Merge lp:~chipaca/ubuntu-push/beta-here-we-come into lp:ubuntu-push

Proposed by John Lenton
Status: Merged
Approved by: John Lenton
Approved revision: 95
Merged at revision: 92
Proposed branch: lp:~chipaca/ubuntu-push/beta-here-we-come
Merge into: lp:ubuntu-push
Diff against target: 164 lines (+26/-16)
6 files modified
client/client.go (+10/-6)
client/client_test.go (+6/-6)
client/session/session.go (+2/-2)
client/session/session_test.go (+1/-1)
debian/changelog (+6/-0)
debian/ubuntu-push-client.install (+1/-1)
To merge this branch: bzr merge lp:~chipaca/ubuntu-push/beta-here-we-come
Reviewer Review Type Date Requested Status
Lucio Torre (community) Approve
Review via email: mp+212884@code.launchpad.net

Commit message

Changes to get ready for beta.

Description of the change

Changes to get ready for beta.

To post a comment you must log in.
95. By John Lenton

fixed changelog

Revision history for this message
Lucio Torre (lucio.torre) wrote :

message looks good

review: Approve
96. By John Lenton

make session tests pass again

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/client.go'
2--- client/client.go 2014-03-12 11:08:57 +0000
3+++ client/client.go 2014-03-27 13:26:23 +0000
4@@ -186,17 +186,21 @@
5 }
6
7 // handleNotification deals with receiving a notification
8-func (client *PushClient) handleNotification() error {
9+func (client *PushClient) handleNotification(msg *session.Notification) error {
10 action_id := "dummy_id"
11 a := []string{action_id, "Go get it!"} // action value not visible on the phone
12 h := map[string]*dbus.Variant{"x-canonical-switch-to-application": &dbus.Variant{true}}
13 nots := notifications.Raw(client.notificationsEndp, client.log)
14+ body := "Tap to open the system updater."
15+ if msg != nil {
16+ body = fmt.Sprintf("[%d] %s", msg.TopLevel, body)
17+ }
18 not_id, err := nots.Notify(
19 "ubuntu-push-client", // app name
20 uint32(0), // id
21 "update_manager_icon", // icon
22- "There's an updated system image!", // summary
23- "You've got to get it! Now! Run!", // body
24+ "There's an updated system image.", // summary
25+ body, // body
26 a, // actions
27 h, // hints
28 int32(10*1000), // timeout (ms)
29@@ -217,15 +221,15 @@
30 }
31
32 // doLoop connects events with their handlers
33-func (client *PushClient) doLoop(connhandler func(bool), clickhandler, notifhandler func() error, errhandler func(error)) {
34+func (client *PushClient) doLoop(connhandler func(bool), clickhandler func() error, notifhandler func(*session.Notification) error, errhandler func(error)) {
35 for {
36 select {
37 case state := <-client.connCh:
38 connhandler(state)
39 case <-client.actionsCh:
40 clickhandler()
41- case <-client.session.MsgCh:
42- notifhandler()
43+ case msg := <-client.session.MsgCh:
44+ notifhandler(msg)
45 case err := <-client.session.ErrCh:
46 errhandler(err)
47 case count := <-client.sessionConnectedCh:
48
49=== modified file 'client/client_test.go'
50--- client/client_test.go 2014-02-08 18:31:01 +0000
51+++ client/client_test.go 2014-03-27 13:26:23 +0000
52@@ -392,7 +392,7 @@
53 endp := testibus.NewTestingEndpoint(nil, condition.Work(true), uint32(1))
54 cli.notificationsEndp = endp
55 cli.log = cs.log
56- c.Check(cli.handleNotification(), IsNil)
57+ c.Check(cli.handleNotification(nil), IsNil)
58 // check we sent the notification
59 args := testibus.GetCallArgs(endp)
60 c.Assert(args, HasLen, 1)
61@@ -405,7 +405,7 @@
62 cli.log = cs.log
63 endp := testibus.NewTestingEndpoint(nil, condition.Work(false))
64 cli.notificationsEndp = endp
65- c.Check(cli.handleNotification(), NotNil)
66+ c.Check(cli.handleNotification(nil), NotNil)
67 }
68
69 /*****************************************************************
70@@ -437,7 +437,7 @@
71 c.Assert(cli.initSession(), IsNil)
72
73 ch := make(chan bool, 1)
74- go cli.doLoop(func(bool) { ch <- true }, func() error { return nil }, func() error { return nil }, func(error) {})
75+ go cli.doLoop(func(bool) { ch <- true }, func() error { return nil }, func(_ *session.Notification) error { return nil }, func(error) {})
76 c.Check(takeNextBool(ch), Equals, true)
77 }
78
79@@ -450,7 +450,7 @@
80 cli.actionsCh = aCh
81
82 ch := make(chan bool, 1)
83- go cli.doLoop(func(bool) {}, func() error { ch <- true; return nil }, func() error { return nil }, func(error) {})
84+ go cli.doLoop(func(bool) {}, func() error { ch <- true; return nil }, func(_ *session.Notification) error { return nil }, func(error) {})
85 c.Check(takeNextBool(ch), Equals, true)
86 }
87
88@@ -462,7 +462,7 @@
89 cli.session.MsgCh <- &session.Notification{}
90
91 ch := make(chan bool, 1)
92- go cli.doLoop(func(bool) {}, func() error { return nil }, func() error { ch <- true; return nil }, func(error) {})
93+ go cli.doLoop(func(bool) {}, func() error { return nil }, func(_ *session.Notification) error { ch <- true; return nil }, func(error) {})
94 c.Check(takeNextBool(ch), Equals, true)
95 }
96
97@@ -474,7 +474,7 @@
98 cli.session.ErrCh <- nil
99
100 ch := make(chan bool, 1)
101- go cli.doLoop(func(bool) {}, func() error { return nil }, func() error { return nil }, func(error) { ch <- true })
102+ go cli.doLoop(func(bool) {}, func() error { return nil }, func(_ *session.Notification) error { return nil }, func(error) { ch <- true })
103 c.Check(takeNextBool(ch), Equals, true)
104 }
105
106
107=== modified file 'client/session/session.go'
108--- client/session/session.go 2014-03-19 22:31:20 +0000
109+++ client/session/session.go 2014-03-27 13:26:23 +0000
110@@ -36,7 +36,7 @@
111 var wireVersionBytes = []byte{protocol.ProtocolWireVersion}
112
113 type Notification struct {
114- // something something something
115+ TopLevel int64
116 }
117
118 type serverMsg struct {
119@@ -189,7 +189,7 @@
120 if bcast.ChanId == protocol.SystemChannelId {
121 // the system channel id, the only one we care about for now
122 sess.Log.Debugf("sending it over")
123- sess.MsgCh <- &Notification{}
124+ sess.MsgCh <- &Notification{bcast.TopLevel}
125 sess.Log.Debugf("sent it over")
126 } else {
127 sess.Log.Debugf("what is this weird channel, %#v?", bcast.ChanId)
128
129=== modified file 'client/session/session_test.go'
130--- client/session/session_test.go 2014-03-19 23:46:18 +0000
131+++ client/session/session_test.go 2014-03-27 13:26:23 +0000
132@@ -390,7 +390,7 @@
133 s.upCh <- nil // ack ok
134 c.Check(<-s.errCh, Equals, nil)
135 c.Assert(len(s.sess.MsgCh), Equals, 1)
136- c.Check(<-s.sess.MsgCh, Equals, &Notification{})
137+ c.Check(<-s.sess.MsgCh, DeepEquals, &Notification{TopLevel: 2})
138 // and finally, the session keeps track of the levels
139 levels, err := s.sess.Levels.GetAll()
140 c.Check(err, IsNil)
141
142=== modified file 'debian/changelog'
143--- debian/changelog 2014-03-25 17:27:10 +0000
144+++ debian/changelog 2014-03-27 13:26:23 +0000
145@@ -1,3 +1,9 @@
146+ubuntu-push (0.1-0ubuntu2) UNRELEASED; urgency=medium
147+
148+ * got rid of multiarch bug
149+
150+ -- John Lenton <john.lenton@canonical.com> Wed, 26 Mar 2014 16:27:06 +0000
151+
152 ubuntu-push (0.1+14.04.20140325.2-0ubuntu1) trusty; urgency=low
153
154 [ Diogo Baeder de Paula Pinto ]
155
156=== modified file 'debian/ubuntu-push-client.install'
157--- debian/ubuntu-push-client.install 2014-02-07 19:36:38 +0000
158+++ debian/ubuntu-push-client.install 2014-03-27 13:26:23 +0000
159@@ -1,4 +1,4 @@
160 #!/usr/bin/dh-exec
161 debian/config.json /etc/xdg/ubuntu-push-client
162 debian/ubuntu-push-client.conf /usr/share/upstart/sessions
163-usr/bin/ubuntu-push => /usr/lib/${DEB_HOST_MULTIARCH}/ubuntu-push-client/ubuntu-push-client
164+usr/bin/ubuntu-push => /usr/lib/ubuntu-push-client/ubuntu-push-client

Subscribers

People subscribed via source and target branches