Merge lp:~mardy/click-reviewers-tools/oa-plugin-1520605 into lp:click-reviewers-tools

Proposed by Alberto Mardegan on 2015-11-30
Status: Merged
Merged at revision: 559
Proposed branch: lp:~mardy/click-reviewers-tools/oa-plugin-1520605
Merge into: lp:click-reviewers-tools
Diff against target: 66 lines (+16/-16)
2 files modified
clickreviews/cr_online_accounts.py (+14/-11)
clickreviews/tests/test_cr_online_accounts.py (+2/-5)
To merge this branch: bzr merge lp:~mardy/click-reviewers-tools/oa-plugin-1520605
Reviewer Review Type Date Requested Status
Jamie Strandboge 2015-11-30 Needs Information on 2015-12-01
Review via email: mp+278952@code.launchpad.net

Commit Message

Online Accounts: update to latest plugin hook format

The OA manifest file for account plugins has changed a bit: now only a single plugin is allowed (instead of a list of plugins), since anyway every account plugin in the click package will have its OA manifest.

Description of the Change

Online Accounts: update to latest plugin hook format

The OA manifest file for account plugins has changed a bit: now only a single plugin is allowed (instead of a list of plugins), since anyway every account plugin in the click package will have its OA manifest.

To post a comment you must log in.
Jamie Strandboge (jdstrand) wrote :

Is this change compatible with older apps? Eg, are there apps that use the old methodology that need to migrate to the new? Is the new methodology on the images now?

review: Needs Information
Alberto Mardegan (mardy) wrote :

> Is this change compatible with older apps? Eg, are there apps that use the old
> methodology that need to migrate to the new? Is the new methodology on the
> images now?

There aren't currently any click packages using the account plugin hooks which is being changed with this MP, so it's safe to land.
The new methodology (as mandated by this MP) for account plugin hooks is not yet on the images, but I have a MP on ubuntu-system-settings-online-accounts ready. However, there is no need for these changes to land in a coordinated way: we will simply advise app developers to start migrating to this new hook format once both changes have landed. For the time being, the old "account-plugin" hook continues to work.

Jamie Strandboge (jdstrand) wrote :

Right. My question was more that since this isn't landed and nothing is using it, will an app that is uploaded today using the older format continue to pass automated reviews.

review: Needs Information
Alberto Mardegan (mardy) wrote :

Yes it will: nothing changes for apps using the older format, that continues to work.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'clickreviews/cr_online_accounts.py'
2--- clickreviews/cr_online_accounts.py 2015-11-24 12:13:36 +0000
3+++ clickreviews/cr_online_accounts.py 2015-11-30 11:48:21 +0000
4@@ -108,7 +108,6 @@
5 ('description', str),
6 ]
7 self.required_keys["plugin"] = [
8- ('provider', str),
9 ('name', str),
10 ('icon', str),
11 ('qml', str),
12@@ -249,19 +248,23 @@
13 self._add_result(t, n, s)
14 continue
15
16+ has_services_or_plugin = False
17 n = self._get_check_name('%s_services' % account_type, app=app)
18- if 'services' not in self.accounts[app][account_type]:
19+ if 'services' in self.accounts[app][account_type]:
20+ has_services_or_plugin = True
21+ services = self.accounts[app][account_type]['services']
22+ self._check_object_list(app, "services", "service", services)
23+
24+ n = self._get_check_name('%s_plugin' % account_type, app=app)
25+ if 'plugin' in self.accounts[app][account_type]:
26+ has_services_or_plugin = True
27+ plugin = self.accounts[app][account_type]['plugin']
28+ self._check_object("plugin", plugin, n)
29+
30+ if not has_services_or_plugin:
31 t = "error"
32- s = "'services' key is missing"
33+ s = "either 'services' or 'plugin' key must be present"
34 self._add_result(t, n, s)
35- continue
36- services = self.accounts[app][account_type]['services']
37- self._check_object_list(app, "services", "service", services)
38-
39- n = self._get_check_name('%s_plugins' % account_type, app=app)
40- if 'plugins' in self.accounts[app][account_type]:
41- plugins = self.accounts[app][account_type]['plugins']
42- self._check_object_list(app, "plugins", "plugin", plugins)
43
44 def check_application(self):
45 '''Check application'''
46
47=== modified file 'clickreviews/tests/test_cr_online_accounts.py'
48--- clickreviews/tests/test_cr_online_accounts.py 2015-10-16 02:54:07 +0000
49+++ clickreviews/tests/test_cr_online_accounts.py 2015-11-30 11:48:21 +0000
50@@ -153,14 +153,11 @@
51 "provider": "becool"
52 }
53 ],
54- "plugins": [
55- {
56- "provider": "example",
57+ "plugin": {
58 "name": "Example site",
59 "icon": "example.png",
60 "qml": "qml_files"
61- }
62- ]
63+ }
64 }''')
65 self.set_test_account(self.default_appname, "accounts", data)
66 c = ClickReviewAccounts(self.test_name)

Subscribers

People subscribed via source and target branches