Skip to content

Commit 221166b

Browse files
authored
Merge pull request #268 from launchdarkly-labs/cko_2025
Cko 2025
2 parents 3aaf5a3 + b21aad2 commit 221166b

File tree

4 files changed

+21
-16
lines changed

4 files changed

+21
-16
lines changed

Diff for: .github/workflows/demo_provisioning_scripts/DemoBuilder.py

+18-14
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@ def build(self):
3838
self.create_flags()
3939
self.setup_release_pipeline()
4040
self.create_ai_config()
41-
self.create_and_run_experiments()
41+
self.create_and_run_experiments()
42+
self.create_and_run_holdout()
4243
self.project_settings()
4344
self.setup_template_environment()
4445
self.update_add_userid_to_flags()
@@ -103,6 +104,8 @@ def create_metrics(self):
103104
self.metric_cart_accessed()
104105
print(" - Store Checkout Completed")
105106
self.metric_store_checkout_completed()
107+
print(" - New Search Engine")
108+
self.metric_search_engine()
106109

107110
print("Done")
108111
self.metrics_created = True
@@ -370,7 +373,7 @@ def create_ecommerce_shorten_collection_funnel_experiment(self):
370373
"release-new-shorten-collections-page",
371374
"We would want to reduce the collection page to the top three items to reduce customer decision fatigue in order to increase checkout and overall revenue.",
372375
metrics=metrics,
373-
primary_key="store-purchases",
376+
primary_key="shorten-collection-page-metric-group",
374377
)
375378

376379
def run_ecommerce_new_search_engine_feature_experiment(self):
@@ -396,11 +399,11 @@ def create_ecommerce_new_search_engine_feature_experiment(self):
396399
self.ldproject.exp_metric("in-cart-total-price", False)
397400
]
398401
res = self.ldproject.create_experiment(
399-
"new-search-engine",
400-
"(Frequentist) Feature Experiment: New Search Engine",
401-
"production",
402-
"release-new-search-engine",
403-
"We want to a new search engine that is more ranks search results diffrently and have an Add To Cart button built inside the component in order to increase ease of adding items to cart and increasing revenue.",
402+
exp_key="new-search-engine",
403+
exp_name="(Frequentist) Feature Experiment: New Search Engine",
404+
exp_env="production",
405+
flag_key="release-new-search-engine",
406+
hypothesis="We want to a new search engine that is more ranks search results diffrently and have an Add To Cart button built inside the component in order to increase ease of adding items to cart and increasing revenue.",
404407
metrics=metrics,
405408
primary_key="search-engine-add-to-cart",
406409
)
@@ -447,6 +450,7 @@ def create_togglebank_ai_config_experiment(self):
447450
# Create all the experiment holdouts
448451

449452
def create_and_run_holdout(self):
453+
print("Creating holdout: ")
450454
self.run_q4_increase_incart_price_holdout()
451455

452456
def run_q4_increase_incart_price_holdout(self):
@@ -458,7 +462,6 @@ def run_q4_increase_incart_price_holdout(self):
458462
}
459463
]
460464
res = self.ldproject.create_holdout(
461-
self=self,
462465
holdout_key= "q-4-increase-average-total-in-cart-price",
463466
holdout_name="Q4 Increase Average Total Incart Price",
464467
holdout_env_key="production",
@@ -775,13 +778,14 @@ def metric_store_checkout_completed(self):
775778

776779
def metric_search_engine(self):
777780
res = self.ldproject.create_metric(
778-
"search-engine-add-to-cart",
779-
"New Search Engine Add To Cart is Clicked",
780-
"search-engine-add-to-cart",
781-
"This metric will track the number of times the new add to cart button within the new search engine is clicked.",
781+
metric_key="search-engine-add-to-cart",
782+
metric_name="New Search Engine Add To Cart is Clicked",
783+
event_key="search-engine-add-to-cart",
784+
metric_description="This metric will track the number of times the new add to cart button within the new search engine is clicked.",
782785
numeric=False,
783786
unit="",
784787
success_criteria="HigherThanBaseline",
788+
randomization_units=["user"],
785789
tags=["experiment"]
786790
)
787791

@@ -1260,11 +1264,11 @@ def flag_exp_shorten_collections_page(self):
12601264
"Release New Shorten Collections Page in Galaxy Marketplace",
12611265
[
12621266
{
1263-
"value": True,
1267+
"value": "new-shorten-collections-page",
12641268
"name": "New Shorten Collections Page"
12651269
},
12661270
{
1267-
"value": False,
1271+
"value": "old-long-collections-page",
12681272
"name": "Old Longer Collections Page"
12691273
}
12701274
],

Diff for: .github/workflows/demo_provisioning_scripts/LDPlatform.py

+1
Original file line numberDiff line numberDiff line change
@@ -669,6 +669,7 @@ def create_holdout(
669669
headers = {
670670
"Content-Type": "application/json",
671671
"Authorization": self.api_key,
672+
"LD-API-Version": "beta",
672673
}
673674

674675
response = self.getrequest(

Diff for: components/ui/marketcomponents/stores/ProductInventoryComponent.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const ProductInventoryComponent = ({
5252
const LDClient = useLDClient();
5353
const releaseNewShortenCollectionsPage:string = useFlags()[
5454
"release-new-shorten-collections-page"
55-
]?.includes("new-shorten-collections-page");
55+
]?.includes("new-shorten-collections-page") || "";
5656
const { toast } = useToast();
5757
const { logLDMetricSent } = useContext(LiveLogsContext);
5858
const [showAllItems, setShowAllItems] = useState<boolean>(false);

Diff for: pages/marketplace.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export default function Marketplace() {
6060
}
6161

6262
const LDClient = useLDClient();
63-
const releaseNewSearchEngine = useFlags()["release-new-search-engine"]?.includes("new-search-engine");
63+
const releaseNewSearchEngine = useFlags()["release-new-search-engine"]?.includes("new-search-engine") || "";
6464

6565
const [cart, setCart] = useState<InventoryItem[]>([]);
6666

0 commit comments

Comments
 (0)