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
=== modified file 'client/client.go'
--- client/client.go 2014-03-12 11:08:57 +0000
+++ client/client.go 2014-03-27 13:26:23 +0000
@@ -186,17 +186,21 @@
186}186}
187187
188// handleNotification deals with receiving a notification188// handleNotification deals with receiving a notification
189func (client *PushClient) handleNotification() error {189func (client *PushClient) handleNotification(msg *session.Notification) error {
190 action_id := "dummy_id"190 action_id := "dummy_id"
191 a := []string{action_id, "Go get it!"} // action value not visible on the phone191 a := []string{action_id, "Go get it!"} // action value not visible on the phone
192 h := map[string]*dbus.Variant{"x-canonical-switch-to-application": &dbus.Variant{true}}192 h := map[string]*dbus.Variant{"x-canonical-switch-to-application": &dbus.Variant{true}}
193 nots := notifications.Raw(client.notificationsEndp, client.log)193 nots := notifications.Raw(client.notificationsEndp, client.log)
194 body := "Tap to open the system updater."
195 if msg != nil {
196 body = fmt.Sprintf("[%d] %s", msg.TopLevel, body)
197 }
194 not_id, err := nots.Notify(198 not_id, err := nots.Notify(
195 "ubuntu-push-client", // app name199 "ubuntu-push-client", // app name
196 uint32(0), // id200 uint32(0), // id
197 "update_manager_icon", // icon201 "update_manager_icon", // icon
198 "There's an updated system image!", // summary202 "There's an updated system image.", // summary
199 "You've got to get it! Now! Run!", // body203 body, // body
200 a, // actions204 a, // actions
201 h, // hints205 h, // hints
202 int32(10*1000), // timeout (ms)206 int32(10*1000), // timeout (ms)
@@ -217,15 +221,15 @@
217}221}
218222
219// doLoop connects events with their handlers223// doLoop connects events with their handlers
220func (client *PushClient) doLoop(connhandler func(bool), clickhandler, notifhandler func() error, errhandler func(error)) {224func (client *PushClient) doLoop(connhandler func(bool), clickhandler func() error, notifhandler func(*session.Notification) error, errhandler func(error)) {
221 for {225 for {
222 select {226 select {
223 case state := <-client.connCh:227 case state := <-client.connCh:
224 connhandler(state)228 connhandler(state)
225 case <-client.actionsCh:229 case <-client.actionsCh:
226 clickhandler()230 clickhandler()
227 case <-client.session.MsgCh:231 case msg := <-client.session.MsgCh:
228 notifhandler()232 notifhandler(msg)
229 case err := <-client.session.ErrCh:233 case err := <-client.session.ErrCh:
230 errhandler(err)234 errhandler(err)
231 case count := <-client.sessionConnectedCh:235 case count := <-client.sessionConnectedCh:
232236
=== modified file 'client/client_test.go'
--- client/client_test.go 2014-02-08 18:31:01 +0000
+++ client/client_test.go 2014-03-27 13:26:23 +0000
@@ -392,7 +392,7 @@
392 endp := testibus.NewTestingEndpoint(nil, condition.Work(true), uint32(1))392 endp := testibus.NewTestingEndpoint(nil, condition.Work(true), uint32(1))
393 cli.notificationsEndp = endp393 cli.notificationsEndp = endp
394 cli.log = cs.log394 cli.log = cs.log
395 c.Check(cli.handleNotification(), IsNil)395 c.Check(cli.handleNotification(nil), IsNil)
396 // check we sent the notification396 // check we sent the notification
397 args := testibus.GetCallArgs(endp)397 args := testibus.GetCallArgs(endp)
398 c.Assert(args, HasLen, 1)398 c.Assert(args, HasLen, 1)
@@ -405,7 +405,7 @@
405 cli.log = cs.log405 cli.log = cs.log
406 endp := testibus.NewTestingEndpoint(nil, condition.Work(false))406 endp := testibus.NewTestingEndpoint(nil, condition.Work(false))
407 cli.notificationsEndp = endp407 cli.notificationsEndp = endp
408 c.Check(cli.handleNotification(), NotNil)408 c.Check(cli.handleNotification(nil), NotNil)
409}409}
410410
411/*****************************************************************411/*****************************************************************
@@ -437,7 +437,7 @@
437 c.Assert(cli.initSession(), IsNil)437 c.Assert(cli.initSession(), IsNil)
438438
439 ch := make(chan bool, 1)439 ch := make(chan bool, 1)
440 go cli.doLoop(func(bool) { ch <- true }, func() error { return nil }, func() error { return nil }, func(error) {})440 go cli.doLoop(func(bool) { ch <- true }, func() error { return nil }, func(_ *session.Notification) error { return nil }, func(error) {})
441 c.Check(takeNextBool(ch), Equals, true)441 c.Check(takeNextBool(ch), Equals, true)
442}442}
443443
@@ -450,7 +450,7 @@
450 cli.actionsCh = aCh450 cli.actionsCh = aCh
451451
452 ch := make(chan bool, 1)452 ch := make(chan bool, 1)
453 go cli.doLoop(func(bool) {}, func() error { ch <- true; return nil }, func() error { return nil }, func(error) {})453 go cli.doLoop(func(bool) {}, func() error { ch <- true; return nil }, func(_ *session.Notification) error { return nil }, func(error) {})
454 c.Check(takeNextBool(ch), Equals, true)454 c.Check(takeNextBool(ch), Equals, true)
455}455}
456456
@@ -462,7 +462,7 @@
462 cli.session.MsgCh <- &session.Notification{}462 cli.session.MsgCh <- &session.Notification{}
463463
464 ch := make(chan bool, 1)464 ch := make(chan bool, 1)
465 go cli.doLoop(func(bool) {}, func() error { return nil }, func() error { ch <- true; return nil }, func(error) {})465 go cli.doLoop(func(bool) {}, func() error { return nil }, func(_ *session.Notification) error { ch <- true; return nil }, func(error) {})
466 c.Check(takeNextBool(ch), Equals, true)466 c.Check(takeNextBool(ch), Equals, true)
467}467}
468468
@@ -474,7 +474,7 @@
474 cli.session.ErrCh <- nil474 cli.session.ErrCh <- nil
475475
476 ch := make(chan bool, 1)476 ch := make(chan bool, 1)
477 go cli.doLoop(func(bool) {}, func() error { return nil }, func() error { return nil }, func(error) { ch <- true })477 go cli.doLoop(func(bool) {}, func() error { return nil }, func(_ *session.Notification) error { return nil }, func(error) { ch <- true })
478 c.Check(takeNextBool(ch), Equals, true)478 c.Check(takeNextBool(ch), Equals, true)
479}479}
480480
481481
=== modified file 'client/session/session.go'
--- client/session/session.go 2014-03-19 22:31:20 +0000
+++ client/session/session.go 2014-03-27 13:26:23 +0000
@@ -36,7 +36,7 @@
36var wireVersionBytes = []byte{protocol.ProtocolWireVersion}36var wireVersionBytes = []byte{protocol.ProtocolWireVersion}
3737
38type Notification struct {38type Notification struct {
39 // something something something39 TopLevel int64
40}40}
4141
42type serverMsg struct {42type serverMsg struct {
@@ -189,7 +189,7 @@
189 if bcast.ChanId == protocol.SystemChannelId {189 if bcast.ChanId == protocol.SystemChannelId {
190 // the system channel id, the only one we care about for now190 // the system channel id, the only one we care about for now
191 sess.Log.Debugf("sending it over")191 sess.Log.Debugf("sending it over")
192 sess.MsgCh <- &Notification{}192 sess.MsgCh <- &Notification{bcast.TopLevel}
193 sess.Log.Debugf("sent it over")193 sess.Log.Debugf("sent it over")
194 } else {194 } else {
195 sess.Log.Debugf("what is this weird channel, %#v?", bcast.ChanId)195 sess.Log.Debugf("what is this weird channel, %#v?", bcast.ChanId)
196196
=== modified file 'client/session/session_test.go'
--- client/session/session_test.go 2014-03-19 23:46:18 +0000
+++ client/session/session_test.go 2014-03-27 13:26:23 +0000
@@ -390,7 +390,7 @@
390 s.upCh <- nil // ack ok390 s.upCh <- nil // ack ok
391 c.Check(<-s.errCh, Equals, nil)391 c.Check(<-s.errCh, Equals, nil)
392 c.Assert(len(s.sess.MsgCh), Equals, 1)392 c.Assert(len(s.sess.MsgCh), Equals, 1)
393 c.Check(<-s.sess.MsgCh, Equals, &Notification{})393 c.Check(<-s.sess.MsgCh, DeepEquals, &Notification{TopLevel: 2})
394 // and finally, the session keeps track of the levels394 // and finally, the session keeps track of the levels
395 levels, err := s.sess.Levels.GetAll()395 levels, err := s.sess.Levels.GetAll()
396 c.Check(err, IsNil)396 c.Check(err, IsNil)
397397
=== modified file 'debian/changelog'
--- debian/changelog 2014-03-25 17:27:10 +0000
+++ debian/changelog 2014-03-27 13:26:23 +0000
@@ -1,3 +1,9 @@
1ubuntu-push (0.1-0ubuntu2) UNRELEASED; urgency=medium
2
3 * got rid of multiarch bug
4
5 -- John Lenton <john.lenton@canonical.com> Wed, 26 Mar 2014 16:27:06 +0000
6
1ubuntu-push (0.1+14.04.20140325.2-0ubuntu1) trusty; urgency=low7ubuntu-push (0.1+14.04.20140325.2-0ubuntu1) trusty; urgency=low
28
3 [ Diogo Baeder de Paula Pinto ]9 [ Diogo Baeder de Paula Pinto ]
410
=== modified file 'debian/ubuntu-push-client.install'
--- debian/ubuntu-push-client.install 2014-02-07 19:36:38 +0000
+++ debian/ubuntu-push-client.install 2014-03-27 13:26:23 +0000
@@ -1,4 +1,4 @@
1#!/usr/bin/dh-exec1#!/usr/bin/dh-exec
2debian/config.json /etc/xdg/ubuntu-push-client2debian/config.json /etc/xdg/ubuntu-push-client
3debian/ubuntu-push-client.conf /usr/share/upstart/sessions3debian/ubuntu-push-client.conf /usr/share/upstart/sessions
4usr/bin/ubuntu-push => /usr/lib/${DEB_HOST_MULTIARCH}/ubuntu-push-client/ubuntu-push-client4usr/bin/ubuntu-push => /usr/lib/ubuntu-push-client/ubuntu-push-client

Subscribers

People subscribed via source and target branches