Conversation
Changed Files
|
| /// Resolve all features for the given evaluation context | ||
| /// | ||
| /// Returns a map of all feature keys to their resolved values | ||
| async fn resolve_all_features( |
There was a problem hiding this comment.
resolve_all suffices ? To avoid confusion between config or features.
| /// This trait provides methods to get information about experiments | ||
| /// and which variants are applicable for a given context. | ||
| #[async_trait] | ||
| pub trait FeatureExperimentMeta: Send + Sync { |
There was a problem hiding this comment.
Should this be called FeatureExperimentMetaProvider ?
| #[async_trait] | ||
| pub trait SuperpositionDataSource: Send + Sync { | ||
| /// Fetch the latest configuration from the data source | ||
| async fn fetch_config(&self) -> Result<ConfigData>; |
There was a problem hiding this comment.
Do we need a Context and Prefix Filter support here ?
There was a problem hiding this comment.
async fn fetch_filtered_config(&self, context: Option<Map<String, Value>, prefix_filter: Option<&[String]>,) -> Result<ConfigData>;| /// Fetch experiment data from the data source | ||
| /// | ||
| /// Returns None if the data source doesn't support experiments | ||
| async fn fetch_experiments(&self) -> Result<Option<ExperimentData>>; |
There was a problem hiding this comment.
Do we need a context filter version for this?
| /// Fetch experiment data from the data source | ||
| /// | ||
| /// Returns None if the data source doesn't support experiments | ||
| async fn fetch_experiments(&self) -> Result<Option<ExperimentData>>; |
There was a problem hiding this comment.
| async fn fetch_experiments(&self) -> Result<Option<ExperimentData>>; | |
| async fn fetch_active_experiments(&self) -> Result<Option<ExperimentData>>; |
There was a problem hiding this comment.
Add support for
async fn fetch_filtered_active_experiments(&self, context: Option<&EvaluationContext>, prefix_filter: Option<&[String]>) -> Result<Option<ExperimentData>>;There was a problem hiding this comment.
Introduce following instead of above:
fetch_candidate_experiments (partial match)
fetch_matching_experiments (exact match)
taking Map and Prefix as args.
| async fn fetch_experiments(&self) -> Result<Option<ExperimentData>>; | ||
|
|
||
| /// Get a human-readable name for this data source | ||
| fn source_name(&self) -> &str; |
There was a problem hiding this comment.
skip - add if needed.
| fn supports_experiments(&self) -> bool; | ||
|
|
||
| /// Close and cleanup resources used by this data source | ||
| async fn close(&self) -> Result<()>; |
| ) -> Result<Map<String, Value>>; | ||
|
|
||
| /// Get metadata about this provider | ||
| fn metadata(&self) -> &AllFeatureProviderMetadata; |
There was a problem hiding this comment.
skip - not needed
| #[async_trait] | ||
| pub trait AllFeatureProvider: Send + Sync { | ||
| /// Resolve all features for the given evaluation context | ||
| /// |
There was a problem hiding this comment.
Add a sugar function for
get_default
| /// Resolve all features for the given evaluation context | ||
| /// | ||
| /// Returns a map of all feature keys to their resolved values | ||
| async fn resolve_all_features( |
There was a problem hiding this comment.
Support generic type deserialization in these methods.
Check if it is no-op for Map<String, Value>.
| /// | ||
| /// This returns information about which experiments are active | ||
| /// and which variants have been selected for the given context. | ||
| async fn get_experiment_metadata( |
There was a problem hiding this comment.
| async fn get_experiment_metadata( | |
| async fn get_satisfied_experiments( |
There was a problem hiding this comment.
This is already supported in datasource - remove from here.
| /// | ||
| /// Returns None if the experiment is not applicable for the given context | ||
| /// Returns Some(variant_id) if a variant was selected | ||
| async fn get_experiment_variant( |
Problem
Describe the problem you are trying to solve here
Solution
Provide a brief summary of your solution so that reviewers can understand your code
Environment variable changes
What ENVs need to be added or changed
Pre-deployment activity
Things needed to be done before deploying this change (if any)
Post-deployment activity
Things needed to be done after deploying this change (if any)
API changes
Possible Issues in the future
Describe any possible issues that could occur because of this change