fix(admin): add activation stages to onboarding funnel - #2690
Conversation
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 34 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 (3)
📝 WalkthroughWalkthroughThe activation funnel now enforces app-version activation windows, calculates nested stage conversions, and conditionally displays telemetry-dependent dashboard stages. English messaging, screenshot assets, and test expectations were updated. ChangesActivation funnel
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant AdminDashboard
participant getAdminOnboardingFunnel
participant activationCohortQuery
participant getAdminOnboardingActivationMetrics
AdminDashboard->>getAdminOnboardingFunnel: request onboarding funnel data
getAdminOnboardingFunnel->>activationCohortQuery: fetch time-constrained activation cohorts
activationCohortQuery-->>getAdminOnboardingFunnel: return eligible cohorts
getAdminOnboardingFunnel->>getAdminOnboardingActivationMetrics: calculate nested stage metrics
getAdminOnboardingActivationMetrics-->>getAdminOnboardingFunnel: return stage counts and trends
getAdminOnboardingFunnel-->>AdminDashboard: render telemetry-aware funnel stages
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Comment |
Merging this PR will degrade performance by 26.57%
|
| Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|
| ❌ | /updates payload validation |
94.3 µs | 128.4 µs | -26.57% |
Tip
Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.
Comparing codex/onboarding-funnel-activation-stages (8a3ab12) with main (cc975eb)2
Footnotes
-
2 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
-
No successful run was found on
main(660ac14) during the generation of this report, so cc975eb was used instead as the comparison base. There might be some changes unrelated to this pull request in this report. ↩
|
@coderabbitai review |
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_f31d7e4f-74b1-4a6d-8813-b7dcb0b96623) |
✅ Action performedReview finished.
|
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_b79175a5-b1be-4348-81c5-08a052b82da5) |
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped, usage limit reached), so automated review is incomplete and I am not approving. Human reviewers are already assigned for the admin onboarding funnel changes.
Sent by Cursor Approval Agent: Pull Request Approver External
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
supabase/functions/_backend/utils/pg.ts (1)
3163-3180: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick winAlign
orgs_with_bundleswith the activation cohort.supabase/functions/_backend/utils/pg.ts:3163-3180public.transfer_app()preservesapps.created_atwhen moving an app to a new org, so transferred apps can be counted byorgs_with_bundlesbut excluded byactivationCohortQuery’sa.created_atwindow. That skewsproduction_device_conversion_rateby comparing different populations.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@supabase/functions/_backend/utils/pg.ts` around lines 3163 - 3180, Update the orgs_with_bundles CTE to apply the same app-created-at activation window as activationCohortQuery, using each app’s created_at relative to the organization cohort dates. Ensure transferred apps with created_at outside the organization’s window are excluded so both conversion-rate populations align.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@supabase/functions/_backend/utils/pg.ts`:
- Around line 3167-3179: The shared channels/app_versions eligibility predicates
are duplicated across orgs_with_bundles, daily_bundles, daily_subscriptions, and
activationCohortQuery. Define one reusable sql fragment for this EXISTS check
and interpolate it into each query, preserving the existing aliases, filters,
and seven-day creation window so all funnel queries use identical rules.
In `@tests/admin-stats.test.ts`:
- Around line 992-1052: Create dedicated uniquely named organization, app, and
channel data within the test instead of using ONBOARDING_ORG_ID,
ONBOARDING_APP_ID, and the shared production channel. Insert the initial bundle
and subscription state required by the onboarding funnel scenario, then update
only the test-owned channel to the later promoted version. Adjust the assertions
to reflect exclusively this test’s data so the test is isolated and safe for
concurrent execution.
---
Outside diff comments:
In `@supabase/functions/_backend/utils/pg.ts`:
- Around line 3163-3180: Update the orgs_with_bundles CTE to apply the same
app-created-at activation window as activationCohortQuery, using each app’s
created_at relative to the organization cohort dates. Ensure transferred apps
with created_at outside the organization’s window are excluded so both
conversion-rate populations align.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 36dd866d-faa4-46b0-8221-bb73a9c34e48
📒 Files selected for processing (2)
supabase/functions/_backend/utils/pg.tstests/admin-stats.test.ts
🔗 Linked repositories identified
CodeRabbit considers these linked repositories for cross-repo context during reviews:
Cap-go/capacitor-updater(manual)
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_96c4c40f-df8f-4a91-bb56-2422a1c2f743) |
There was a problem hiding this comment.
Stale comment
Risk: medium. Cursor Bugbot did not complete successfully (check skipped, usage limit reached), so automated review is incomplete and I am not approving. Human reviewers are already assigned for the admin onboarding funnel changes.
Sent by Cursor Approval Agent: Pull Request Approver External
Bugbot couldn't run - usage limit reachedBugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit. A user or team admin can review and increase usage limits in the Cursor dashboard. (requestId: serverGenReqId_70f4cd8a-e9d2-4124-8240-ff853042490d) |
|





Summary\n\n- make Production plugin device and Completed update download sequential stages of the Onboarding Funnel\n- restrict activation cohorts to apps that already reached the bundle stage in their seven-day onboarding window\n- keep subscription as a separate commercial conversion because it is not a downstream product-activation step\n\n## Root cause\n\nThe merged implementation rendered activation metrics below the funnel rather than as funnel stages.\n\n## Visual\n\n
\n\n## Validation\n\n- bun lint\n- bun run lint:backend\n- bun run typecheck:backend\n- bun run typecheck:frontend\n- bunx vitest run tests/admin-onboarding-funnel.unit.test.ts\n- bun run test:unit
Note
Medium Risk
Changes admin onboarding funnel SQL and conversion math, which can shift reported metrics; scope is admin analytics only, not auth or customer-facing flows.
Overview
Reworks the admin onboarding funnel so product activation is measured as sequential funnel stages instead of a separate “activation signals” block below the chart.
When activation telemetry is available, the funnel now includes Production plugin device and Completed update download after bundle upload, with step-to-step conversion tiles (
Bundle → Production device,Production device → Update download). Subscription stays outside the product funnel as a single commercial conversion (Bundle → Subscribed).Backend metrics now use adjacent-stage denominators (e.g. production device % of orgs with bundle, update download % of orgs with production device). Bundle eligibility is tightened via shared
onboardingBundleEligibility: orgs count as having uploaded a bundle when they have an app in the 7-day window, a channel, and a non-builtin bundle uploaded in that window—not only when that bundle is the channel’s currentversion(fixes orgs dropping out after a later channel promotion).Activation cohorts for telemetry use the same bundle eligibility. Copy and i18n strings were updated to match the new funnel story.
Reviewed by Cursor Bugbot for commit 8a3ab12. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit