Skip to content

feat(admin): chart app creation build onboarding metrics#2571

Open
riderx wants to merge 1 commit into
mainfrom
codex/admin-app-build-onboarding-metrics
Open

feat(admin): chart app creation build onboarding metrics#2571
riderx wants to merge 1 commit into
mainfrom
codex/admin-app-build-onboarding-metrics

Conversation

@riderx

@riderx riderx commented Jun 23, 2026

Copy link
Copy Markdown
Member

Summary

  • Add daily global_stats counters for apps created, first-day CLI onboarding builds, and first-day manual builds.
  • Tag CLI native build requests as manual or cli_onboarding and normalize missing/unknown sources server-side.
  • Add an admin dashboard multi-line chart for the saved-by-day app creation/build onboarding metrics.

Screenshot

Admin dashboard app build onboarding chart

Validation

  • bun lint
  • bun lint:backend
  • bun typecheck
  • bun run cli:check
  • bun test tests/admin-stats.test.ts
  • bun test ./test/prescan/request-gate.test.ts from cli/
  • bun run supabase:db:reset
  • bunx supabase db lint --local from .context/supabase-worktrees/c85d6572 (exits 0 with existing warnings)
  • Captured the admin dashboard change as docs/pr-assets/admin-app-build-onboarding-chart.webp

Note

Medium Risk
Touches schema, migrations, and the daily global-stats shard with delayed cohort logic; mistakes would skew admin metrics but not user auth or billing.

Overview
Adds onboarding provenance on apps (created_from_onboarding, onboarding_completed_at via a trigger when need_onboarding flips off) and persists three daily global_stats counters: apps created that UTC day, CLI-onboarding apps with >2 builds in the first 24h (only if onboarding completed within 24h of creation), and non-onboarding apps with the same build threshold.

The global stats job computes those cohort metrics on a one-day lag so each app’s full 24h build window can finish, then writes them to the prior day’s snapshot. App create sets created_from_onboarding from need_onboarding. The admin dashboard gets a multi-line chart and trend API wiring; get_org_apps_with_last_upload is rewritten to an explicit column list so new app fields do not break the RPC contract. apps.vue normalizes list rows that omit the new columns.

Reviewed by Cursor Bugbot for commit 3712e7e. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • New Features
    • Added an admin dashboard chart for app build onboarding metrics, including total apps created and onboarding build counts within 24 hours (CLI vs manual).
    • Enhanced app tracking with onboarding provenance and completion timestamps.
  • Bug Fixes
    • Improved admin stats trend typing/serialization so onboarding metrics display correctly.
  • Tests
    • Added unit coverage for onboarding metrics summarization logic.
  • Chores
    • Updated translation strings to support the new onboarding chart labels.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Adds onboarding tracking to the app lifecycle: two new columns on public.apps (created_from_onboarding, onboarding_completed_at) with a trigger to auto-set the completion timestamp, three new daily global_stats metrics columns, a backend computation function wired into the core stats shard, an updated admin trend query, a new admin dashboard chart, and corresponding TypeScript type definition updates across all packages.

Changes

App Build Onboarding Metrics Pipeline

