Closed Bug 1728459 Opened 3 months ago Closed 3 months ago

Add support for scores in the Firefox Suggest Merino integration


(Firefox :: Address Bar, task, P1)




93 Branch
93.2 - Aug 23 - Sep 5
Tracking Status
firefox92 --- fixed
firefox93 --- fixed


(Reporter: adw, Assigned: adw)




(2 files)

The Jira ticket for Merino integration says we should prefer remote settings suggestions over Merino suggestions, but I misread or misremembered that and did it backwards. Nan, mythmon, and I talked about it, and we decided we should go ahead and support a simple scoring system for suggestions so we can decide server-side which type of suggestion should take precedence.

This looks for a score property in suggestions from both Merino and remote
settings and picks the suggestion with the highest score. The score is intended
to be normalized -- i.e., in the range [0, 1] -- but currently it doesn't
matter. As discussed, I hardcoded a score of 0.2 for remote settings

When Merino returns multiple suggestions, currently we're just picking the first
one, but now we can pick the one with the highest score without any extra work,
so I went ahead and made sure we handle that now.

Also, this is robust against Merino not including a score in the response. In
that case we'll prefer the remote settings suggestion if there is one, and we'll
use the Merino suggestion if there's not.

Finally I added some new test tasks that aren't specifically related to scoring:
testing cases where either Merino or remote settings returns suggestions but not
both. I noticed I missed those cases earlier.

Pushed by
Add support for scores in the Firefox Suggest Merino integration. r=nanj
Closed: 3 months ago
Resolution: --- → FIXED
Target Milestone: --- → 93 Branch

qe-verify- because this is a relatively low-level change that doesn't need to be individually manually verified.

Flags: qe-verify-
Flags: in-testsuite+

[Tracking Requested - why for this release]: Some urgent Firefox Suggest patches we want to uplift to a 92 dot release depend on this bug.

We're tracking the metabug for this work.

Approval Request Comment
[Feature/Bug causing the regression]: Firefox Suggest offline/online rollouts (this bug is not directly related but code that is directly related depends on it)
[User impact if declined]: Needed for important rollouts on 93 and 92
[Is this code covered by automated tests?]: Yes
[Has the fix been verified in Nightly?]: No
[Needs manual test from QE? If yes, steps to reproduce]: No, low-level change with no visible changes
[List of other uplifts needed for the feature/fix]: See uplift coordination spreadsheet
[Is the change risky?]: Low risk relative to other uplifts needed in the patch stack
[Why is the change risky/not risky?]: This patch slightly modifies the Firefox Suggest integration with Merino, which is preffed off. No visible changes.
[String changes made/needed]:

Attachment #9240787 - Flags: approval-mozilla-release?

Comment on attachment 9240787 [details] [diff] [review]
92/mozilla-release patch

Approved for 92.0.1.

Attachment #9240787 - Flags: approval-mozilla-release? → approval-mozilla-release+
You need to log in before you can comment on or make changes to this bug.