Skip to content

pass in "oneBatchOnly" explicitly to the migration function so running from the CLI is always explicit if it wants to start /continue vs. do one batch#49

Merged
ianmacartney merged 1 commit into
mainfrom
ian/safer-direct-call
Apr 22, 2026
Merged

pass in "oneBatchOnly" explicitly to the migration function so running from the CLI is always explicit if it wants to start /continue vs. do one batch#49
ianmacartney merged 1 commit into
mainfrom
ian/safer-direct-call

Conversation

@ianmacartney
Copy link
Copy Markdown
Member

@ianmacartney ianmacartney commented Apr 21, 2026

Summary by CodeRabbit

Release Notes

  • Bug Fixes
    • Improved migration execution behavior to process one batch per direct invocation, ensuring more predictable batch handling and cursor progression during migration runs.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 21, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 93901a99-737d-4132-8cf8-59a268a48e7c

📥 Commits

Reviewing files that changed from the base of the PR and between e233964 and 06647e1.

📒 Files selected for processing (3)
  • src/client/index.ts
  • src/component/lib.ts
  • src/shared.ts

📝 Walkthrough

Walkthrough

A new oneBatchOnly parameter is introduced to control migration batch execution. The parameter is defined in the shared validator, integrated into component migration calls with true as the default, and refactored in the client invocation logic to simplify the direct CLI/dashboard detection condition.

Changes

Cohort / File(s) Summary
Shared Type Definition
src/shared.ts
Added new optional oneBatchOnly boolean field to the migrationArgs validator, extending the exported MigrationArgs type.
Client Invocation Logic
src/client/index.ts
Refactored direct CLI/dashboard invocation detection to be controlled solely by args.oneBatchOnly, replacing previous multi-condition check with simpler conditional logic.
Component Integration
src/component/lib.ts
Added oneBatchOnly: true to migration function arguments, limiting execution to a single batch per scheduled invocation.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • reeceyang

Poem

🐰 A batch at a time, so tidy and neat,
With oneBatchOnly, migrations complete!
No more tangled conditions, just one switch to see,
Scheduled runs hop along, batch by batch, wheee!

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ian/safer-direct-call

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.

Copy link
Copy Markdown
Member Author

ianmacartney commented Apr 21, 2026

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Apr 21, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@convex-dev/migrations@49

commit: 06647e1

Copy link
Copy Markdown
Member Author

ianmacartney commented Apr 22, 2026

Merge activity

  • Apr 22, 4:42 AM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Apr 22, 4:43 AM UTC: Graphite rebased this pull request as part of a merge.
  • Apr 22, 4:44 AM UTC: @ianmacartney merged this pull request with Graphite.

@ianmacartney ianmacartney changed the base branch from ian/call-directly to graphite-base/49 April 22, 2026 04:42
@ianmacartney ianmacartney changed the base branch from graphite-base/49 to main April 22, 2026 04:43
…g from the CLI is always explicit if it wants to start /continue vs. do one batch
@ianmacartney ianmacartney force-pushed the ian/safer-direct-call branch from e03ced6 to 06647e1 Compare April 22, 2026 04:43
@ianmacartney ianmacartney merged commit 26b765f into main Apr 22, 2026
2 of 4 checks passed
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