Layer / File(s) Summary
Migration: apps onboarding columns, global_stats metrics, trigger, and RPC
supabase/migrations/20260623144909_admin_app_build_onboarding_metrics.sql
Adds created_from_onboarding and onboarding_completed_at to public.apps with a trigger function that auto-sets completion on need_onboarding transition. Adds three new global_stats bigint metrics columns (apps_created, apps_with_cli_onboarding_builds_24h, apps_with_manual_builds_24h). Creates supporting indexes on public.apps(created_at) and public.build_requests(app_id, created_at). Rewrites/replaces get_org_apps_with_last_upload RPC with pagination, search, sorting, and a derived last_upload_at field computed from app_versions. Sets function ownership and grants.
Read replica and Drizzle schema updates
read_replicate/schema_replicate.sql, supabase/functions/_backend/utils/postgres_schema.ts
Read-replica schema and Drizzle ORM schema are synchronized with the new apps onboarding columns and idx_apps_created_at index.
TypeScript type definitions across all packages
src/types/supabase.types.ts, cli/src/types/supabase.types.ts, supabase/functions/_backend/utils/supabase.types.ts
All Supabase-generated type files updated: apps Row/Insert/Update gain created_from_onboarding and onboarding_completed_at; global_stats Row/Insert/Update gain the three new metrics counters; get_accessible_apps_for_apikey_v2 return type includes the onboarding fields.
App creation: persist created_from_onboarding from need_onboarding
supabase/functions/_backend/public/app/post.ts
Sets created_from_onboarding from body.need_onboarding ?? false in the insert object and includes it in the SQL INSERT INTO public.apps column list and VALUES parameter array.
Onboarding metrics computation in logsnag_insights shard
supabase/functions/_backend/triggers/logsnag_insights.ts
Adds DAY_IN_MS constant, summarizeAppBuildOnboardingRows helper that counts created apps and classifies CLI vs manual onboarding (when completion is within 24h of creation and build count exceeds 2), and getAppBuildOnboardingMetrics function querying prior-day apps joined with 24h-window build requests. runCoreGlobalStatsShard is updated to call this function and write the three new fields into updateGlobalStatsSnapshot. Exports the summarizer utility for testing.
Admin global stats trend query and interface
supabase/functions/_backend/utils/pg.ts
AdminGlobalStatsTrend interface gains three new numeric fields. getAdminGlobalStatsTrend SQL selects them via JSON key lookups with safe casting to integers defaulting to 0. Result-row mapping populates these fields with || 0 fallbacks.
Admin dashboard onboarding chart and translations
src/pages/admin/dashboard/index.vue, messages/en.json
Extends globalStatsTrendData type with the three new metrics fields. Adds appBuildOnboardingSeries computed property mapping trend data into three labeled chart series. Inserts a new ChartCard with AdminMultiLineChart into the template grid. Adds four i18n translation keys for chart title and metric labels.
apps.vue icon loader: AppIconSource union and onboarding field normalization
src/pages/apps.vue
Introduces AppIconSource union type covering both base apps rows and RPC return rows. Adds normalizeAppRow helper to default missing onboarding fields. Updates appWithImmediateIcon and loadAppIcon/loadAppIcons to accept the union type, normalize input before signing, and update loading state on both success and failure.
Tests: admin stats trend and onboarding summarizer unit test
tests/admin-stats.test.ts, tests/logsnag-insights-revenue.unit.test.ts
Admin stats test seeds the three new global_stats fields in trend fixtures and asserts the API response includes them. Local type assertion is extended to include the new counters. New assertions on latest trend row verify the new metrics values. New concurrent unit test exercises summarizeAppBuildOnboardingRows with mixed row types and timestamps across the 24h boundary; asserts exact summary counts.

Sequence Diagram

sequenceDiagram
    participant User as User<br/>(creates app)
    participant PostAPI as POST /app<br/>(create endpoint)
    participant AppsDB as Apps table
    participant Trigger as set_app_onboarding<br/>_completed_at trigger
    participant CoreShard as Core global<br/>stats shard
    participant GetMetrics as getAppBuild<br/>OnboardingMetrics
    participant GlobalStatsDB as Global stats<br/>table
    participant AdminDash as Admin<br/>Dashboard

    User->>PostAPI: POST /app (need_onboarding=true)
    PostAPI->>AppsDB: INSERT created_from_onboarding=true
    AppsDB-->>PostAPI: app created

    Note over CoreShard: Daily scheduled execution
    CoreShard->>GetMetrics: Get prior-day metrics
    GetMetrics->>AppsDB: Query apps with build requests
    AppsDB-->>GetMetrics: rows with created_at, onboarding_completed_at, build_count
    GetMetrics->>GetMetrics: summarizeAppBuildOnboardingRows
    GetMetrics-->>CoreShard: apps_created, apps_with_cli/manual_onboarding_builds_24h
    CoreShard->>GlobalStatsDB: Update global_stats snapshot
    
    AdminDash->>GlobalStatsDB: Fetch trend data
    GlobalStatsDB-->>AdminDash: global_stats trend rows
    AdminDash->>AdminDash: appBuildOnboardingSeries mapper
    AdminDash-->>User: Render onboarding metrics chart
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • Cap-go/capgo#1834: Introduces need_onboarding in the same post.ts app creation endpoint that this PR extends to persist created_from_onboarding.
  • Cap-go/capgo#2484: Refactors the runCoreGlobalStatsShard snapshot pipeline in logsnag_insights.ts that this PR extends with the new onboarding metrics computation.
  • Cap-go/capgo#2509: Adds the cron job that flips apps.need_onboarding to false, directly triggering the onboarding_completed_at trigger introduced by this PR.

