Merge lp:~diegosarmentero/ubuntuone-client/farewell-u1 into lp:ubuntuone-client

Proposed by Diego Sarmentero
Status: Merged
Approved by: dobey
Approved revision: 1411
Merged at revision: 1404
Proposed branch: lp:~diegosarmentero/ubuntuone-client/farewell-u1
Merge into: lp:ubuntuone-client
Diff against target: 252 lines (+74/-58)
3 files modified
tests/status/test_aggregator.py (+13/-13)
ubuntuone/status/aggregator.py (+8/-0)
ubuntuone/syncdaemon/main.py (+53/-45)
To merge this branch: bzr merge lp:~diegosarmentero/ubuntuone-client/farewell-u1
Reviewer Review Type Date Requested Status
dobey (community) Approve
Manuel de la Peña (community) Approve
Review via email: mp+214519@code.launchpad.net

Commit message

- Show a message when the client is started indicating that the service will be suspended on June 1st.
- After June 1st, don't contact the server.

Description of the change

Farewell Ubuntu One File Service

To post a comment you must log in.
Revision history for this message
Manuel de la Peña (mandel) :
review: Approve
Revision history for this message
Ubuntu One Auto Pilot (otto-pilot) wrote :
Download full text (384.3 KiB)

The attempt to merge lp:~diegosarmentero/ubuntuone-client/farewell-u1 into lp:ubuntuone-client failed. Below is the output from the failed tests.

*** Running test suite for tests ***
running build
running build_py
creating build
creating build/lib.linux-x86_64-2.7
creating build/lib.linux-x86_64-2.7/contrib
creating build/lib.linux-x86_64-2.7/contrib/testing
copying contrib/testing/testcase.py -> build/lib.linux-x86_64-2.7/contrib/testing
copying contrib/testing/__init__.py -> build/lib.linux-x86_64-2.7/contrib/testing
creating build/lib.linux-x86_64-2.7/ubuntuone
creating build/lib.linux-x86_64-2.7/ubuntuone/platform
creating build/lib.linux-x86_64-2.7/ubuntuone/platform/credentials
copying ubuntuone/platform/credentials/ipc_service.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/credentials
copying ubuntuone/platform/credentials/dbus_service.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/credentials
copying ubuntuone/platform/credentials/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/credentials
creating build/lib.linux-x86_64-2.7/ubuntuone/platform/filesystem_notifications
creating build/lib.linux-x86_64-2.7/ubuntuone/platform/filesystem_notifications/notify_processor
copying ubuntuone/platform/filesystem_notifications/notify_processor/linux.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/filesystem_notifications/notify_processor
copying ubuntuone/platform/filesystem_notifications/notify_processor/common.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/filesystem_notifications/notify_processor
copying ubuntuone/platform/filesystem_notifications/notify_processor/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/filesystem_notifications/notify_processor
creating build/lib.linux-x86_64-2.7/ubuntuone/proxy
copying ubuntuone/proxy/common.py -> build/lib.linux-x86_64-2.7/ubuntuone/proxy
copying ubuntuone/proxy/tunnel_client.py -> build/lib.linux-x86_64-2.7/ubuntuone/proxy
copying ubuntuone/proxy/tunnel_server.py -> build/lib.linux-x86_64-2.7/ubuntuone/proxy
copying ubuntuone/proxy/logger.py -> build/lib.linux-x86_64-2.7/ubuntuone/proxy
copying ubuntuone/proxy/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/proxy
creating build/lib.linux-x86_64-2.7/ubuntuone/status
copying ubuntuone/status/notification.py -> build/lib.linux-x86_64-2.7/ubuntuone/status
copying ubuntuone/status/logger.py -> build/lib.linux-x86_64-2.7/ubuntuone/status
copying ubuntuone/status/aggregator.py -> build/lib.linux-x86_64-2.7/ubuntuone/status
copying ubuntuone/status/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/status
creating build/lib.linux-x86_64-2.7/ubuntuone/platform/notification
copying ubuntuone/platform/notification/linux.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/notification
copying ubuntuone/platform/notification/windows.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/notification
copying ubuntuone/platform/notification/__init__.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/notification
creating build/lib.linux-x86_64-2.7/ubuntuone/platform/tools
copying ubuntuone/platform/tools/linux.py -> build/lib.linux-x86_64-2.7/ubuntuone/platform/tools
copying ubuntuone/platform/tools/__init__.py -> bu...

Revision history for this message
dobey (dobey) wrote :

88 + if datetime.date.today() != end_date:

So on June 2 and every day not June 1 2014, we'll start trying to connect again? And pop the notification every time syncdaemon starts up?

