-
-
Notifications
You must be signed in to change notification settings - Fork 70
feat: track daily demo app onboarding metric #1622
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ✨ Finishing touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 8427aa92af
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| .gte('created_at', todayStartIso) | ||
| .lt('created_at', tomorrowStartIso) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Count demo apps over the full reporting window
This query only counts demo apps between UTC midnight and the next midnight, but logsnag_insights is enqueued by process_admin_stats once per day (see the admin_stats cron task scheduled at 01:01 UTC in supabase/migrations/20251228215402_add_orphan_images_cleanup.sql), so each stored value captures roughly the first hour of the day instead of a full day; that makes the new onboarding trend series systematically undercount and mislead experiment analysis.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Adds a new admin-facing onboarding metric by persisting a daily count of demo app creations into global_stats, exposing it via the admin global-stats trend API, and plotting it on the admin “Onboarding Trend” chart.
Changes:
- Add
demo_apps_createdcolumn topublic.global_stats(with default0) and update generated Supabase DB types. - Aggregate demo app creations in
logsnag_insightsand include the value inglobal_stats_trendresults. - Display a new “Demo Apps Created” series on the admin Users dashboard onboarding trend chart.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| supabase/migrations/20260211034517_add_demo_apps_created_to_global_stats.sql | Adds demo_apps_created column + column comment. |
| supabase/functions/_backend/utils/supabase.types.ts | Updates backend generated DB typings for global_stats. |
| supabase/functions/_backend/utils/pg.ts | Extends AdminGlobalStatsTrend and query mapping to include demo_apps_created. |
| supabase/functions/_backend/triggers/logsnag_insights.ts | Computes and upserts demo_apps_created into global_stats. |
| src/types/supabase.types.ts | Updates frontend generated DB typings for global_stats. |
| src/pages/admin/dashboard/users.vue | Adds “Demo Apps Created” series to onboarding trend chart. |
| ALTER TABLE public.global_stats | ||
| ADD COLUMN demo_apps_created integer NOT NULL DEFAULT 0; | ||
|
|
||
| COMMENT ON COLUMN public.global_stats.demo_apps_created IS 'Number of demo apps created in the last 24 hours'; |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The column comment says this metric is for "the last 24 hours", but the implementation in logsnag_insights counts demo apps within the current UTC day window (00:00–24:00 UTC). Either update the comment to reflect the UTC-day semantics, or change the aggregation to use a rolling last-24h window for consistency with the column description.
| COMMENT ON COLUMN public.global_stats.demo_apps_created IS 'Number of demo apps created in the last 24 hours'; | |
| COMMENT ON COLUMN public.global_stats.demo_apps_created IS 'Number of demo apps created during the current UTC day (00:00–24:00 UTC)'; |
| .from('apps') | ||
| .select('id', { count: 'exact', head: true }) | ||
| .gte('created_at', todayStartIso) | ||
| .lt('created_at', tomorrowStartIso) | ||
| .like('app_id', `${DEMO_APP_PREFIX}%`) |
Copilot
AI
Feb 11, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This query counts demo apps using a UTC calendar-day window (created_at >= todayStartIso and < tomorrowStartIso). The migration/comment/PR text describe "last 24 hours" and other metrics here use the rolling last24h window, so the semantics are inconsistent (and can be a partial-day count depending on when the cron runs). Either switch to gte('created_at', last24h) or rename/document this as "created today (UTC)" end-to-end.
|



Summary (AI generated)
global_statsvia newdemo_apps_createdcolumnlogsnag_insightsand expose it throughglobal_stats_trendDemo Apps Createdseries to the admin UsersOnboarding TrendchartMotivation (AI generated)
Business Impact (AI generated)
Test plan (AI generated)
bun lintbun lint:backendScreenshots (AI generated)
Checklist (AI generated)
bun run lint:backend && bun run lint.accordingly.
my tests
Generated with AI