fix(analytics): exclude local onboarding traffic - #3069
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 6 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (5)
Comment |
Merging this PR will not alter performance
Comparing Footnotes
|
There was a problem hiding this comment.
1 issue found across 2 files
Confidence score: 4/5
- In
supabase/functions/_backend/utils/frontend_onboarding_analytics.ts,buildFrontendOnboardingDailySetupCliHogqlappears to still include localhost events while the aggregate attempts path excludes them, which can skewdaily_setup_cli_outcomesmetrics and make onboarding performance look worse/better than reality—apply the same localhost exclusion logic to this branch to keep analytics consistent.
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="supabase/functions/_backend/utils/frontend_onboarding_analytics.ts">
<violation number="1" location="supabase/functions/_backend/utils/frontend_onboarding_analytics.ts:186">
P2: This filter excludes localhost only from the aggregate attempts, not from the `daily_setup_cli_outcomes` branch of the same function. `buildFrontendOnboardingDailySetupCliHogql` still matches frontend `onboarding_step_viewed` setup events without a `$host` predicate, so localhost test data keeps leaking into the setup-outcomes part of the response. Add the same `$host` filter to the frontend setup-events predicates in `frontend_onboarding_daily_setup_cli_outcomes.ts` to match the stated retroactive localhost-exclusion goal.</violation>
</file>
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
| FROM events | ||
| WHERE event IN (${eventAllowlist}) | ||
| AND JSONExtractString(toString(properties), 'flow') = 'pre_org' | ||
| AND JSONExtractString(toString(properties), '$host') = 'console.capgo.app' |
There was a problem hiding this comment.
P2: This filter excludes localhost only from the aggregate attempts, not from the daily_setup_cli_outcomes branch of the same function. buildFrontendOnboardingDailySetupCliHogql still matches frontend onboarding_step_viewed setup events without a $host predicate, so localhost test data keeps leaking into the setup-outcomes part of the response. Add the same $host filter to the frontend setup-events predicates in frontend_onboarding_daily_setup_cli_outcomes.ts to match the stated retroactive localhost-exclusion goal.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At supabase/functions/_backend/utils/frontend_onboarding_analytics.ts, line 186:
<comment>This filter excludes localhost only from the aggregate attempts, not from the `daily_setup_cli_outcomes` branch of the same function. `buildFrontendOnboardingDailySetupCliHogql` still matches frontend `onboarding_step_viewed` setup events without a `$host` predicate, so localhost test data keeps leaking into the setup-outcomes part of the response. Add the same `$host` filter to the frontend setup-events predicates in `frontend_onboarding_daily_setup_cli_outcomes.ts` to match the stated retroactive localhost-exclusion goal.</comment>
<file context>
@@ -183,6 +183,7 @@ export function buildFrontendOnboardingHogql(startDate: string, cohortEndDate: s
FROM events
WHERE event IN (${eventAllowlist})
AND JSONExtractString(toString(properties), 'flow') = 'pre_org'
+ AND JSONExtractString(toString(properties), '$host') = 'console.capgo.app'
AND toIntOrZero(toString(properties.onboarding_version)) IN (${versionAllowlist})
AND timestamp >= parseDateTimeBestEffort(${sqlStr(startDate)})
</file context>
There was a problem hiding this comment.
Fixed in e0ea21f. The production-host predicate now applies to both setup_people and the selected frontend setup/copy branch; CLI-command events remain unfiltered. Regression assertions cover both predicates, and lint, typecheck, and all 1,999 unit tests pass.
There was a problem hiding this comment.
All reported issues were addressed across 2 files (changes from recent commits).
Tip: Review your code locally with the cubic CLI to iterate faster.
Re-trigger cubic
|



Summary
Verification