Auto-run rowCount backfill during make dev#95
Conversation
|
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)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughAdds a new phony Makefile target Sequence Diagram(s)sequenceDiagram
participant Developer
participant Makefile
participant with_root_env_mjs as with-root-env.mjs
participant Convex
Developer->>Makefile: run `make dev`
Makefile->>Makefile: run `convex-push`
Makefile->>with_root_env_mjs: invoke `backfill-row-counts`
with_root_env_mjs->>Convex: `npx convex run datasets:backfillRowCounts` (supplies CONVEX_SELF_HOSTED_ADMIN_KEY)
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 |
giaphutran12
left a comment
There was a problem hiding this comment.
Holding for launch safety. This branch is merge-conflicting and stale against latest main. The intended Makefile change is small, but the branch needs to be rebased or merged with current main so the diff does not conflict with the newer dev setup changes, then checks need to rerun.
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.
fbe4964 to
a796bab
Compare
|
Rebased onto current Resolution:
Verification:
Single commit, force-pushed with |
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.