Skip to content

Bug 2055524 - Add debug logging to NimbusClient::get_available_firefox_labs#7482

Open
freshstrangemusic wants to merge 2 commits into
mainfrom
freshstrangemusic/push-lwmznyspsmkq
Open

Bug 2055524 - Add debug logging to NimbusClient::get_available_firefox_labs#7482
freshstrangemusic wants to merge 2 commits into
mainfrom
freshstrangemusic/push-lwmznyspsmkq

Conversation

@freshstrangemusic

Copy link
Copy Markdown
Member

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.

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 force-pushed the freshstrangemusic/push-lwmznyspsmkq branch from ac4b644 to cefc42b Compare July 17, 2026 02:07
@freshstrangemusic
freshstrangemusic force-pushed the freshstrangemusic/push-unlmymxkyywx branch from c4fde37 to a531078 Compare July 17, 2026 02:07
Base automatically changed from freshstrangemusic/push-unlmymxkyywx to main July 17, 2026 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant