Closed Bug 2053164 Opened 4 months ago Closed 18 days ago

Enable ContentClassiferEngine together with ETPengine in Nightly

Categories

(Core :: Privacy: Anti-Tracking, task)

task

Tracking

()

RESOLVED FIXED
161 Branch
Tracking Status
firefox161 --- fixed

People

(Reporter: timhuang, Assigned: timhuang)

References

(Blocks 1 open bug, Regressed 3 open bugs)

Details

Attachments

(5 external files)

No description provided.
Summary: Enable ContentClassiferEngine together with MozBlock in Nightly → Enable ContentClassiferEngine together with ETPengine in Nightly
Assignee: nobody → tihuang
Group: mozilla-employee-confidential
Depends on: 2078831

This patch changes ContentClassifierService to apply
privacy.trackingprotection.content.testing.use_test_trackers_engines when it
reads the engines prefs: wherever the trackers engine is listed, test_block
is used for blocking and test_annotate for annotation, and test_block
follows the trackers scoped pref. Whatever writes the engines prefs still
decides when they are active, and test fixtures can give tracking
protection and tracking annotation separate lists, as url-classifier's
tables do.

Once the content classifier is the engine consulted for channel
classification, the Safe Browsing tables addTestTrackers() installs are no
longer read, so the existing tracker-blocking assertions across the tree
would all fail. Publish matching content classifier lists alongside them,
gated on disable_for_channel_classifier so this stays inert until that pref
flips.

Hosts in url-classifier's tracking table and tracking annotation table are
published as the test_block and test_annotate lists, served as data: URLs,
and the service is told to use those engines in place of the trackers
engine. That keeps hosts the classic fixture annotates but never blocks off
the blocking list. The other features get Remote Settings lists.

The fixture also stands in for url-classifier's other test hooks:
addTestHostsFromPrefs() publishes the hosts a test set through the
urlclassifier.features.*.blacklistHosts and tracking table testEntries
prefs, addBuiltInTestTrackers() the entries url-classifier's tracking tables
carry built in, and hosts matching each skip URL pref become exception rules
on the matching list.

This patch changes ProcessListChanges to repopulate the active engine lists
under the lock before it starts the rebuild, so engines that are already
built follow an engines pref change on the next classification.

Previously the lists were only refreshed once every engine rebuild's list
downloading had settled. A load issued right after changing prefs was
classified with the previous lists. Populating the already built engines
doesn't need the missing engines; they join when downloading and building
finish.

This patch keeps url-classifier as the channel classifier, through manifest
prefs or a pushPrefEnv, for tests of what the content classifier does not
cover: url-classifier's own test directories, consent manager and anti-fraud
annotation, email tracking data collection, the entity list, the
harmful-addon feature and the url-classifier-exceptions collection.

The other tests run on the content classifier. Those that seed trackers
through url-classifier's host prefs or rely on its built-in table entries
publish the same hosts through the shared fixture, and their cleanup now
awaits the fixture so the engines are gone before the next test file.
browser_scopedTrackingProtection.js also sets the content classifier scoped
prefs for the trackers and test_block engines, and reloads between its two
loads so the first load's blocking event cannot satisfy the second check.

This patch changes the default of privacy.trackingprotection.content.mirror.mode
to 1 and privacy.trackingprotection.urlclassifier.disable_for_channel_classifier
to true on desktop Nightly. ContentClassifierPrefMirror then drives the content
classifier from the ETP prefs, and url-classifier stops running its tracking
protection features on channels. Safe Browsing stays on url-classifier.

Until the content classifier gains equivalents, Nightly loses consent manager
and anti-fraud annotation, email tracking data collection and the entity list.
No tracker is blocked until the first engine build finishes, which on a new
profile means until the first Remote Settings sync.

Pushed by tihuang@mozilla.com: https://github.com/mozilla-firefox/firefox/commit/9513a07e0560 https://hg.mozilla.org/integration/autoland/rev/3522517793f4 Part 1: Add a test-only pref to use the test_block and test_annotate engines in place of the trackers engine. r=emz https://github.com/mozilla-firefox/firefox/commit/9a38f16bea12 https://hg.mozilla.org/integration/autoland/rev/d2e00b72b16f Part 2: Publish equivalent content classifier lists from UrlClassifierTestUtils.addTestTrackers(). r=emz,dimi https://github.com/mozilla-firefox/firefox/commit/0938b112cb49 https://hg.mozilla.org/integration/autoland/rev/17cb8bae2ca4 Part 3: Apply engines pref changes to already-built ContentClassifier engines synchronously. r=emz https://github.com/mozilla-firefox/firefox/commit/e11b176c0a1c https://hg.mozilla.org/integration/autoland/rev/75358aa55826 Part 4: Adapt the tracking protection tests to the ContentClassifier being the default engine on Nightly. r=dimi,webcompat-reviewers,extension-reviewers,devtools-reviewers,urlbar-reviewers,emz,daisuke,twisniewski,nchevobbe https://github.com/mozilla-firefox/firefox/commit/503c797ed906 https://hg.mozilla.org/integration/autoland/rev/c9a8bf04e6c2 Part 5: Enable the ContentClassifier as the tracking protection engine on desktop Nightly. r=emz
Regressions: 2088028
See Also: → 2088304
Regressions: 2088304
See Also: 2088304 →
Regressions: 2089798
Regressions: 2090050
QA Whiteboard: [qa-triage-done-c162/b161]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: