Skip to content
This repository has been archived by the owner on Mar 25, 2024. It is now read-only.

feat: add flag_key to VariantEvaluationResponse and BooleanEvaluationResponse #29

Merged
merged 1 commit into from
Oct 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/evaluation/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ pub struct BooleanEvaluation {
pub request_id: String,
pub request_duration_millis: f64,
pub timestamp: DateTime<Utc>,
pub flag_key: String,
}

#[derive(Debug, Clone, PartialEq, Deserialize)]
Expand All @@ -67,6 +68,7 @@ pub struct VariantEvaluation {
pub request_id: String,
pub request_duration_millis: f64,
pub timestamp: DateTime<Utc>,
pub flag_key: String,
}

#[derive(Debug, Clone, Deserialize)]
Expand Down
2 changes: 2 additions & 0 deletions tests/integration.rs
Original file line number Diff line number Diff line change
Expand Up @@ -345,6 +345,7 @@ async fn integration_api() {

assert_eq!(boolean_evaluation.enabled, true);
assert_eq!(boolean_evaluation.reason, V2Reason::Default);
assert_eq!(boolean_evaluation.flag_key, flag_key);
}

async fn variant_evaluate(client: &EvaluationClient<'_>, flag_key: &str) {
Expand All @@ -367,6 +368,7 @@ async fn integration_api() {
assert_eq!(variant_evaluation.segment_keys[0], "segment-a");
assert_eq!(variant_evaluation.variant_key, "variant-a");
assert_eq!(variant_evaluation.variant_attachment, "");
assert_eq!(variant_evaluation.flag_key, flag_key);
}

async fn delete_rollout(client: &ApiClient, flag_key: &str, id: &str) {
Expand Down