Do we really need to pop the notification *every* time syncdaemon starts up? We've already sent e-mails to everyone, made a blog post, and it's been picked up on several news sites. On June 1, all the existing connections will drop and it will just fail to connect anyway.

Revision history for this message
dobey (dobey) :
review: Needs Fixing
1407. By Diego Sarmentero

fixing date comparison

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

> 88 + if datetime.date.today() != end_date:
>
> So on June 2 and every day not June 1 2014, we'll start trying to connect
> again? And pop the notification every time syncdaemon starts up?
>
> Do we really need to pop the notification *every* time syncdaemon starts up?
> We've already sent e-mails to everyone, made a blog post, and it's been picked
> up on several news sites. On June 1, all the existing connections will drop
> and it will just fail to connect anyway.

Fixed

1408. By Diego Sarmentero

considering same date too

Revision history for this message
dobey (dobey) wrote :

This branch seems to be introducing the test failure. I built the current package in pbuilder for saucy, and it built just fine. After adding this patch to create a new package to upload for SRU, and attempting to build it, I am getting the same test failures on saucy.

review: Needs Fixing
Revision history for this message
dobey (dobey) wrote :

88 + if datetime.date.today() >= end_date:

Now the check is backwards. It should be today <= end.

1409. By Diego Sarmentero

fix date comparison

1410. By Diego Sarmentero

disable on june 1st

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

> 88 + if datetime.date.today() >= end_date:
>
> Now the check is backwards. It should be today <= end.

Fixed.
But the tests from trunk are failing for me in the same way here.

Revision history for this message
dobey (dobey) wrote :

The tests are failing because this branch causes an extra notification to pop, so all the expectations are wrong in the tests.

I've proposed https://code.launchpad.net/~dobey/ubuntuone-client/farewell-u1/+merge/215303 to merge into this branch. If you merge it in, the tests should pass again. It works for me in the package.

1411. By Diego Sarmentero

merging lp:~dobey/ubuntuone-client/farewell-u1 branch to fix tests

Revision history for this message
Diego Sarmentero (diegosarmentero) wrote :

> The tests are failing because this branch causes an extra notification to pop,
> so all the expectations are wrong in the tests.
>
> I've proposed https://code.launchpad.net/~dobey/ubuntuone-
> client/farewell-u1/+merge/215303 to merge into this branch. If you merge it
> in, the tests should pass again. It works for me in the package.

Thanks, done!

