Auto-run rowCount backfill during make dev#95
Conversation
PR tinyfish-io#89 added a denormalized `rowCount` field on the dataset doc plus a one-shot `datasets:backfillRowCounts` migration for existing data. Contributors who pull main and run `make dev` get the new schema via the existing convex-push step, but curated seed datasets never receive writes, so the self-heal in the row mutations never fires for them — those cards keep showing the (capped at 5) preview-length fallback until someone remembers to run the backfill manually. Hooks the migration into `make dev` after convex-push. The mutation is idempotent (re-runs report `patched: 0, alreadyCorrect: N`) so there's no cost to running it every dev start. Uses the same env-var-only invocation shape as seed-public-datasets to avoid the Windows cmd issue where the `|` in the admin key gets parsed as a shell pipe when passed via --admin-key on the command line.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe PR extends the development Makefile with a new Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
Summary
Follow-up to #89. The
rowCountmigration is idempotent but currently has to be run manually — contributors who pulledmainafter #89 still see curated seed datasets capped at "5 rows" on their local dashboards, because seed datasets never receive writes so the self-heal in the row mutations never fires for them.Hooks
npx convex run datasets:backfillRowCountsintomake devright afterconvex-push, so a fresh clone reaches a fully-migrated state with zero manual steps.Uses the env-var-only invocation shape (matching
seed-public-datasets) instead of explicit--admin-keyflags, because the admin key contains a|that gets re-parsed by Windowscmdwhen passed via the CLI.