diff --git a/.env.sample b/.env.sample index c53bc771..d52cb653 100644 --- a/.env.sample +++ b/.env.sample @@ -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 diff --git a/lib/nimbusRecipeCollection.ts b/lib/nimbusRecipeCollection.ts index 20d7a3dd..a9a8f4a3 100644 --- a/lib/nimbusRecipeCollection.ts +++ b/lib/nimbusRecipeCollection.ts @@ -47,20 +47,29 @@ async function updateBranchesCTR(recipe: NimbusRecipe): Promise { ); // 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; }), );