Move tracker-detection models into tracker-detection-api - #9799
Conversation
|
Entity, TrackingEvent, TrackerStatus and TrackerType move from browser-api into tracker-detection-api, keeping their legacy com.duckduckgo.app.trackerdetection.model package so no consumer file changes its imports. browser-api re-exports tracker-detection-api with `api project(...)`, which keeps the existing consumers (:app, privacy-dashboard-impl, pir-impl) compiling without adding the dependency to each of them. tracker-detection-api no longer needs browser-api now that the models it references are local. The root build.gradle rule forbidding -api -> -api dependencies gains :tracker-detection-api on its allowlist, alongside :browser-api and the other shared api modules, so the re-export is legal. Asana: https://app.asana.com/1/137249556945/task/1216988666064181 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
b7ea118 to
e9f9270
Compare
There was a problem hiding this comment.
Claude Code Review
This repository is configured for manual code reviews. Comment @claude review for a one-time review, or @claude review always to subscribe this PR to a review on every future push.
Tip: disable this comment in your organization's Code Review settings.
| && dependencyPath != ":js-messaging-api" | ||
| && dependencyPath != ":browser-api" | ||
| && dependencyPath != ":browser-mode-api" | ||
| && dependencyPath != ":tracker-detection-api" |
There was a problem hiding this comment.
I think this is acceptable to do considering this are core entities / classes.
Task/Issue URL: https://app.asana.com/1/137249556945/task/1216988666064181
Tech Design URL (if applicable): https://app.asana.com/1/137249556945/task/1216706645739239
API Proposals URL(s) (if applicable): to follow — will be added before merge
Description
First PR of the tracker-detection extraction (Phase 1 of 5). Pure move, no behaviour change.
Entity,TrackingEvent,TrackerStatusandTrackerTypemove frombrowser-apiintotracker-detection-api, keeping their legacycom.duckduckgo.app.trackerdetection.modelpackage so no consumer file changes its imports. A package rename is a possible follow-up.browser-apire-exports the module withapi project(':tracker-detection-api'). This keeps the existing consumers (:app,privacy-dashboard-impl,pir-impl) compiling without adding the dependency to each of them.tracker-detection-apidrops itsbrowser-apidependency, since the models it references are now local.Please note (DL1 from the tech design review): the root
build.gradlerule that forbids-apimodules from depending on other-apimodules needed:tracker-detection-apiadded to its allowlist, alongside:browser-apiand the other shared api modules. That is what makes the re-export above legal. It seems reasonable given these models are used in several places across the app, but it is a deliberate widening of that allowlist and worth a look.Steps to test this PR
Tracker blocking is unaffected by the move
UI changes