Create an unauthenticated endpoint to retrieve recommendations

RESOLVED FIXED

Status

Data Platform and Tools
General
P1
normal
RESOLVED FIXED
3 months ago
21 days ago

People

(Reporter: mdoglio, Assigned: mdoglio)

Tracking

(Depends on: 1 bug, Blocks: 1 bug)

Details

(Assignee)

Description

3 months ago
The new endpoint will take a telemetry client_id as input and return a list of addons guid in json format.
Assignee: nobody → mdoglio
(Assignee)

Updated

2 months ago
Priority: -- → P1
(Assignee)

Comment 1

2 months ago
The repository at https://github.com/mozilla/taar-api contains a dockerflow-friendly implementation. This code needs to be tested against a real hbase server, so it's not production-ready yet.
(Assignee)

Comment 2

2 months ago
The service is now deployed and working in a dockerflow environment create as part of bug 1386258.
(Assignee)

Comment 3

2 months ago
The dev service is deployed at https://taar.dev.mozaws.net.
The api is very simple, it accepts requests in the format
/api/recommendations/<telemetry-client-id>/
and returns a json payload in the format
{
  "results": [
    "<addon id 1>",
    "<addon id 2>",
    ....
    "<addon id 10>",
  ]
}

:scolville please let me know if you have any question
Flags: needinfo?(scolville)
Thanks I'll pass this info on to the developer working on implementing our end of things.
Flags: needinfo?(scolville)
(In reply to Mauro Doglio [:mdoglio] from comment #3)
> The dev service is deployed at https://taar.dev.mozaws.net.
> The api is very simple, it accepts requests in the format
> /api/recommendations/<telemetry-client-id>/
> and returns a json payload in the format
> {
>   "results": [
>     "<addon id 1>",
>     "<addon id 2>",
>     ....
>     "<addon id 10>",
>   ]
> }
> 
> :scolville please let me know if you have any question

Is there a quick way to get a client-id? I tried looking it up from about:config (toolkit.telemetry.cachedClientID) but I'm not sure if that's the right value - I didn't get a result.
Flags: needinfo?(mdoglio)
(Assignee)

Comment 6

2 months ago
It's the value of `clientId` in about:telemetry#general-data-tab. The taar-api dev environment is acting crazy at the moment and I'm working on it. It should be fixed soon.
Flags: needinfo?(mdoglio)
Is there an alternate url we should be using for AMO dev and stage?  I'm assuming https://taar.dev.mozaws.net/ is the one to use for production amo.
Flags: needinfo?(mdoglio)

Comment 8

2 months ago
https://taar.dev.mozaws.net/ is for dev and stage. The prod endpoint has not been setup but most likely be https://taar.prod.mozaws.net/ or https://taar.data.mozaws.net/
Flags: needinfo?(mdoglio)
Are the recommendations returned already filtered for correct platform and OS?  I.e. could one of the guids relate to a MacOS-only addon and we'd be offering it to a Windows telemetry id?
Flags: needinfo?(mdoglio)

Updated

a month ago
Depends on: 1396545
(In reply to Andrew Williamson [:eviljeff] from comment #9)
> Are the recommendations returned already filtered for correct platform and
> OS?  I.e. could one of the guids relate to a MacOS-only addon and we'd be
> offering it to a Windows telemetry id?

Hey Andrew,

there are a bunch of edge cases that can trigger incompatible recommendations:

- Individual TAAR recommendation strategies can recommend incompatible addons for the current platform. We filed bug 1396545 to address that.
- No information is available for the user on our servers (e.g. user disabled Telemetry, new user not yet on our servers, ...). I'm afraid this edge case cannot be solved.
Flags: needinfo?(mdoglio)
> - Individual TAAR recommendation strategies can recommend incompatible addons for the current platform. We filed bug 1396545 to address that.

okay, we won't need to handle that edge case then.

- No information is available for the user on our servers (e.g. user disabled Telemetry, new user not yet on our servers, ...). I'm afraid this edge case cannot be solved.

What would be sent back in that case?  An empty response/error?

I've written the patch currently to be fairly tolerant of getting empty results, or guids not public on AMO - it just ignores anything we can't use and swaps out up to four extensions from the existing curated list.  (no results would mean no substitutions)
(In reply to Andrew Williamson [:eviljeff] from comment #11)
> > - Individual TAAR recommendation strategies can recommend incompatible addons for the current platform. We filed bug 1396545 to address that.
> 
> okay, we won't need to handle that edge case then.
> 
> - No information is available for the user on our servers (e.g. user
> disabled Telemetry, new user not yet on our servers, ...). I'm afraid this
> edge case cannot be solved.

Sorry for the delay, I forgot to come back to this. We currently send an empty list every time we were not able to make useful recommendations, so you should be fine.
(Assignee)

Updated

21 days ago
Status: NEW → RESOLVED
Last Resolved: 21 days ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.