Skip to content

Update sync to have --force instead of --fresh and include the input path in the idempotency key#272

Merged
Ankur Goyal (ankrgyl) merged 2 commits into
mainfrom
sync-bug
Jul 15, 2026
Merged

Update sync to have --force instead of --fresh and include the input path in the idempotency key#272
Ankur Goyal (ankrgyl) merged 2 commits into
mainfrom
sync-bug

Conversation

@ankrgyl

Copy link
Copy Markdown
Contributor

bt sync push would sometimes say "i already sync'd this", but it hadn't.

@github-actions

github-actions Bot commented Jul 15, 2026

Copy link
Copy Markdown
Contributor

Latest downloadable build artifacts for this PR commit 532019e962e4:

Available artifact names
  • artifacts-build-global
  • artifacts-build-local-x86_64-apple-darwin
  • artifacts-build-local-x86_64-pc-windows-msvc
  • artifacts-build-local-aarch64-pc-windows-msvc
  • artifacts-build-local-x86_64-unknown-linux-musl
  • artifacts-build-local-aarch64-apple-darwin
  • artifacts-build-local-x86_64-unknown-linux-gnu
  • artifacts-build-local-aarch64-unknown-linux-gnu
  • artifacts-plan-dist-manifest
  • cargo-dist-cache

Comment thread src/sync.rs Outdated
@viadezo1er

Copy link
Copy Markdown
Contributor

I think there are some other issues introduced give me a sec

@viadezo1er

Copy link
Copy Markdown
Contributor

demo.sh:

OLD=/Users/cedric@braintrustdata.com/.local/bin/bt
NEW=/Users/cedric@braintrustdata.com/repos/bt-sync-bug/target/debug/bt
printf '{"input":{"q":"v1"},"expected":"1"}\n' >data.jsonl
$OLD sync push dataset:sync-demo4 --project aaa --org ced-test-1 --profile ced-test-1 --no-input --in data.jsonl --root ./bt-sync
$NEW sync push dataset:sync-demo4 --project aaa --org ced-test-1 --profile ced-test-1 --no-input --in data.jsonl --root ./bt-sync
❯ sh demo.sh
Dataset 'sync-demo4' not found; created new dataset 'sync-demo4' (798e507d-a6ff-4111-ad0d-b1e18cab77ef) in project 'aaa'.
  Ctrl+C safely checkpoints; rerun same command to resume (--fresh restarts).
Push complete
  URL: https://www.braintrust.dev/app/ced-test-1/p/aaa/datasets/sync-demo4
  Input: data.jsonl
  Time: 00:01
  Traces: 1
  Spans: 1
  Batches: 1
  Data: 295.00 B (295 bytes)
  Rates: 1.00 traces/s | 1.00 spans/s | 295.00 B/s
  Ctrl+C safely checkpoints; rerun same command to resume (--force restarts).
Push complete
  URL: https://www.braintrust.dev/app/ced-test-1/p/aaa/datasets/sync-demo4
  Input: data.jsonl
  Time: 00:01
  Traces: 1
  Spans: 1
  Batches: 1
  Data: 295.00 B (295 bytes)
  Rates: 1.00 traces/s | 1.00 spans/s | 295.00 B/s

Adding input_path to the spec makes the hash different, which means customers who have already pushed a dataset, update bt then push the dataset again will push the entire dataset again even if it's unchanged.

Maybe not worth adding code for compatibility but I'd like a confirmation it's ok.

@viadezo1er

Copy link
Copy Markdown
Contributor

The bug I found existed before this pr, so it doesn't block it.

@ankrgyl Ankur Goyal (ankrgyl) merged commit 7e74f26 into main Jul 15, 2026
32 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.

3 participants