Suggested reviewers

  • Dalanir
  • WcaleNieWolny
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: adding a chart to the admin dashboard that visualizes app creation and first-day build onboarding metrics.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The PR description provides a clear summary, includes validation steps, and references a screenshot, but is missing the Test Plan section from the template.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch

Comment @coderabbitai help to get the list of available commands.

@codspeed-hq

codspeed-hq Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Merging this PR will not alter performance

✅ 43 untouched benchmarks
⏩ 2 skipped benchmarks1


Comparing codex/admin-app-build-onboarding-metrics (22c3dc0) with main (647bf87)

Open in CodSpeed

Footnotes

  1. 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.

@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from e68f3b7 to 4977799 Compare June 23, 2026 15:38
@github-actions

github-actions Bot commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

🧪 Builder onboarding TUI preview — ❌ failed

▶ Open the interactive HTML report (zoomable journey tree + cast playback)

Commit: 202e524 · Job summary with the result table

@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from 4977799 to ab04a7f Compare June 23, 2026 15:49
@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from ab04a7f to aad7d3b Compare June 23, 2026 16:01
@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from aad7d3b to 202e524 Compare June 23, 2026 16:11
@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from 202e524 to b504255 Compare June 23, 2026 17:01
@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from b504255 to 09f48a1 Compare June 23, 2026 17:17
@riderx riderx marked this pull request as ready for review June 23, 2026 17:26
@coderabbitai coderabbitai Bot added the codex label Jun 23, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot remained pending after the 8-minute polling window, so automated review is incomplete and I am not approving. Human review is needed for the migration, backend trigger, and admin dashboard changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot requested a review from WcaleNieWolny June 23, 2026 17:34

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/types/supabase.types.ts (1)

321-332: 🗄️ Data Integrity & Integration | 🟡 Minor

Update TypeScript RPC return types to reflect actual column availability.

The new created_from_onboarding and onboarding_completed_at columns are missing from the TypeScript type definitions for both RPC functions:

  • get_accessible_apps_for_apikey_v2 (line 3596): Returns full apps row at SQL level but TypeScript types omit the new fields, causing type-SQL mismatch.
  • get_org_apps_with_last_upload (line 3824): Intentionally excludes these fields (per SQL comment: "stable apps list contract"), so TypeScript correctly omits them—but this is by design.

The consumer code in src/pages/apps.vue:42-43 works around this with fallback logic ('created_from_onboarding' in app), but relying on runtime field presence is fragile. Regenerate the TypeScript types to match the SQL schema.

🤖 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 `@src/types/supabase.types.ts` around lines 321 - 332, The TypeScript type
definitions in the Supabase types file for the RPC functions
`get_accessible_apps_for_apikey_v2` and `get_org_apps_with_last_upload` are out
of sync with the actual SQL schema. The `get_accessible_apps_for_apikey_v2`
function should include the `created_from_onboarding` and
`onboarding_completed_at` fields since it returns the full apps row at the SQL
level, while `get_org_apps_with_last_upload` should continue to exclude these
fields as per its design contract for a stable API. Regenerate the TypeScript
type definitions from the Supabase schema to ensure they accurately reflect what
each RPC function returns, eliminating the need for runtime field presence
checks in consumer code like `src/pages/apps.vue`.
🤖 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.