Revision history for this message
dobey (dobey) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/status/test_aggregator.py'
2--- tests/status/test_aggregator.py 2012-11-15 13:23:43 +0000
3+++ tests/status/test_aggregator.py 2014-04-11 14:08:45 +0000
4@@ -943,7 +943,7 @@
5 self.listener.handle_AQ_CHANGE_PUBLIC_ACCESS_OK(share_id, node_id,
6 is_public, public_url)
7 self.assertEqual(
8- 1, len(self.status_frontend.notification.notifications_shown))
9+ 2, len(self.status_frontend.notification.notifications_shown))
10
11 def test_file_unpublished(self):
12 """A file unpublished event is processed."""
13@@ -955,7 +955,7 @@
14 self.listener.handle_AQ_CHANGE_PUBLIC_ACCESS_OK(share_id, node_id,
15 is_public, public_url)
16 self.assertEqual(
17- 1, len(self.status_frontend.notification.notifications_shown))
18+ 2, len(self.status_frontend.notification.notifications_shown))
19
20 def test_download_started(self):
21 """A download was added to the queue."""
22@@ -1053,7 +1053,7 @@
23 self.fakevm.volumes[SHARE_ID] = share
24 self.listener.handle_VM_SHARE_CREATED(SHARE_ID)
25 self.assertEqual(
26- 1, len(self.status_frontend.notification.notifications_shown))
27+ 2, len(self.status_frontend.notification.notifications_shown))
28
29 def test_already_subscribed_new_udf_available(self):
30 """A new udf that was already subscribed."""
31@@ -1061,14 +1061,14 @@
32 udf.subscribed = True
33 self.listener.handle_VM_UDF_CREATED(udf)
34 self.assertEqual(
35- 0, len(self.status_frontend.notification.notifications_shown))
36+ 1, len(self.status_frontend.notification.notifications_shown))
37
38 def test_new_udf_available(self):
39 """A new udf is available for subscription."""
40 udf = UDF()
41 self.listener.handle_VM_UDF_CREATED(udf)
42 self.assertEqual(
43- 1, len(self.status_frontend.notification.notifications_shown))
44+ 2, len(self.status_frontend.notification.notifications_shown))
45
46 def test_two_new_udfs_available(self):
47 """A new udf is available for subscription."""
48@@ -1077,14 +1077,14 @@
49 udf2 = UDF()
50 self.listener.handle_VM_UDF_CREATED(udf2)
51 self.assertEqual(
52- 2, len(self.status_frontend.notification.notifications_shown))
53+ 3, len(self.status_frontend.notification.notifications_shown))
54
55 def test_server_connection_lost(self):
56 """The client connected to the server."""
57 self.status_frontend.aggregator.connected = True
58 self.listener.handle_SYS_CONNECTION_LOST()
59 self.assertEqual(
60- 0, len(self.status_frontend.notification.notifications_shown))
61+ 1, len(self.status_frontend.notification.notifications_shown))
62 self.assertFalse(self.status_frontend.aggregator.connected)
63
64 def test_server_connection_made(self):
65@@ -1092,7 +1092,7 @@
66 self.status_frontend.aggregator.connected = False
67 self.listener.handle_SYS_CONNECTION_MADE()
68 self.assertEqual(
69- 0, len(self.status_frontend.notification.notifications_shown))
70+ 1, len(self.status_frontend.notification.notifications_shown))
71 self.assertTrue(self.status_frontend.aggregator.connected)
72
73 def test_set_show_all_notifications(self):
74@@ -1117,7 +1117,7 @@
75 self.listener.handle_SYS_QUOTA_EXCEEDED(
76 volume_id=UDF_ID, free_bytes=0)
77 self.assertEqual(
78- 0, len(self.status_frontend.notification.notifications_shown))
79+ 1, len(self.status_frontend.notification.notifications_shown))
80 mocker.restore()
81 mocker.verify()
82
83@@ -1138,7 +1138,7 @@
84 self.listener.handle_SYS_QUOTA_EXCEEDED(
85 volume_id=ROOT_ID, free_bytes=0)
86 self.assertEqual(
87- 0, len(self.status_frontend.notification.notifications_shown))
88+ 1, len(self.status_frontend.notification.notifications_shown))
89 mocker.restore()
90 mocker.verify()
91
92@@ -1162,15 +1162,15 @@
93 self.fakevm.volumes[SHARE_ID] = share
94 self.listener.handle_SYS_QUOTA_EXCEEDED(SHARE_ID, BYTES)
95 self.assertEqual(
96- 1, len(self.status_frontend.notification.notifications_shown))
97+ 2, len(self.status_frontend.notification.notifications_shown))
98 self.listener.handle_SYS_QUOTA_EXCEEDED(SHARE_ID, BYTES)
99 self.listener.handle_SYS_QUOTA_EXCEEDED(SHARE_ID, BYTES)
100 self.assertEqual(
101- 1, len(self.status_frontend.notification.notifications_shown))
102+ 2, len(self.status_frontend.notification.notifications_shown))
103 self.status_frontend.aggregator.clock.advance(aggregator.ONE_DAY + 1)
104 self.listener.handle_SYS_QUOTA_EXCEEDED(SHARE_ID, BYTES)
105 self.assertEqual(
106- 2, len(self.status_frontend.notification.notifications_shown))
107+ 3, len(self.status_frontend.notification.notifications_shown))
108 mocker.restore()
109 mocker.verify()
110
111
112=== modified file 'ubuntuone/status/aggregator.py'
113--- ubuntuone/status/aggregator.py 2013-03-20 21:33:53 +0000
114+++ ubuntuone/status/aggregator.py 2014-04-11 14:08:45 +0000
115@@ -51,6 +51,8 @@
116 Q_ = lambda string: gettext.dgettext(GETTEXT_PACKAGE, string)
117
118 UBUNTUONE_TITLE = Q_("Ubuntu One")
119+UBUNTUONE_END = Q_("Ubuntu One file services will be "
120+ "shutting down on June 1st, 2014.\nThanks for your support.")
121 NEW_UDFS_SENDER = Q_("New cloud folder(s) available")
122 FINAL_COMPLETED = Q_("File synchronization completed.")
123
124@@ -827,6 +829,12 @@
125 self.syncdaemon_service = service
126 self.sync_menu = None
127 self.start_sync_menu()
128+ self.farewell_ubuntuone_sync()
129+
130+ def farewell_ubuntuone_sync(self):
131+ """Show notification about the upcoming end of UbuntuOne sync."""
132+ self.notification.send_notification(
133+ UBUNTUONE_TITLE, UBUNTUONE_END)
134
135 def start_sync_menu(self):
136 """Create the sync menu and register the progress listener."""
137
138=== modified file 'ubuntuone/syncdaemon/main.py'
139--- ubuntuone/syncdaemon/main.py 2013-02-04 16:04:19 +0000
140+++ ubuntuone/syncdaemon/main.py 2014-04-11 14:08:45 +0000
141@@ -31,6 +31,7 @@
142 import logging
143 import os
144 import sys
145+import datetime
146
147 from dirspec.utils import user_home
148 from twisted.internet import defer, reactor, task
149@@ -106,51 +107,58 @@
150 if not throttling_enabled:
151 throttling_enabled = user_config.get_throttling()
152
153- self.logger.info("Starting Ubuntu One client version %s",
154- clientdefs.VERSION)
155- self.logger.info("Using %r as root dir", self.root_dir)
156- self.logger.info("Using %r as data dir", self.data_dir)
157- self.logger.info("Using %r as shares root dir", self.shares_dir)
158- self.db = tritcask.Tritcask(tritcask_dir)
159- self.vm = volume_manager.VolumeManager(self)
160- self.fs = filesystem_manager.FileSystemManager(
161- data_dir, partials_dir, self.vm, self.db)
162- self.event_q = event_queue.EventQueue(self.fs, ignore_files,
163- monitor_class=monitor_class)
164- self.fs.register_eq(self.event_q)
165-
166- # subscribe VM to EQ, to be unsubscribed in shutdown
167- self.event_q.subscribe(self.vm)
168- self.vm.init_root()
169-
170- # we don't have the oauth tokens yet, we 'll get them later
171- self.action_q = action_queue.ActionQueue(self.event_q, self,
172- host, port,
173- dns_srv, ssl,
174- disable_ssl_verify,
175- read_limit, write_limit,
176- throttling_enabled)
177- self.hash_q = hash_queue.HashQueue(self.event_q)
178- events_nanny.DownloadFinishedNanny(self.fs, self.event_q, self.hash_q)
179-
180- # call StateManager after having AQ
181- self.state_manager = StateManager(self, handshake_timeout)
182-
183- self.sync = sync.Sync(self)
184- self.lr = local_rescan.LocalRescan(self.vm, self.fs,
185- self.event_q, self.action_q)
186-
187- self.external = SyncdaemonService(main=self,
188- send_events=broadcast_events)
189- self.external.oauth_credentials = oauth_credentials
190- if user_config.get_autoconnect():
191- self.external.connect(autoconnecting=True)
192-
193- self.status_listener = None
194- self.start_status_listener()
195-
196- self.mark = task.LoopingCall(self.log_mark)
197- self.mark.start(mark_interval)
198+ end_date = datetime.date(2014, 6, 1)
199+ if datetime.date.today() < end_date:
200+ self.logger.info("Starting Ubuntu One client version %s",
201+ clientdefs.VERSION)
202+ self.logger.info("Using %r as root dir", self.root_dir)
203+ self.logger.info("Using %r as data dir", self.data_dir)
204+ self.logger.info("Using %r as shares root dir", self.shares_dir)
205+ self.db = tritcask.Tritcask(tritcask_dir)
206+ self.vm = volume_manager.VolumeManager(self)
207+ self.fs = filesystem_manager.FileSystemManager(
208+ data_dir, partials_dir, self.vm, self.db)
209+ self.event_q = event_queue.EventQueue(
210+ self.fs, ignore_files, monitor_class=monitor_class)
211+ self.fs.register_eq(self.event_q)
212+
213+ # subscribe VM to EQ, to be unsubscribed in shutdown
214+ self.event_q.subscribe(self.vm)
215+ self.vm.init_root()
216+
217+ # we don't have the oauth tokens yet, we 'll get them later
218+ self.action_q = action_queue.ActionQueue(self.event_q, self,
219+ host, port,
220+ dns_srv, ssl,
221+ disable_ssl_verify,
222+ read_limit, write_limit,
223+ throttling_enabled)
224+ self.hash_q = hash_queue.HashQueue(self.event_q)
225+ events_nanny.DownloadFinishedNanny(self.fs, self.event_q,
226+ self.hash_q)
227+
228+ # call StateManager after having AQ
229+ self.state_manager = StateManager(self, handshake_timeout)
230+
231+ self.sync = sync.Sync(self)
232+ self.lr = local_rescan.LocalRescan(self.vm, self.fs,
233+ self.event_q, self.action_q)
234+
235+ self.external = SyncdaemonService(main=self,
236+ send_events=broadcast_events)
237+ self.external.oauth_credentials = oauth_credentials
238+ if user_config.get_autoconnect():
239+ self.external.connect(autoconnecting=True)
240+
241+ self.status_listener = None
242+ self.start_status_listener()
243+
244+ self.mark = task.LoopingCall(self.log_mark)
245+ self.mark.start(mark_interval)
246+ else:
247+ if reactor.running:
248+ reactor.stop()
249+ sys.exit(0)
250
251 def start_status_listener(self):
252 """Start the status listener if it is configured to start."""

Subscribers

People subscribed via source and target branches