Skip to content

Bug 2054479 - Require targeting and bucketing for Firefox Labs#7481

Merged
freshstrangemusic merged 1 commit into
mainfrom
freshstrangemusic/push-unlmymxkyywx
Jul 17, 2026
Merged

Bug 2054479 - Require targeting and bucketing for Firefox Labs#7481
freshstrangemusic merged 1 commit into
mainfrom
freshstrangemusic/push-unlmymxkyywx

Conversation

@freshstrangemusic

Copy link
Copy Markdown
Member

When queried for the list of all available Firefox Labs, the Nimbus Client was not filtering the recipes by whether they passed targeting and bucketing. This is now the case.

There is now a new function can_enroll that returns an enum, CanEnrollResult, that distinguishes all the different cases that prevent enrollment. The majority of this function was refactored out of evaluate_enrollment, which is now a much simpler function.

Additionally, the targeting(expr, helper) function has been removed. This function took an expression and a NimbusTargetingHelper and returned an EnrollmentStatus if and only if the targeting evaluation did not succeed or resulted in an error. This API was too awkward to work into can_enroll. The majority of this change is test fallout from removing this function, though the tests make more sense now that they are testing the results of JEXL evaluation and not comparing EnrollmentStatuses.

In order to remove a bunch of unnecessary clones, the NimbusTargetingHelper methods now take a &str instead of a String. The UDL has been updated to use [ByRef] so that the FFI contract is unchanged.

Pull Request checklist

  • Breaking changes: This PR follows our breaking change policy
    • This PR follows the breaking change policy:
      • This PR has no breaking API changes, or
      • There are corresponding PRs for our consumer applications that resolve the breaking changes and have been approved
  • Quality: This PR builds and tests run cleanly
    • Note:
      • For changes that need extra cross-platform testing, consider adding [ci full] to the PR title.
      • If this pull request includes a breaking change, consider cutting a new release after merging.
  • Tests: This PR includes thorough tests or an explanation of why it does not
  • Changelog: This PR includes a changelog entry in CHANGELOG.md or an explanation of why it does not need one
    • Any breaking changes to Swift or Kotlin binding APIs are noted explicitly
  • Dependencies: This PR follows our dependency management guidelines
    • Any new dependencies are accompanied by a summary of the due diligence applied in selecting them.

@freshstrangemusic
freshstrangemusic force-pushed the freshstrangemusic/push-unlmymxkyywx branch from c7f48e0 to c4fde37 Compare July 16, 2026 21:21
Base automatically changed from freshstrangemusic/push-ykvzxlknkskw to main July 16, 2026 22:00
When queried for the list of all available Firefox Labs, the Nimbus
Client was not filtering the recipes by whether they passed targeting
and bucketing. This is now the case.

There is now a new function `can_enroll` that returns an enum,
`CanEnrollResult`, that distinguishes all the different cases that
prevent enrollment. The majority of this function was refactored out of
`evaluate_enrollment`, which is now a much simpler function.

Additionally, the `targeting(expr, helper)` function has been removed.
This function took an expression and a `NimbusTargetingHelper` and
returned an `EnrollmentStatus` if and only if the targeting evaluation
did not succeed or resulted in an error. This API was too awkward to
work into `can_enroll`. The majority of this change is test fallout from
removing this function, though the tests make more sense now that they
are testing the results of JEXL evaluation and not comparing
`EnrollmentStatus`es.

In order to remove a bunch of unnecessary clones, the
`NimbusTargetingHelper` methods now take a `&str` instead of a `String`.
The UDL has been updated to use `[ByRef]` so that the FFI contract is
unchanged.
@freshstrangemusic
freshstrangemusic added this pull request to the merge queue Jul 17, 2026
Merged via the queue into main with commit 6c74f6a Jul 17, 2026
14 checks passed
@freshstrangemusic
freshstrangemusic deleted the freshstrangemusic/push-unlmymxkyywx branch July 17, 2026 17:42
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