Outside diff comments:
In `@src/types/supabase.types.ts`:
- Around line 321-332: The TypeScript type definitions in the Supabase types
file for the RPC functions `get_accessible_apps_for_apikey_v2` and
`get_org_apps_with_last_upload` are out of sync with the actual SQL schema. The
`get_accessible_apps_for_apikey_v2` function should include the
`created_from_onboarding` and `onboarding_completed_at` fields since it returns
the full apps row at the SQL level, while `get_org_apps_with_last_upload` should
continue to exclude these fields as per its design contract for a stable API.
Regenerate the TypeScript type definitions from the Supabase schema to ensure
they accurately reflect what each RPC function returns, eliminating the need for
runtime field presence checks in consumer code like `src/pages/apps.vue`.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f35cf478-0df7-4267-872c-cdec0940988a

📥 Commits

Reviewing files that changed from the base of the PR and between 647bf87 and 09f48a1.

📒 Files selected for processing (15)
  • cli/src/types/supabase.types.ts
  • docs/pr-assets/admin-app-build-onboarding-chart.webp
  • messages/en.json
  • read_replicate/schema_replicate.sql
  • src/pages/admin/dashboard/index.vue
  • src/pages/apps.vue
  • src/types/supabase.types.ts
  • supabase/functions/_backend/public/app/post.ts
  • supabase/functions/_backend/triggers/logsnag_insights.ts
  • supabase/functions/_backend/utils/pg.ts
  • supabase/functions/_backend/utils/postgres_schema.ts
  • supabase/functions/_backend/utils/supabase.types.ts
  • supabase/migrations/20260623144909_admin_app_build_onboarding_metrics.sql
  • tests/admin-stats.test.ts
  • tests/logsnag-insights-revenue.unit.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

@cursor cursor Bot requested a review from Dalanir June 23, 2026 17:35

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot is still pending after the 8-minute polling window and no Bugbot review comment was posted, so I am not approving without that automated signal. Human review is needed for the migration, backend metrics pipeline, and admin dashboard changes; WcaleNieWolny is already requested and I also requested Dalanir.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from 09f48a1 to 22c3dc0 Compare June 23, 2026 17:38
Comment thread supabase/functions/_backend/triggers/logsnag_insights.ts
Comment thread supabase/functions/_backend/triggers/logsnag_insights.ts Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot finished with a skipped status and no Bugbot review comment was posted, so I am not approving without that automated signal. Human review is still needed for the migration, backend metrics pipeline, and admin dashboard changes; WcaleNieWolny and Dalanir are already requested.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale comment

Risk: medium. Cursor Bugbot finished with a skipped check and reported 2 unresolved findings (including one high-severity metrics timing issue), so I am not approving. WcaleNieWolny and Dalanir are already requested for human review of the migration, backend metrics pipeline, and admin dashboard changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 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/triggers/logsnag_insights.ts`:
- Around line 1351-1392: The snapshot timing issue occurs because
getAppBuildOnboardingMetrics is being called too early in the day (01:01 UTC) to
capture the full 24-hour observation windows for apps created near the end of
the previous day. Find where getAppBuildOnboardingMetrics is invoked in the
snapshot recording workflow and delay the execution until after 23:59 UTC to
ensure all apps created the previous day have completed their full 24-hour build
observation window before the metric is recorded.

In `@supabase/migrations/20260623144909_admin_app_build_onboarding_metrics.sql`:
- Around line 48-52: The two CREATE INDEX statements for idx_apps_created_at and
idx_build_requests_app_created_at are missing the CONCURRENTLY keyword, which
will cause write locks on these tables during the migration. Add the
CONCURRENTLY keyword to both CREATE INDEX IF NOT EXISTS statements so that the
indexes are built without blocking concurrent write operations on the
public.apps and public.build_requests tables.
🪄 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: 037135c6-e2bc-4a1f-87b2-7c4102af84f8

📥 Commits

Reviewing files that changed from the base of the PR and between 09f48a1 and 22c3dc0.

📒 Files selected for processing (15)
  • cli/src/types/supabase.types.ts
  • docs/pr-assets/admin-app-build-onboarding-chart.webp
  • messages/en.json
  • read_replicate/schema_replicate.sql
  • src/pages/admin/dashboard/index.vue
  • src/pages/apps.vue
  • src/types/supabase.types.ts
  • supabase/functions/_backend/public/app/post.ts
  • supabase/functions/_backend/triggers/logsnag_insights.ts
  • supabase/functions/_backend/utils/pg.ts
  • supabase/functions/_backend/utils/postgres_schema.ts
  • supabase/functions/_backend/utils/supabase.types.ts
  • supabase/migrations/20260623144909_admin_app_build_onboarding_metrics.sql
  • tests/admin-stats.test.ts
  • tests/logsnag-insights-revenue.unit.test.ts
🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:

  • Cap-go/capacitor-updater (manual)

Comment thread supabase/functions/_backend/triggers/logsnag_insights.ts
Comment on lines +48 to +52
CREATE INDEX IF NOT EXISTS idx_apps_created_at
ON public.apps (created_at);

CREATE INDEX IF NOT EXISTS idx_build_requests_app_created_at
ON public.build_requests (app_id, created_at);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Use concurrent index creation to avoid deploy-time write blocking.

Line 48 and Line 51 create indexes without CONCURRENTLY. On large tables, this can block writes for the migration duration and degrade API availability. Move these to a dedicated migration that builds indexes concurrently.

Suggested change
-CREATE INDEX IF NOT EXISTS idx_apps_created_at
-ON public.apps (created_at);
-
-CREATE INDEX IF NOT EXISTS idx_build_requests_app_created_at
-ON public.build_requests (app_id, created_at);
+-- Run in a dedicated migration that supports non-transactional statements
+CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_apps_created_at
+ON public.apps (created_at);
+
+CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_build_requests_app_created_at
+ON public.build_requests (app_id, created_at);
🤖 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/migrations/20260623144909_admin_app_build_onboarding_metrics.sql`
around lines 48 - 52, The two CREATE INDEX statements for idx_apps_created_at
and idx_build_requests_app_created_at are missing the CONCURRENTLY keyword,
which will cause write locks on these tables during the migration. Add the
CONCURRENTLY keyword to both CREATE INDEX IF NOT EXISTS statements so that the
indexes are built without blocking concurrent write operations on the
public.apps and public.build_requests tables.

