Skip to content

Use rust_decider.RustDecider in get_variant() & get_variant_without_expose() #79

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 18 commits into from
Dec 8, 2022

Conversation

mrlevitas
Copy link
Contributor

@mrlevitas mrlevitas commented Nov 14, 2022

Summary

This pr shows the updates required to incorporate the new decider python shims once they have been merged.
These changes have been tested locally but CI will not pass until the upstream decider-py PR is merged & new reddit-decider package has been released.

Changes

  • Decider() constructor no longer takes a filewatcher param, since an instance of it should not update its experiment config json mid-request.
    Instead an instance of rust_decider.RustDecider class is passed in, which was initialized by the filewatcher in the DeciderContextFactory.
  • Utilize rust_decider.RustDecider#choose(), instead of rust_decider.make_ctx()/rust_decider.choose() functions, in get_variant()/ get_variant_without_expose()
  • only log "Feature "{feature_name}" not found." once via warnings.warn() to alleviate logs if the feature was disabled and not found in config (to maintain parity w/ reddit_experiments)

@mrlevitas mrlevitas requested a review from wuyiqicc December 5, 2022 23:43
Comment on lines 492 to 499
'Rust decider has initialization error: Decider initialization failed: Json error: "invalid type: string \\"1\\"'
'rust_decider.init() has error: Decider initialization failed: Partially loaded decider: 1 features failed to load.'
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@gshipilov until I incorporate de-structuring the hashmap of feature specific errors, we're currently losing error info, we're losing that info for now.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I think this is ok. I'm assuming restructuring the partial error is gonna happen relatively soon, and we have some workarounds for this if we end up in an incident.

Copy link

@gshipilov gshipilov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Although the linter looks unhappy.

@mrlevitas mrlevitas merged commit 6da1657 into develop Dec 8, 2022
@mrlevitas mrlevitas deleted the use_RustDecider branch December 8, 2022 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants