Merge lp:~stolowski/unity-scope-click/fix-1352451 into lp:unity-scope-click/devel
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | Alejandro J. Cura | ||||
Approved revision: | 395 | ||||
Merged at revision: | 390 | ||||
Proposed branch: | lp:~stolowski/unity-scope-click/fix-1352451 | ||||
Merge into: | lp:unity-scope-click/devel | ||||
Diff against target: |
275 lines (+108/-24) 10 files modified
data/CMakeLists.txt (+5/-0) data/click-scope-departments-db.conf.in (+6/-1) data/update_schema.sh (+55/-0) debian/unity-scope-click-departmentsdb.install (+1/-0) libclickscope/click/departments-db.cpp (+18/-15) libclickscope/tests/test_departments-db.cpp (+4/-1) libclickscope/tests/test_interface.cpp (+2/-0) scope/clickapps/apps-query.cpp (+13/-5) scope/tests/test_apps_query.cpp (+1/-1) scope/tests/test_query.cpp (+3/-1) |
||||
To merge this branch: | bzr merge lp:~stolowski/unity-scope-click/fix-1352451 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Alejandro J. Cura (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+229669@code.launchpad.net |
Commit message
Remove depts_v. Store department mappings for top-level departments in depts table. Bump schema to version 2 and provide schema_update.sh script executed with the upstart job. Update default departments db.
Description of the change
The problem this MR solves has a few causes - in the order of importance:
* the root "All" department (with empty id) didn't really exist in the database (in particular in 'depts' table, which keeps the hierarchy of departments). Instead, we had a depts_v view which returned virtual root for all top level departments. However, the SQL that populated that view was problematic, as it had to do a 'join' against deptnames *without* a locale restriction, and therefore it was "picking" entries for the department names of the fallback empty locale ("").
* the department names for a "fallback" empty locale would never get updated, since the shell always gives us correct locale name, such as en_US, and we update db records for those. The entries for "" locale contained departments such as '3d'.
What this MR does:
* it bumps db schema to version 2
* it provides the new default departments db.
* it removes the problematic depts_v. Instead, the depts table now contains real mappings also for top-level departments (e.g. "accessories" is a child of ""). This eliminates the problem of joining with deptnames: the depts table contains complete hierarchy.
* it provides a script for updating schema. This script gets rid of the department names for "" locale, removes depts_v and inserts missing mappings for root departments into detps.
* the update_schema.sh script doesn't remove obsolete departments, such as 3d, but it fixes the root cause that kept that department around even though it was gone in the store. Visiting Ubuntu store scope will re-sync departments db and remove any obsolete departments.
Note: make sure you reboot after updating click scope from this branch. The update-schema.sh script is required to be executed which normally happens during start of unity8 session.
Testing:
Ideally, this branch should be tested by updating an existing image with new click scope (and rebooting), and by testing a "first-boot" experience (use --wipe, or remove /home/phablet/
FAILED: Continuous integration, rev:392 jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- ci/247/ jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- utopic- amd64-ci/ 222/console jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- utopic- armhf-ci/ 221/console jenkins. qa.ubuntu. com/job/ unity-team- unity-scope- click-devel- utopic- i386-ci/ 221/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/unity- team-unity- scope-click- devel-ci/ 247/rebuild
http://