Merge lp:~dobey/unity-scope-click/nonclick-touch-apps into lp:unity-scope-click

Proposed by dobey
Status: Merged
Approved by: Ted Gould
Approved revision: 482
Merged at revision: 490
Proposed branch: lp:~dobey/unity-scope-click/nonclick-touch-apps
Merge into: lp:unity-scope-click
Prerequisite: lp:~dobey/unity-scope-click/update-harness-tests
Diff against target: 84 lines (+41/-4)
3 files modified
libclickscope/click/interface.cpp (+9/-4)
libclickscope/tests/mock_ual.h (+1/-0)
libclickscope/tests/test_interface.cpp (+31/-0)
To merge this branch: bzr merge lp:~dobey/unity-scope-click/nonclick-touch-apps
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
unity-api-1-bot continuous-integration Approve
Review via email: mp+307612@code.launchpad.net

Commit message

Fix regression from switch to ual, to show X-Ubuntu-Touch=true apps.

To post a comment you must log in.
Revision history for this message
unity-api-1-bot (unity-api-1-bot) wrote :

PASSED: Continuous integration, rev:482
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/116/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build/834
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-0-fetch/841
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=vivid+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=xenial+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=amd64,release=yakkety/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=vivid+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=xenial+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=armhf,release=yakkety/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=vivid+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=xenial+overlay/648/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/648
        deb: https://jenkins.canonical.com/unity-api-1/job/build-2-binpkg/arch=i386,release=yakkety/648/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/unity-api-1/job/lp-unity-scope-click-ci/116/rebuild

review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

Not directly related to this MR, but we should probably just kill the whitelist of allowed applications and show everything installed that is valid. This fix is fine on its own though.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libclickscope/click/interface.cpp'
2--- libclickscope/click/interface.cpp 2016-09-26 21:00:12 +0000
3+++ libclickscope/click/interface.cpp 2016-10-04 17:39:01 +0000
4@@ -207,10 +207,6 @@
5 if (app.name.empty()) {
6 app.name = std::string{ualapp->appId().appname.value()} + ".desktop";
7 app.url = "application:///" + app.name;
8- if (!is_non_click_app(app.name)) {
9- qDebug() << "Skipping legacy app:" << QString::fromStdString(app.name);
10- continue;
11- }
12 } else {
13 app.url = "appid://" + app.name + "/" + ualapp->appId().appname.value() + "/current-user-version";
14 }
15@@ -225,6 +221,15 @@
16 // Get the .desktop file info from UAL, since we're not ignoring
17 try {
18 auto appinfo = ualapp->info();
19+
20+ // Only skip legacy apps that don't support Ubuntu Lifecycle
21+ if (app.version.empty() &&
22+ !is_non_click_app(app.name) &&
23+ !appinfo->supportsUbuntuLifecycle()) {
24+ qDebug() << "Skipping legacy app:" << QString::fromStdString(app.name);
25+ continue;
26+ }
27+
28 app.title = appinfo->name();
29 app.description = appinfo->description();
30 app.icon_url = appinfo->iconPath();
31
32=== modified file 'libclickscope/tests/mock_ual.h'
33--- libclickscope/tests/mock_ual.h 2016-09-26 19:05:22 +0000
34+++ libclickscope/tests/mock_ual.h 2016-10-04 17:39:01 +0000
35@@ -96,6 +96,7 @@
36 DefaultValue<const ual::Application::Info::DefaultDepartment&>::Set(m_defaultDept);
37 DefaultValue<const ual::Application::Info::IconPath&>::Set(m_ssPath);
38 DefaultValue<const ual::Application::Info::Keywords&>::Set(m_keywords);
39+ DefaultValue<ual::Application::Info::UbuntuLifecycle>::Set(ual::Application::Info::UbuntuLifecycle::from_raw(false));
40 }
41
42 const ual::Application::Info::Name& name()
43
44=== modified file 'libclickscope/tests/test_interface.cpp'
45--- libclickscope/tests/test_interface.cpp 2016-09-26 19:05:22 +0000
46+++ libclickscope/tests/test_interface.cpp 2016-10-04 17:39:01 +0000
47@@ -207,6 +207,37 @@
48 EXPECT_EQ("application:///messaging-app.desktop", results.begin()->url);
49 }
50
51+TEST_F(ClickInterfaceTest, testFindLegacyAppSkipped)
52+{
53+ FakeClickInterface iface;
54+
55+ EXPECT_CALL(iface, installed_apps()).Times(1).
56+ WillOnce(Return(std::list<std::shared_ptr<ual::Application>>{
57+ MockUALApplication::create(ual::AppID::find("skipped-app"),
58+ std::shared_ptr<MockUALApplication::MockInfo>{new MockUALApplication::MockInfo("Skipped", "An app that's skipped", "skipped-app")})
59+ }));
60+ auto results = iface.search("");
61+ ASSERT_EQ(0, results.size());
62+}
63+
64+TEST_F(ClickInterfaceTest, testFindLegacyAppNotSkipped)
65+{
66+ FakeClickInterface iface;
67+
68+ std::shared_ptr<MockUALApplication::MockInfo> mockinfo{new MockUALApplication::MockInfo("Validity", "Valid app", "valid-app")};
69+ EXPECT_CALL(iface, installed_apps()).Times(1).
70+ WillOnce(Return(std::list<std::shared_ptr<ual::Application>>{
71+ MockUALApplication::create(ual::AppID::find("valid-app"),
72+ mockinfo)
73+ }));
74+ EXPECT_CALL(*mockinfo, supportsUbuntuLifecycle()).Times(1).
75+ WillOnce(Return(ual::Application::Info::UbuntuLifecycle::from_raw(true)));
76+
77+ auto results = iface.search("Valid");
78+ ASSERT_EQ(1u, results.size());
79+ EXPECT_EQ("application:///valid-app.desktop", results.begin()->url);
80+}
81+
82 // test that application with a default department id key in the desktop
83 // file is returned when department matches
84 TEST_F(ClickInterfaceTest, testFindAppsWithAppWithDefaultDepartmentId)

Subscribers

People subscribed via source and target branches

to all changes: