Skip to content

feat: add --last-partition flag to branch creation#139

Merged
rmorehig merged 3 commits intomainfrom
fix/135-last-partition-branch
Mar 23, 2026
Merged

feat: add --last-partition flag to branch creation#139
rmorehig merged 3 commits intomainfrom
fix/135-last-partition-branch

Conversation

@gnzjgo
Copy link
Copy Markdown
Member

@gnzjgo gnzjgo commented Mar 23, 2026

Closes #135

Adds --last-partition flag to tinybird build and tinybird dev commands, matching the tb branch create <name> --last-partition behavior from the platform CLI.

When a branch is created with this flag, the last partition of production data is copied into the branch.

Changes

  • src/api/branches.ts: createBranch and getOrCreateBranch accept CreateBranchOptions with lastPartition flag, passed as last_partition=1 query param to POST /v1/environments
  • src/cli/commands/build.ts: BuildCommandOptions passes lastPartition through to getOrCreateBranch
  • src/cli/commands/dev.ts: DevCommandOptions passes lastPartition through to getOrCreateBranch
  • src/cli/index.ts: --last-partition option added to build and dev commands

Usage

tinybird build --last-partition
tinybird dev --last-partition

@gnzjgo gnzjgo requested a review from rmorehig March 23, 2026 18:02
@rmorehig rmorehig merged commit ed46c68 into main Mar 23, 2026
2 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.

CLI branch creation should support --last-partition flag (parity with tb CLI)

2 participants