[Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist
Siegfried Gevatter has proposed merging lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist. Requested reviews: Zeitgeist Framework Team (zeitgeist) For more details, see: https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 ok, so it seems we decided to skip the u1 events when indexing (they can be uniquely identified by actor) -- https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 Your team Zeitgeist Framework Team is requested to review the proposed merge of lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist. === modified file 'extensions/fts++/indexer.cpp' --- extensions/fts++/indexer.cpp 2012-03-26 16:43:07 + +++ extensions/fts++/indexer.cpp 2012-03-29 18:05:21 + @@ -1303,6 +1303,14 @@ void Indexer::IndexEvent (ZeitgeistEvent *event) { + // Blacklist Ubuntu One events... + const gchar *actor; + actor = zeitgeist_event_get_actor (event); + if (strcmp(actor, "dbus://com.ubuntuone.SyncDaemon.service") == 0) +return; + if (strcmp(actor, "dbus://org.desktopcouch.CouchDB.service") == 0) +return; + try { const gchar *val; === modified file 'extensions/fts++/test/test-indexer.cpp' --- extensions/fts++/test/test-indexer.cpp 2012-03-20 12:25:59 + +++ extensions/fts++/test/test-indexer.cpp 2012-03-29 18:05:21 + @@ -1074,6 +1074,23 @@ assert_nth_result_has_id (results, 2, event_id6); } +static void +test_index_ignore_ubuntu_one (Fixture *fix, gconstpointer data) +{ + guint matches; + + // add test events to DBs + index_event (fix, create_test_event_simple ("ubuntuone:uuid", "failme")); + ZeitgeistEvent *event = create_test_event_simple ("file:///nice%20uri", "failme"); + zeitgeist_event_set_actor (event, "dbus://com.ubuntuone.SyncDaemon.service"); + index_event (fix, event); + + GPtrArray *results = search_simple (fix, "failme", NULL, + ZEITGEIST_RESULT_TYPE_MOST_RECENT_EVENTS, &matches); + + g_assert_cmpuint (results->len, ==, 0); +} + G_BEGIN_DECLS static void discard_message (const gchar *domain, @@ -1138,6 +1155,8 @@ g_test_add ("/Zeitgeist/FTS/Indexer/Query/MostPopularSubjects", Fixture, 0, setup, test_query_most_popular_subjects, teardown); */ + g_test_add ("/Zeitgeist/FTS/Indexer/Index/IgnoreUbuntuOne", Fixture, 0, + setup, test_index_ignore_ubuntu_one, teardown); // get rid of the "rebuilding index..." messages g_log_set_handler (NULL, G_LOG_LEVEL_MESSAGE, discard_message, NULL); ___ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp
[Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist
The proposal to merge lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist has been updated. Status: Needs review => Approved For more details, see: https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 -- https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist. ___ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp
[Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist
The proposal to merge lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist has been updated. Status: Approved => Merged For more details, see: https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 -- https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist. ___ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp
Re: [Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist
Review: Needs Fixing Can we add an envvar which would control the ignoring (ignore by default)? Plus can we change the primary template when doing reindex, so we don't grab the U1 events in the first place? -- https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist. ___ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp
Re: [Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist
8 + // Blacklist Ubuntu One events... 9 + const gchar *actor; 10 + actor = zeitgeist_event_get_actor (event); 11 + if (strcmp(actor, "dbus://com.ubuntuone.SyncDaemon.service") == 0) 12 + return; 13 + if (strcmp(actor, "dbus://org.desktopcouch.CouchDB.service") == 0) 14 + return; Can we move this out into a separate function, to make this hack less impacting on the main codepath? Ala if (CheckEventBlacklisted(event)) return; -- https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist. ___ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp
Re: [Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist
Another benefit of a separate function is also that we can unit test the function directly as well. -- https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist. ___ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp
Re: [Zeitgeist] [Merge] lp:~rainct/zeitgeist/ignore-ubuntuone-actor into lp:zeitgeist
Review: Approve Great job as always, thanks! -- https://code.launchpad.net/~rainct/zeitgeist/ignore-ubuntuone-actor/+merge/99986 Your team Zeitgeist Framework Team is subscribed to branch lp:zeitgeist. ___ Mailing list: https://launchpad.net/~zeitgeist Post to : zeitgeist@lists.launchpad.net Unsubscribe : https://launchpad.net/~zeitgeist More help : https://help.launchpad.net/ListHelp