Skip to content

Auto-run rowCount backfill during make dev#95

Open
urugondavishnu wants to merge 1 commit into
tinyfish-io:mainfrom
urugondavishnu:auto-backfill-row-counts-in-dev
Open

Auto-run rowCount backfill during make dev#95
urugondavishnu wants to merge 1 commit into
tinyfish-io:mainfrom
urugondavishnu:auto-backfill-row-counts-in-dev

Conversation

@urugondavishnu
Copy link
Copy Markdown
Contributor

Summary

Follow-up to #89. The rowCount migration is idempotent but currently has to be run manually — contributors who pulled main after #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:backfillRowCounts into make dev right after convex-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-key flags, because the admin key contains a | that gets re-parsed by Windows cmd when passed via the CLI.

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.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 26, 2026

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 929b6b93-5c7f-4d71-9198-c76ff6b1968f

📥 Commits

Reviewing files that changed from the base of the PR and between 0a86186 and fbe4964.

📒 Files selected for processing (1)
  • makefiles/Makefile

📝 Walkthrough

Walkthrough

The PR extends the development Makefile with a new backfill-row-counts target that automates population of rowCount fields on dataset documents. The target validates the presence of a .env file, then invokes the Convex function datasets:backfillRowCounts via with-root-env.mjs. This target is marked as phony in the .PHONY declaration and integrated into the dev target sequence to run automatically after Convex changes are pushed.

Possibly related PRs

  • tinyfish-io/bigset#89: Introduces the backfillRowCounts internal mutation that populates the denormalized datasets.rowCount field used for reactive dashboard counts.

Suggested reviewers

  • simantak-dabhade
🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title directly describes the main change: automatically running the rowCount backfill during the make dev process.
Description check ✅ Passed The description is directly related to the changeset, explaining the context (follow-up to #89), the purpose (auto-run backfill), and implementation details (env-var invocation for Windows compatibility).
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

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

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant