Skip to content

feat(cli): show per-file in-flight status in bucket migrate progress - #216

Merged
designcode merged 1 commit into
mainfrom
feat/cli-migrate-inflight-progress
Jul 28, 2026
Merged

feat(cli): show per-file in-flight status in bucket migrate progress#216
designcode merged 1 commit into
mainfrom
feat/cli-migrate-inflight-progress

Conversation

@designcode

@designcode designcode commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Replace the file/byte percentage bars in buckets migrate progress with a live, per-object in-flight list (name, size, time queued), sorted longest-queued first and capped to fit the terminal (+ N more overflow when the list is large).
  • The gateway performs the migration server-side and exposes no per-object transfer progress, so a percentage computed against total bytes made a single large in-flight file look like a stalled/hung run. Showing each queued object's actual wait time instead reflects what the CLI genuinely knows, and makes it clear the run is working through named files rather than frozen.

Test plan

  • pnpm --filter @tigrisdata/cli exec vitest run test/lib/buckets/migrate.test.ts — 20/20 passing (6 new tests for the display helpers, existing throttle/drain tests untouched)
  • pnpm --filter @tigrisdata/cli test — full CLI suite passing
  • pnpm --filter @tigrisdata/cli exec tsc --noEmit
  • biome check (pre-commit hook)
  • Manual verification against a real bucket with a large in-flight file (not yet run)

No changeset yet — holding off per request while this iterates.


Note

Low Risk
CLI-only progress UX and display helpers; migration scheduling/drain behavior is unchanged aside from more accurate scheduledAt stamping.

Overview
buckets migrate progress no longer shows file/byte percentage bars or a single “migrating …” line. The sticky TTY block now reports files done / failed, confirmed vs in-flight bytes, and a live in-flight list (key, size, queued duration).

In-flight rows are sorted longest-queued first (stable by name), capped by terminal height and MAX_INFLIGHT_ROWS, with + N more when the list is large so cursor-up redraw stays within the screen.

scheduledAt is recorded when each scheduleMigration call resolves (not once per batch), so per-object queued times stay accurate under concurrent scheduling. flushScheduleBatch is exported for tests.

Adds a changeset and vitest coverage for display helpers, overflow edge cases, and per-item timestamps.

Reviewed by Cursor Bugbot for commit a6a23af. Bugbot is set up for automated code reviews on this repo. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 27, 2026

Copy link
Copy Markdown

Greptile Summary

The PR replaces percentage-based bucket-migration progress with a terminal-height-aware list of in-flight objects.

  • Sorts displayed objects by queue age and collapses overflow into a summary row.
  • Shows each visible object's key, size, and queued duration.
  • Adds unit coverage for ordering, row selection, truncation, and formatting.

Confidence Score: 4/5

The inaccurate per-object queue timing and longest-queued ordering should be corrected before merging; display-width handling is also worth hardening.

Every successful object receives its timestamp only after the slowest scheduling request in its batch finishes, so the displayed durations and ordering do not reliably represent when individual objects entered the queue. Wide object names can also wrap despite length-based truncation and desynchronize sticky redraws.

Files Needing Attention: packages/cli/src/lib/buckets/migrate.ts

Important Files Changed

Filename Overview
packages/cli/src/lib/buckets/migrate.ts Adds the per-object progress renderer, but batch-level timestamps make queue durations inaccurate and string-length truncation can desynchronize redraws for wide object names.
packages/cli/test/lib/buckets/migrate.test.ts Adds focused display-helper tests, but does not cover differing completion times within a concurrent scheduling batch or terminal-width behavior for wide Unicode names.

Reviews (1): Last reviewed commit: "feat(cli): show per-file in-flight statu..." | Re-trigger Greptile

Comment thread packages/cli/src/lib/buckets/migrate.ts
Comment thread packages/cli/src/lib/buckets/migrate.ts
Comment thread packages/cli/src/lib/buckets/migrate.ts
@designcode
designcode force-pushed the feat/cli-migrate-inflight-progress branch from b26ba98 to 746b3cb Compare July 27, 2026 10:43

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 746b3cb. Configure here.

Comment thread packages/cli/src/lib/buckets/migrate.ts
@designcode
designcode force-pushed the feat/cli-migrate-inflight-progress branch from 746b3cb to a24422d Compare July 27, 2026 16:47
Replace the file/byte percentage bars with a live list of in-flight
objects (name, size, time queued), sorted longest-queued first and
capped to fit the terminal. The gateway exposes no per-object
transfer progress, so a percentage against total bytes made a large
in-flight file look like a stalled run; showing each queued file's
actual wait time instead reflects what the CLI genuinely knows.

Assisted-by: Opus 4.8 via Claude Code
@designcode
designcode force-pushed the feat/cli-migrate-inflight-progress branch from a24422d to a6a23af Compare July 28, 2026 07:16
@designcode
designcode merged commit 3ace326 into main Jul 28, 2026
2 checks passed
@designcode
designcode deleted the feat/cli-migrate-inflight-progress branch July 28, 2026 10:42
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