Merge lp:~mvo/unity-scope-click/empty-frameworks-query into lp:unity-scope-click/devel

Proposed by Michael Vogt
Status: Rejected
Rejected by: dobey
Proposed branch: lp:~mvo/unity-scope-click/empty-frameworks-query
Merge into: lp:unity-scope-click/devel
Diff against target: 58 lines (+16/-2)
4 files modified
HACKING (+4/-0)
scope/click/index.cpp (+4/-1)
scope/click/index.h (+0/-1)
scope/tests/test_index.cpp (+8/-0)
To merge this branch: bzr merge lp:~mvo/unity-scope-click/empty-frameworks-query
Reviewer Review Type Date Requested Status
dobey (community) Disapprove
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+220083@code.launchpad.net

Description of the change

This branch sends a empty "framework:" string if the system has no frameworks installed.

The search scope will return all apps for the given search query if the ",framework:" is missing but when the user tries to install the click app click will fail.

I ran into this when testing unity8-desktop-session-mir. If you feel like this should be fixed on the server side instead, please simply close this MP.

To post a comment you must log in.
264. By Michael Vogt

improve test

265. By Michael Vogt

HACKING: mention how to run a specific test only

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
dobey (dobey) wrote :

I'm voting Disapprove here, because it directly conflicts with your other branch https://code.launchpad.net/~mvo/unity-scope-click/lp1292645-use-libclick/+merge/220061 and I'm not sure it's the solution we should be going for here.

Also, please file a new bug for this issue where results are given, but not installable, when there are no frameworks. As the frameworks data is a core piece of information we depend on for a working scope, I think we should fail when they are none available, and have a runtime dependency on the package that provides them (ubuntu-sdk-libs).

review: Disapprove
Revision history for this message
Michael Vogt (mvo) wrote :

Thanks Rodney for your review. I created bug #1320975 as requested.

I don't really see the conflict with my other branch here, configuration->get_available_frameworks() may still return a empty array (but maybe I'm missing something).

But if there is going to be a dependency on the ubuntu-sdk-libs package this branch will not be needed.

Revision history for this message
dobey (dobey) wrote :

On Mon, 2014-05-19 at 18:43 +0000, Michael Vogt wrote:
> I don't really see the conflict with my other branch here,
> configuration->get_available_frameworks() may still return a empty
> array (but maybe I'm missing something).

Oh, sorry. I was reading the change in index.cpp here, and
configuration.cpp there, as the same code. :)

This branch does conflict with the tip of /devel now though. But I still
think this isn't how we should fix the issue, and instead we should have
a proper dependency on the data from other packages we need, and should
fail appropriately rather than trying to pass empty data to the server.
Although, I think tip of /devel will pass empty data to the server now
anyway, as we're passing an empty header, rather than not passing
frameworks at all, in the empty list case.

Unmerged revisions

265. By Michael Vogt

HACKING: mention how to run a specific test only

264. By Michael Vogt

improve test

263. By Michael Vogt

send empty frameworks string if no frameworks are installed

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'HACKING'
2--- HACKING 2014-05-16 21:08:36 +0000
3+++ HACKING 2014-05-19 15:22:38 +0000
4@@ -37,6 +37,10 @@
5
6 $ make check-valgrind
7
8+Running a specific test with:
9+
10+ $ ./scope/tests/click-scope-tests --gtest_filter=QueryStringTest.testBuildQueryNoInstalledFrameworks
11+
12
13 Running the autopilot tests
14 ---------------------------
15
16=== modified file 'scope/click/index.cpp'
17--- scope/click/index.cpp 2014-04-16 21:13:28 +0000
18+++ scope/click/index.cpp 2014-05-19 15:22:38 +0000
19@@ -92,7 +92,10 @@
20 std::stringstream result;
21
22 result << query;
23- for (auto f: configuration->get_available_frameworks()) {
24+ auto available_frameworks = configuration->get_available_frameworks();
25+ if (available_frameworks.size() == 0)
26+ result << ",framework:";
27+ for (auto f: available_frameworks) {
28 result << ",framework:" << f;
29 }
30 result << ",architecture:" << configuration->get_architecture();
31
32=== modified file 'scope/click/index.h'
33--- scope/click/index.h 2014-04-16 21:13:28 +0000
34+++ scope/click/index.h 2014-05-19 15:22:38 +0000
35@@ -46,7 +46,6 @@
36 const std::string SEARCH_BASE_URL_ENVVAR = "U1_SEARCH_BASE_URL";
37 const std::string SEARCH_BASE_URL = "https://search.apps.ubuntu.com/";
38 const std::string SEARCH_PATH = "api/v1/search";
39-const std::string SUPPORTED_FRAMEWORKS = "framework:ubuntu-sdk-13.10";
40 const std::string QUERY_ARGNAME = "q";
41 const std::string ARCHITECTURE = "architecture:";
42 const std::string DETAILS_PATH = "api/v1/package/";
43
44=== modified file 'scope/tests/test_index.cpp'
45--- scope/tests/test_index.cpp 2014-04-29 03:17:38 +0000
46+++ scope/tests/test_index.cpp 2014-05-19 15:22:38 +0000
47@@ -496,3 +496,11 @@
48 EXPECT_NE(std::string::npos, index_query.find("framework:" + fake_fwk_1));
49 EXPECT_NE(std::string::npos, index_query.find("framework:" + fake_fwk_2));
50 }
51+
52+TEST_F(QueryStringTest, testBuildQueryNoInstalledFrameworks)
53+{
54+ EXPECT_CALL(*configPtr, get_architecture()).Times(1).WillOnce(Return(fake_arch));
55+ EXPECT_CALL(*configPtr, get_available_frameworks()).Times(1).WillOnce(Return(std::vector<std::string>()));
56+ auto index_query = indexPtr->build_index_query("fake");
57+ EXPECT_EQ("fake,framework:,architecture:fake_arch", index_query);
58+}

Subscribers

People subscribed via source and target branches

to all changes: