Skip to content
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

fix: reject experiment contexts with variantIds #29

Merged
merged 3 commits into from May 17, 2024

Conversation

ShubhranshuSanjeev
Copy link
Collaborator

Problem

variantIds dimension, which is specific for experimentation-platform use, can be passed in the context when creating experiments.

Solution

  • validating experiment contexts to not have variantIds as dimensions
  • excluded variantIds from the dropdown in create experiment and create context form

Datron
Datron previously requested changes May 6, 2024
Copy link
Collaborator

@Datron Datron left a comment

Choose a reason for hiding this comment

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

I think validate context should be in context creation and updation, not in experiments

@ShubhranshuSanjeev ShubhranshuSanjeev force-pushed the fix/variantIds-in-experiment-context branch 2 times, most recently from ee3a6a3 to 74fe771 Compare May 14, 2024 09:40
@pratikmishra356 pratikmishra356 self-requested a review May 15, 2024 14:38
@ShubhranshuSanjeev ShubhranshuSanjeev force-pushed the fix/variantIds-in-experiment-context branch from 91b1940 to e73f08c Compare May 17, 2024 07:22
ShubhranshuSanjeev and others added 2 commits May 17, 2024 12:53
- validating experiment contexts to not have `variantIds` as dimensions
- excluded `variantIds` in experiment and context form
@ShubhranshuSanjeev ShubhranshuSanjeev force-pushed the fix/variantIds-in-experiment-context branch from e73f08c to df9be71 Compare May 17, 2024 07:44
@@ -109,7 +109,7 @@ fn get_functions_map(
}

pub fn validate_value_with_function(
fun_name: &str,
_fun_name: &str,
Copy link
Collaborator

Choose a reason for hiding this comment

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

If the name is not used, we could just remove it? This is beyond the scope of the PR, but a suggestion. If the warning isn't present, will we remember to remove this?

@@ -9,6 +9,7 @@ use service_utils::service::types::ExperimentationFlags;
enum Dimensions {
OS(String),
CLIENT(String),
VARIANTIDS(String),
}

fn single_dimension_ctx_gen(value: Dimensions) -> serde_json::Value {
Copy link
Collaborator

Choose a reason for hiding this comment

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

We should remove this from OS superposition. Out of the scope of this PR

@@ -105,6 +105,7 @@ pub fn get_tenants() -> Vec<String> {
.unwrap_or(vec![])
}

#[allow(dead_code)]
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is the a fix for the clippy warning? Can we let the warning persist and find the root cause?

@ShubhranshuSanjeev ShubhranshuSanjeev merged commit 092e568 into main May 17, 2024
4 checks passed
@ShubhranshuSanjeev ShubhranshuSanjeev deleted the fix/variantIds-in-experiment-context branch May 17, 2024 08:06
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.

None yet

5 participants