Skip to content

feat(cli): add supabase notebooks push - #6599

Draft
SaxonF wants to merge 1 commit into
notebooks/04-cli-notebooks-pullfrom
notebooks/05-cli-notebooks-push
Draft

SaxonF wants to merge 1 commit into
notebooks/04-cli-notebooks-pullfrom
notebooks/05-cli-notebooks-push

Conversation

@SaxonF

@SaxonF SaxonF commented Sep 14, 2026

Copy link
Copy Markdown

Adds supabase notebooks push, the mirror of notebooks pull from the previous PR in this stack. Every file in supabase/notebooks/ is written to the project notebook of that name, or to a new one when the project has none.

supabase notebooks push                 # push the whole directory
supabase notebooks push <name>          # push one notebook

Behavior worth reviewing

  • Read everything before writing anything. All selected files are read and decoded before the first upload, so a directory holding one unreadable notebook fails without having half-pushed the rest.
  • Absent keys stay absent. Keys a file leaves out are omitted from the request rather than sent as explicit nulls, which is how favorite keeps whatever the dashboard set on a notebook whose file never mentions it. schema_version is server-owned and dropped on pull, so it never round-trips back.
  • Cell identities survive. Cell ids written out on pull are echoed on push, so a cell keeps its identity across an update instead of being replaced by a copy.
  • Reconciliation points the other way. Project notebooks naming no local file get the same three answers pull offers, mirrored: leave them, write them into the directory, or delete them from the project. Passing a notebook name pushes just that one and reconciles nothing.
  • The copy-and-delete plan is resolved and validated before the first upload, so a push cannot half-apply a reconciliation choice.

Reviewer notes

Beyond push/, the diff re-exports deleteRemoteNotebook and NotebookNotFoundError (used only by push) and extends the shared regression suite in notebooks.integration.test.ts to run over both commands — the previous PR ran it over pull alone. The added round-trip test pulls a notebook with chart and log cells and pushes it back, asserting the request body matches what came down.

push/SIDE_EFFECTS.md records the side-effect surface.

@SaxonF
SaxonF added this pull request to stack #6600 September 14, 2026 11:20
@SaxonF
SaxonF force-pushed the notebooks/05-cli-notebooks-push branch from 5c43e24 to 831d7fd Compare September 15, 2026 00:12
Adds `supabase notebooks push`, the mirror of `notebooks pull`: every
file in `supabase/notebooks/` is written to the project notebook of that
name, or to a new one when the project has none.

Every file is read and decoded before the first upload, so a directory
holding one unreadable notebook fails without having half-pushed the
rest. Keys a file leaves out stay out of the request rather than going up
as explicit nulls, which is how `favorite` keeps whatever the dashboard
set on a notebook whose file never mentions it.

Project notebooks naming no local file are the divergence this command
asks about, the same three answers `pull` offers pointing the other way.
Passing a notebook name pushes just that one and reconciles nothing.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@SaxonF
SaxonF force-pushed the notebooks/05-cli-notebooks-push branch from 831d7fd to 5295d34 Compare September 15, 2026 00:29
@SaxonF
SaxonF removed this pull request from stack #6600 September 15, 2026 00:30
@SaxonF
SaxonF added this pull request to stack #6612 September 15, 2026 00:31
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