Use RustDecider#choose()
in for_identifier*()
api
#84
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Utilize
rust_decider.RustDecider#choose()
inget_variant_for_identifier()
&get_variant_for_identifier_without_expose()
(instead of
rust_decider.make_ctx()
/rust_decider.choose()
functions)to emit prometheus metrics.
Notes
1)
If a ctx contains the field that a Feature config, called through
get_variant_for_identifier()
, needs for bucketing, it will get utilized, since there's no concept ofidentifier_type
inRustDecider#choose()
forcing the bucketing to override (we just setctx[identifier_type] = identifier
).e.g. if a Feature "exp_1" with
bucket_val: device_id
gets called via:get_variant_for_identifier("exp_1", identifier="identifier.com", identifier_type="canonical_url")
BUT has the
device_id
field set on ctx, it will usedevice_id
for bucketing, not"identifier.com", identifier_type="canonical_url"
params.The only way to establish similar behavior as before would be to clear the other two identifiers in ctx that aren't of the
identifier_type
param, e.g. cleardevice_id
/user_id
from ctx and setcanonical_url: "identifier.com"
on it.This is why I deleted 2 test cases..but maybe it is worth clearing the other bucketing fields in ctx?
2)
Removed the
overwrite_identifier: bool
param/logic in_send_expose()
/_send_expose_if_holdout
, since we should always use/set thebucket_val: bucketing_value
in the v2 exposure event based on the decider event string, not just in some cases, when we had afor_identifier*()
"override" .