Skip to content
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
4 changes: 2 additions & 2 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ IS_LOOKER_ENABLED=false
LOOKERSDK_BASE_URL=XXX_REPLACE_WITH_ORGANIZATIONAL_LOOKER_BASE_URL
# API client id. You can instead customize how this is provided by overriding readConfig()
LOOKERSDK_CLIENT_ID=XXX_REPLACE_WITH_YOUR_CLIENT_ID
# API client secret. You can instead customize how this is provided by overriding readConfig()
# API client secret. You can instead customize how this is provided by overriding readConfig().
LOOKERSDK_CLIENT_SECRET=XXX_REPLACE_WITH_YOUR_CLIENT_SECRET
# Set to false only if testing locally against self-signed certs. Defaults to true if not specified
LOOKERSDK_VERIFY_SSL=true
# Timeout in seconds for HTTP requests. Defaults to 2 minutes (120) seconds if not specified.
LOOKERSDK_TIMEOUT=120
LOOKERSDK_TIMEOUT=2048

# Threshold for hiding messages with small impression numbers
HIDDEN_MESSAGE_IMPRESSION_THRESHOLD=1000
35 changes: 22 additions & 13 deletions lib/nimbusRecipeCollection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,29 @@ async function updateBranchesCTR(recipe: NimbusRecipe): Promise<BranchInfo[]> {
);
// We are making all branch ids upper case to make up for
// Looker being case sensitive
const ctrPercentData = await getCTRPercentData(
branchInfo.id,
branchInfo.nimbusExperiment.appName,
branchInfo.template!,
undefined,
branchInfo.nimbusExperiment.slug,
branchInfo.slug,
branchInfo.nimbusExperiment.startDate,
proposedEndDate,
);
if (ctrPercentData) {
branchInfo.ctrPercent = ctrPercentData.ctrPercent;
branchInfo.impressions = ctrPercentData.impressions;
// XXX instead of using isRollout as criteria, do something better
// easiest: reenable hardcoded blocklist above
// best: handle data errors and back off in that case
// remembering in blocklist

if (!branchInfo.nimbusExperiment.isRollout) {
const ctrPercentData = await getCTRPercentData(
branchInfo.id,
branchInfo.nimbusExperiment.appName,
branchInfo.template!,
undefined,
branchInfo.nimbusExperiment.slug,
branchInfo.slug,
branchInfo.nimbusExperiment.startDate,
proposedEndDate,
);

if (ctrPercentData) {
branchInfo.ctrPercent = ctrPercentData.ctrPercent;
branchInfo.impressions = ctrPercentData.impressions;
}
}

return branchInfo;
}),
);
Expand Down