Open Bug 1944609 Opened 14 days ago

Add missing transforms and supported fields in JEXL filters

Categories

(Application Services :: Remote Settings, enhancement)

enhancement

Tracking

(Not tracked)

People

(Reporter: leplatrem, Unassigned, NeedInfo)

References

Details

Now that we have two official implementations of JEXL filters, we need to clarify exactly what is supported across both implementations.

Editors need to be confident that targeting fields are supported transparently on each platform.

Currently, for example, only the versionCompare transform is supported on the Rust client
https://github.com/mozilla/application-services/blob/39404c8d2a284aadde38a0e638a4d7b557aa55a8/components/remote_settings/src/jexl_filter.rs#L38

And in terms of JEXL app context, the fields in the Rust RemoteSettingsContext don't match the ones in desktop ClientEnvironment
https://github.com/mozilla/application-services/blob/39404c8d2a284aadde38a0e638a4d7b557aa55a8/components/remote_settings/src/lib.rs#L44-L78
https://searchfox.org/mozilla-central/rev/a965e3c683ecc035dee1de72bd33a8d91b1203ed/toolkit/components/utils/ClientEnvironment.sys.mjs#31-264

Missing in RemoteSettingsContext:

  • distribution – Retrieves the application distribution ID.
  • telemetry – Retrieves the most recent telemetry pings.
  • liveTelemetry – Proxy for accessing only the main telemetry ping.
  • randomizationId – A unique user identifier (intended to be replaced by client_id in the future).
  • isDefaultBrowser – Checks whether the application is the default browser.
  • searchEngine – Retrieves the default search engine’s telemetry ID.
  • syncSetup – Checks if the sync feature is set up.
  • syncDesktopDevices – Gets the number of synced desktop devices.
  • syncMobileDevices – Gets the number of synced mobile devices.
  • syncTotalDevices – Computes the total number of synced devices.
  • addons – Retrieves a list of installed add-ons.
  • plugins – Retrieves a list of installed plugins.
  • doNotTrack – Checks whether the Do Not Track (DNT) setting is enabled.
  • os.windowsVersion – Retrieves the Windows version (only on Windows).
  • os.windowsBuildNumber – Retrieves the Windows build number.
  • os.macVersion – Computes the macOS version based on Darwin versioning.
  • os.darwinVersion – Retrieves the Darwin version (only on macOS).
  • attribution – Retrieves attribution data.
  • appinfo – Retrieves application and platform information.

This prevents editor to safely target clients across implementations.

In practice, they may not be all relevant, and maybe we could clean this up a bit (and thus remove them from the documentation). Mark, do you have some inputs on this?

I wrote a little script to list what is currently being used, and it's very limited:

Fields used:
['appinfo.ID', 'channel', 'version']

Transforms used:
['preferenceValue', 'versionCompare']
Flags: needinfo?(standard8)
You need to log in before you can comment on or make changes to this bug.