@riderx riderx force-pushed the codex/admin-app-build-onboarding-metrics branch from 22c3dc0 to 3712e7e Compare June 23, 2026 19:54

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 3 potential issues.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3712e7e. Configure here.

}
else {
totals.apps_with_manual_builds_24h += 1
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLI onboarding metrics misclassified

High Severity

The admin “CLI onboarding” series keys off created_from_onboarding, but that flag is only set when apps are created through the web app POST with need_onboarding. CLI build init / addAppInternal inserts apps without need_onboarding, so those apps stay created_from_onboarding: false and land in the manual series instead of CLI onboarding.

Additional Locations (1)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3712e7e. Configure here.

apps_created: finalizedAppBuildOnboardingMetrics.apps_created,
apps_with_cli_onboarding_builds_24h: finalizedAppBuildOnboardingMetrics.apps_with_cli_onboarding_builds_24h,
apps_with_manual_builds_24h: finalizedAppBuildOnboardingMetrics.apps_with_manual_builds_24h,
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Onboarding stats lag chart completion

Medium Severity

Daily onboarding counters for cohort date D are written when the core shard runs for date D+1, but the global_stats row for D can already satisfy completed_shards and appear in the admin trend after the D shard run, so apps_created and build onboarding fields can show as zero until the next day’s core job patches them.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3712e7e. Configure here.

LEFT JOIN public.build_requests br
ON br.app_id = ca.app_id
AND br.created_at >= ca.created_at
AND br.created_at < ca.created_at + INTERVAL '24 hours'

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All build requests counted

Medium Severity

The onboarding cohort SQL counts every build_requests row in the first 24 hours with no status filter, while other global build stats in the same file count only status = 'succeeded', so failed or pending requests can push apps over the “>2 builds” threshold incorrectly.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 3712e7e. Configure here.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Bugbot finished with a skipped check and reported 3 unresolved findings (including high-severity metrics timing and CLI classification issues), so I am not approving. WcaleNieWolny and Dalanir are already requested for human review of the migration, backend metrics pipeline, and admin dashboard changes.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium. Cursor Bugbot finished with a skipped check and reported 3 unresolved findings (including a high-severity onboarding metrics issue), so I am not approving. WcaleNieWolny and Dalanir are already requested for human review.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Approver External

@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant