Skip to content

feat(ingest): --continuous flag on new-datasource (buckets) - #248

Merged
eddietejeda merged 2 commits into
mainfrom
feat/ingest-continuous-flag
Aug 4, 2026
Merged

feat(ingest): --continuous flag on new-datasource (buckets)#248
eddietejeda merged 2 commits into
mainfrom
feat/ingest-continuous-flag

Conversation

@eddietejeda

Copy link
Copy Markdown
Contributor

Lets a user mark a bucket datasource for native continuous sync from the CLI:

hotdata ingest new-datasource --service buckets \
  --bucket-url s3://bucket/prefix --format jsonl --continuous

The worker's scheduler then re-runs it incrementally on a schedule, appending only newly-arrived objects (no full re-read).

  • IngestRequest.continuous — serialized only when true (skip_serializing_if), matching validate_only.
  • --continuous flag on CreateArgs, wired into the flag-driven filesystem builder + the wizard-skip check. Filesystem/buckets only; the server ignores it for other families.
  • Test: the flag rides through to the request body; default-off is omitted from the JSON.
  • Doc note added to the buckets new-datasource section.

Pairs with dlthubworker #167 (continuous on the source spec + the incremental sync engine) and monopoly #1650 (the sync CronJob). Full suite green (305 unit tests).

Marks a bucket datasource for native continuous sync: the worker's scheduler
re-runs it incrementally, appending only newly-arrived objects. Adds
IngestRequest.continuous (serialized only when set) + the --continuous flag,
wired into the flag-driven filesystem builder and the wizard-skip check.
Server ignores it for non-filesystem families.

Test: --continuous rides through to the request body; default off is omitted
from the JSON.
@eddietejeda
eddietejeda requested a review from a team as a code owner August 4, 2026 19:05
@eddietejeda
eddietejeda requested review from zfarrell and removed request for a team August 4, 2026 19:05
Comment thread src/commands/ingest.rs
/// Keep this datasource continuously synced — refreshed incrementally on a
/// schedule, appending only newly-arrived objects (buckets only)
#[arg(long)]
continuous: bool,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the guided wizard has no matching prompt, so continuous is unreachable interactively (not blocking).

build_filesystem_interactive (src/commands/ingest.rs:527) prompts bucket URL / format / glob and leaves continuous at its Default false. On a terminal with no --service, that's the default path, so a user who wants continuous sync has to know to drop out of the wizard and pass the flag — and any_given() now makes --continuous alone hard-fail with "--service is required" rather than hinting the wizard can't do it. A one-line Confirm/select_optional("Keep continuously synced?") in the filesystem builder would close the gap; up to you whether that belongs in this PR.

Comment thread src/commands/ingest.rs
bucket_url: Some(args.bucket_url.ok_or("buckets connectors need --bucket-url")?),
file_glob: args.glob,
file_format: args.format,
continuous: args.continuous,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super nit: --continuous is silently dropped for every other family (not blocking).

hotdata ingest new-datasource --service postgres --continuous exits 0 and reports success with no continuous sync configured, since only the filesystem arm reads the field. That matches how --glob/--bucket-url already behave for SQL, so it's consistent — but "silently on for nothing" is a worse failure mode than an unused path hint, because the user believes sync is enabled. An early if args.continuous && entry.family != "filesystem" { return Err(...) } would make it explicit and is cheap to unit-test alongside the new test.

claude[bot]
claude Bot previously approved these changes Aug 4, 2026
@codecov

codecov Bot commented Aug 4, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 95.65217% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/commands/ingest.rs 95.65% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

@claude claude Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed cycle 2. The only new commit is the cargo fmt fix; the --continuous wiring is unchanged and correct: field is Serialize-only with skip_serializing_if, matching validate_only; any_given() updated so the flag can't be silently swallowed by the wizard; test covers both on and off (including the omitted-from-JSON case). No blocking issues.

The two prior nits (wizard has no continuous prompt; the flag is a no-op for non-filesystem families) remain open but are non-blocking — your call whether to handle here or in a follow-up.

@eddietejeda
eddietejeda merged commit 97db0e0 into main Aug 4, 2026
14 checks passed
@eddietejeda
eddietejeda deleted the feat/ingest-continuous-flag branch August 4, 2026 21:59
@eddietejeda
eddietejeda restored the feat/ingest-continuous-flag branch August 8, 2026 17:16
@eddietejeda
eddietejeda deleted the feat/ingest-continuous-flag branch August 8, 2026 18:05
eddietejeda added a commit that referenced this pull request Aug 8, 2026
* chore: Release hotdata-cli version 0.22.0

* chore: dedupe --continuous changelog line (#248/#249 same change)

---------

Co-authored-by: Eddie A Tejeda <[email protected]>
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