Closed Bug 1945185 Opened 7 months ago Closed 4 months ago

[Search Consolidation] Setup architecture to call the search-config-icons-v2 remote collection through ApplicationServices

Categories

(Firefox for Android :: Search, task)

All
Android
task

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: skhan, Assigned: tchoh)

References

(Blocks 1 open bug)

Details

(Whiteboard: [fxdroid][group3][search-consolidation])

Attachments

(2 files, 1 obsolete file)

Search icons API is in a collection here as search-config-icons-v2 : https://firefox.settings.services.mozilla.com/v1/buckets/main/collections/search-config-icons/records
and can be called similar to how search-telemtry-v2 is being fetched here : https://searchfox.org/mozilla-mobile/source/firefox-android/android-components/components/support/remotesettings/src/main/java/mozilla/components/support/remotesettings/RemoteSettingsClient.kt#65

The basic idea here would be to download the search-config-icons-v2 json, have it filtered and then download only the icons relevant to the mobile platform. The filtering uses JEXL: https://remote-settings.readthedocs.io/en/latest/target-filters.html
This is performed client side. I believe the remote settings team have a Rust implementation of either the remote server client or the JEXL filtering.

Zac has more idea here on how to use this filter or may redirect to an appropriate person so need'infoing him.
One of the examples in our app for jexl use is : https://searchfox.org/mozilla-mobile/source/firefox-android/fenix/app/src/main/java/org/mozilla/fenix/onboarding/OnboardingFragment.kt#256

Perhaps we can do this at the start of the app in : https://searchfox.org/mozilla-mobile/source/firefox-android/fenix/app/src/main/java/org/mozilla/fenix/components/Core.kt#328

Looping in Harrison and Zac for discussion

Flags: needinfo?(zmckenney)
Flags: needinfo?(hoglesby)

One another question is do we need to store this json as dump locally?

Flags: needinfo?(hoglesby)
Whiteboard: [fxdroid][group3]
Whiteboard: [fxdroid][group3] → [fxdroid][group3][search-consolidation]

(In reply to [:skhan] from comment #1)

One another question is do we need to store this json as dump locally?

There is no requirement for a dump to be fetched in Android / iOS directly as Application Services will have the initial dump
Add any new collection you want to ship on mobile to Application Services
https://github.com/mozilla/application-services/blob/56307e4fd16b902565e4549d8c5369e19c9d9ef3/components/remote_settings/src/client.rs#L88-L92
Expected new collections:

  • search-config-v2
  • search-config-icons (has attachments)
Assignee: nobody → tchoh
Status: NEW → ASSIGNED

Spoke with Mark
interaction with JEXL directly is not required.

When you call make_client on the collection, you'll pass a RemoteSettingsContext object to the make_client call, and then remote settings will do the filtering for you.

This will be handled by https://bugzilla.mozilla.org/show_bug.cgi?id=1947538#c1
where the RemoteSettingsContext will be passed when calling makeClient call.

Since JEXL isnt directly required, I will not be doing that part of the ticket. I will make my patch ready for review.

Flags: needinfo?(zmckenney)

Hi Tim [:tchoh], let's test out the full functionality here using the steps defined in bug 1947538 i.e.

  1. Setup service = RemoteSettingsService in your class
  2. call client = service.makeClient(collectionName, Context) to get the client
  3. To get the records, call client.getRecords()
Attachment #9465552 - Attachment description: WIP: Bug 1945185 - fetch search config icons from remote server → Bug 1945185 - fetch search config icons from remote server
Pushed by tchoh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/51cc76006fa6 add data objects for search config icons api r=android-reviewers,skhan
Status: ASSIGNED → RESOLVED
Closed: 5 months ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
Attachment #9465552 - Attachment description: Bug 1945185 - fetch search config icons from remote server → WIP: Bug 1945185 - fetch search config icons from remote server

A patch has been attached on this bug, which was already closed. Filing a separate bug will ensure better tracking. If this was not by mistake and further action is needed, please alert the appropriate party. (Or: if the patch doesn't change behavior -- e.g. landing a test case, or fixing a typo -- then feel free to disregard this message)

Attachment #9465552 - Attachment description: WIP: Bug 1945185 - fetch search config icons from remote server → Bug 1945185 - fetch search config icons from remote server

Notes

  1. The response from the API looks like
    RemoteSettingsRecord( id=d87f251c-3e12-a8bf-e2d0-afd43d36c5f9, lastModified=1741614164947, deleted=false, attachment=Attachment( filename=1und1-16-firefox.gif, mimetype=image/gif, location=main-workspace/search-config-icons/00e78ac9-ea13-408b-8b63-3a0930a1f9ab.gif, hash=865d76c8175a8f11dedc93f0bc212242a97a8a76adac870e8249368cecc81402, size=159 ), fields={ "engineIdentifiers": [ "1und1" ], "imageSize": 16, "schema": 1741613151713 }),

The way to fetch the actual icon is url + location (in API data). The url for different servers being

The Android icons haven't been merged to the remote server collection yet yet. We are using staging server and "main-preview", that too only has desktop icons. So end to end testing will remain until that is completed.

However we have the format how the data will look like so this patch sets up the architecture.

Summary: [Search Consolidation] Call the search-config-icons-v2 remote collection through ApplicationServices → [Search Consolidation] Setup architecture to call the search-config-icons-v2 remote collection through ApplicationServices
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Blocks: 1957744
Attachment #9472754 - Attachment is obsolete: true
Pushed by tchoh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/36b17de10c5d fetch search config icons from remote server r=android-reviewers,skhan
Status: REOPENED → RESOLVED
Closed: 5 months ago4 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: