Skip to content

Move tracker-detection models into tracker-detection-api - #9799

Merged
aibrahim- merged 1 commit into
developfrom
feature/aibrahim/tracker-detection/phase1-api-models
Sep 22, 2026
Merged

aibrahim- merged 1 commit into
developfrom
feature/aibrahim/tracker-detection/phase1-api-models

Conversation

@aibrahim-

Copy link
Copy Markdown
Contributor

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, 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. A package rename is a possible follow-up.
  • browser-api re-exports the module with api 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-api drops its browser-api dependency, since the models it references are now local.

Please note (DL1 from the tech design review): the root build.gradle rule that forbids -api modules from depending on other -api modules needed :tracker-detection-api added to its allowlist, alongside :browser-api and 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

  • Build and run the app
  • Visit a site with trackers (e.g. a news site) and open the privacy dashboard
  • Confirm the blocked trackers and their company names are listed as before

UI changes

Before After
No UI changes No UI changes

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ API Proposal reminder

This PR changes the public surface of one or more -api modules, but the API Proposals field of the PR description is empty. This is a non-blocking reminder — please double-check whether a proposal is needed.

Changed -api source files:

  • browser-api/src/main/java/com/duckduckgo/app/trackerdetection/model/Entity.kt
  • browser-api/src/main/java/com/duckduckgo/app/trackerdetection/model/TrackingEvent.kt
  • tracker-detection/tracker-detection-api/src/main/java/com/duckduckgo/app/trackerdetection/model/Entity.kt
  • tracker-detection/tracker-detection-api/src/main/java/com/duckduckgo/app/trackerdetection/model/TrackingEvent.kt

To clear this reminder, edit the PR description and either:

  • add the approved API Proposal link(s) in the API Proposals field (one per line), or
  • write None there if this PR does not change the public API (e.g. KDoc, comments, tests).

See the API Proposals section in .claude/docs/contributions.md for details.

@aibrahim-
aibrahim- added this pull request to stack #9805 September 17, 2026 10:20
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>
@aibrahim-
aibrahim- force-pushed the feature/aibrahim/tracker-detection/phase1-api-models branch from b7ea118 to e9f9270 Compare September 17, 2026 10:28
@aibrahim-
aibrahim- requested a review from landomen September 21, 2026 10:17
@aibrahim-
aibrahim- marked this pull request as ready for review September 21, 2026 13:11

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread build.gradle
&& dependencyPath != ":js-messaging-api"
&& dependencyPath != ":browser-api"
&& dependencyPath != ":browser-mode-api"
&& dependencyPath != ":tracker-detection-api"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is acceptable to do considering this are core entities / classes.

@aibrahim-
aibrahim- added this pull request to the merge queue Sep 22, 2026
Merged via the queue into develop with commit 7d23cef Sep 22, 2026
23 checks passed
@aibrahim-
aibrahim- deleted the feature/aibrahim/tracker-detection/phase1-api-models branch September 22, 2026 10:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants