Skip to content

v1.3.4

Latest

Choose a tag to compare

@xanojustin xanojustin released this 13 Oct 23:13
· 1 commit to main since this release
223e6c9

What's New

Fast push: send only what changed

On a large workspace, every push used to send the whole tree to the dry-run and then to the import, even for a one-line change. workspace push and sandbox push can now send only the files that changed since the last sync. It's opt-in: with no new flags, no new profile.yaml keys and no sync record, push and pull behave exactly as before. Thanks to Ray Graham (@bwised) for this feature. (#80, from #76)

xano workspace pull --sync-state          # start a sync record from a pull
xano workspace push --fast                # push only files that changed since the last sync
xano workspace push --fast --refresh      # re-compare with the server export first (after UI edits or a teammate's push)
xano sandbox push --fast
  • --fast compares each file's hash with <push dir>/.xano/sync_state.json and pushes only the ones that differ. With no record yet, it downloads the server export once, records the files that already match, and sends the rest.
  • --refresh (with --fast) re-compares against the server export even when a record exists.
  • pull --sync-state writes the record from the pulled files. Once a record exists, later pulls keep it up to date. A --draft pull never writes it.
  • Deletes are never pushed by --fast. It lists files deleted locally since the last sync. --sync --delete still removes them on the server and clears them from the record.
  • Sandbox resets are detected. A token in ~/.xano/sandbox_sync.json (next to your credentials) changes on every sandbox push and is cleared by sandbox reset and sandbox delete. If it doesn't match the directory's record, --fast compares against the sandbox export instead of trusting the record.
  • --fast can't be combined with --sync. It works with --force.
  • The CLI never edits .gitignore. Whether to ignore .xano/ is up to you.

Writeback: keep local files in the server's format

xano workspace push --writeback
xano workspace push --writeback --writeback-diff ./diffs   # also save local and server copies of each rewritten file

After a successful push, --writeback rewrites the pushed files with the server's formatted XanoScript, byte for byte what pull would write. For a push of up to writeback_object_limit documents (default 25), workspace push fetches each object on its own; larger pushes, sandbox pushes, and any failed per-object fetch use the full export instead. A file edited while the push runs is left alone, with a warning.

profile.yaml defaults

fast: true                  # default --fast for workspace/sandbox push
writeback: true             # default --writeback
writeback_object_limit: 25  # per-object writeback limit; 0 always uses the export

When these keys turn a flag on, push prints Using --fast --writeback · profile.yaml. Use --no-fast or --no-writeback to turn one off for a single run.

What the sync record guarantees

A file is skipped only when the server has exactly those bytes:

  • The record stores a hash of the bytes that were actually pushed, after the GUID line is added. A file edited while a push runs is sent again by the next --fast push.
  • With --records, tables that have items are always sent, as they are without --fast. With --env, --fast compares every file with the dry-run, because the record doesn't track environment variables.
  • A --refresh limited by -i/-e updates only the matching entries and keeps the rest.
  • If the record can't be saved, push prints a warning instead of failing a push that already succeeded.