Skip to content

Keep migration progress and completion visible - #834

Merged
flyingrobots merged 4 commits into
mainfrom
fix/migration-progress-report
Jul 29, 2026
Merged

Keep migration progress and completion visible#834
flyingrobots merged 4 commits into
mainfrom
fix/migration-progress-report

Conversation

@flyingrobots

Copy link
Copy Markdown
Member

Closes #833.

Publishes inventory and rewrite progress for every commit, coalesces terminal rendering to a bounded cadence with boundary/final flushing, and leaves an explicit success, authority-change, and recovery report after TUI teardown.

@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@flyingrobots, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 44 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 3b8a92f3-4ac2-4fa6-a340-777fe9428507

📥 Commits

Reviewing files that changed from the base of the PR and between d495338 and e8de3d7.

📒 Files selected for processing (2)
  • scripts/v18-to-v19/V18MigrationProgressCoalescer.ts
  • test/unit/scripts/v18-migration-progress.test.ts
📝 Walkthrough

Walkthrough

The migration now emits progress for every processed commit, coalesces rendering, flushes pending updates on completion or failure, and uses a shared durable report formatter for CLI output and success-state UI.

Changes

Migration visibility

Layer / File(s) Summary
Coalesced progress delivery
scripts/v18-to-v19/V18MigrationProgressCoalescer.ts, scripts/v18-to-v19/V18MigrationProgress.ts, test/unit/scripts/v18-migration-progress.test.ts
Progress updates are coalesced by render interval, flushed on stream changes or explicitly, and validated for timing, ordering, cancellation, and interval arguments.
Per-commit progress publication
scripts/v18-to-v19/V18MigrationPlan.ts, scripts/v18-to-v19/V18WriterChainRewriter.ts, test/unit/scripts/v18-to-v19-scratch.test.ts, test/unit/scripts/v18-to-v19-writer-chain.test.ts
Writer inventory and rewrite loops report every processed commit, with tests asserting per-writer completion sequences.
Completion and durable report wiring
scripts/v18-to-v19/V18MigrationApp.ts, scripts/v18-to-v19/migrate.ts, scripts/v18-to-v19/V18MigrationReport.ts, scripts/v18-to-v19/V18MigrationAppSurface.ts, test/unit/scripts/v18-migration-app.test.ts, test/unit/scripts/v18-migration-cli.test.ts
Application and CLI flows flush progress around terminal outcomes and use a shared formatter for durable status, verification, ref, and recovery details.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Poem

A bunny watched each commit hop by,
While timers kept the screen spry.
Flush on success, flush on fail,
A durable report leaves the trail.
“Migration complete!” the rabbit sings,
With recovery notes and verified things.

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning It has the issue reference, but it omits the required Summary, Test plan, and ADR checks sections. Add the template’s Summary bullets, a Test plan, and the ADR checkboxes, and note any applicable issue or ADR links.
Docstring Coverage ⚠️ Warning Docstring coverage is 6.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the core change: making migration progress and completion visible.
Linked Issues check ✅ Passed The PR satisfies #833 by publishing every commit, coalescing rendering, flushing latest progress, preserving the post-TUI report, and adding tests.
Out of Scope Changes check ✅ Passed The changes stay within the migration reporting and test scope, with no clear unrelated additions.
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 19.0.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v19.0.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 19.0.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v19.0.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/v18-to-v19/V18MigrationApp.ts (1)

57-78: 🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

progress.flush() is unguarded where it can override the real migration outcome. In both files, flush()'s reporter performs external I/O (emit(...) or process.stderr.write(...)) with no error boundary, and it sits inside control flow that also determines/propagates success or failure — the shared fix is to isolate flush() failures from the reported outcome.

  • scripts/v18-to-v19/V18MigrationApp.ts#L57-L78: wrap both progress.flush() calls (Lines 67 and 71) in their own try/catch so a flush failure after a successful runV18ToV19Migration cannot be caught and reported as status: 'failed'.
  • scripts/v18-to-v19/migrate.ts#L79-L87: wrap the finally block's progress.flush() (Line 86) in its own try/catch so a flush failure cannot replace/mask the real migration error thrown from the try.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/v18-to-v19/V18MigrationApp.ts` around lines 57 - 78, Isolate
progress.flush() failures from migration outcomes by wrapping both flush calls
in V18MigrationApp.run (scripts/v18-to-v19/V18MigrationApp.ts, lines 57-78) in
independent try/catch blocks, preserving the success or failure result from
runV18ToV19Migration; also wrap the finally-block flush in
scripts/v18-to-v19/migrate.ts, lines 79-87, so it cannot mask the original
migration error.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@scripts/v18-to-v19/migrate.ts`:
- Around line 79-87: Protect the progress.flush() call in the finally block
surrounding runV18ToV19Migration so a flush failure cannot replace the original
migration error. Catch and handle any flush exception without rethrowing it,
while preserving the existing migration result and error propagation behavior.

---

Outside diff comments:
In `@scripts/v18-to-v19/V18MigrationApp.ts`:
- Around line 57-78: Isolate progress.flush() failures from migration outcomes
by wrapping both flush calls in V18MigrationApp.run
(scripts/v18-to-v19/V18MigrationApp.ts, lines 57-78) in independent try/catch
blocks, preserving the success or failure result from runV18ToV19Migration; also
wrap the finally-block flush in scripts/v18-to-v19/migrate.ts, lines 79-87, so
it cannot mask the original migration error.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 907e821b-b7cc-4b38-b8b6-d015a5bdfe70

📥 Commits

Reviewing files that changed from the base of the PR and between 74deec8 and 91dd532.

📒 Files selected for processing (13)
  • scripts/v18-to-v19/V18MigrationApp.ts
  • scripts/v18-to-v19/V18MigrationAppSurface.ts
  • scripts/v18-to-v19/V18MigrationPlan.ts
  • scripts/v18-to-v19/V18MigrationProgress.ts
  • scripts/v18-to-v19/V18MigrationProgressCoalescer.ts
  • scripts/v18-to-v19/V18MigrationReport.ts
  • scripts/v18-to-v19/V18WriterChainRewriter.ts
  • scripts/v18-to-v19/migrate.ts
  • test/unit/scripts/v18-migration-app.test.ts
  • test/unit/scripts/v18-migration-cli.test.ts
  • test/unit/scripts/v18-migration-progress.test.ts
  • test/unit/scripts/v18-to-v19-scratch.test.ts
  • test/unit/scripts/v18-to-v19-writer-chain.test.ts
💤 Files with no reviewable changes (1)
  • scripts/v18-to-v19/V18MigrationProgress.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (8)
  • GitHub Check: preflight
  • GitHub Check: test-bun
  • GitHub Check: test-deno
  • GitHub Check: coverage-threshold
  • GitHub Check: test-node (22)
  • GitHub Check: type-firewall-lint
  • GitHub Check: type-firewall-generated-sdk
  • GitHub Check: v19 base/head performance
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Do not use direct imports from src/infrastructure/** in src/domain/** or src/ports/**; depend on a port instead.
Do not use direct Node built-ins in src/domain/** or src/ports/**; use a port instead.

Files:

  • scripts/v18-to-v19/V18MigrationAppSurface.ts
  • test/unit/scripts/v18-migration-cli.test.ts
  • scripts/v18-to-v19/V18MigrationReport.ts
  • test/unit/scripts/v18-migration-app.test.ts
  • test/unit/scripts/v18-migration-progress.test.ts
  • scripts/v18-to-v19/V18MigrationPlan.ts
  • scripts/v18-to-v19/V18MigrationApp.ts
  • test/unit/scripts/v18-to-v19-writer-chain.test.ts
  • scripts/v18-to-v19/migrate.ts
  • scripts/v18-to-v19/V18WriterChainRewriter.ts
  • scripts/v18-to-v19/V18MigrationProgressCoalescer.ts
  • test/unit/scripts/v18-to-v19-scratch.test.ts
🪛 ast-grep (0.45.0)
test/unit/scripts/v18-migration-cli.test.ts

[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { spawn } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

🔇 Additional comments (11)
scripts/v18-to-v19/V18MigrationProgressCoalescer.ts (1)

14-91: LGTM!

test/unit/scripts/v18-migration-progress.test.ts (1)

1-90: LGTM!

scripts/v18-to-v19/V18MigrationPlan.ts (1)

23-24: LGTM!

Also applies to: 194-200

scripts/v18-to-v19/V18WriterChainRewriter.ts (1)

1-8: LGTM!

Also applies to: 22-34, 52-58, 68-68, 77-83, 106-121, 131-131, 154-154

test/unit/scripts/v18-to-v19-scratch.test.ts (1)

18-18: LGTM!

Also applies to: 160-196, 225-229

test/unit/scripts/v18-to-v19-writer-chain.test.ts (1)

16-24: LGTM!

Also applies to: 51-74, 114-118

scripts/v18-to-v19/V18MigrationAppSurface.ts (1)

175-189: LGTM!

scripts/v18-to-v19/migrate.ts (1)

19-20: LGTM!

Also applies to: 33-33, 56-59, 88-98, 120-134, 136-184

scripts/v18-to-v19/V18MigrationReport.ts (1)

1-21: LGTM!

test/unit/scripts/v18-migration-app.test.ts (1)

5-5: LGTM!

Also applies to: 30-47, 194-220

test/unit/scripts/v18-migration-cli.test.ts (1)

5-8: LGTM!

Also applies to: 60-94

Comment thread scripts/v18-to-v19/migrate.ts

@coderabbitai coderabbitai 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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
scripts/v18-to-v19/V18MigrationProgressCoalescer.ts (1)

91-95: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Contain reporter failures from scheduled rendering.

At Line 94, a reporter exception escapes the timer callback, potentially terminating the process outside the migration’s error handling. flushBestEffort() only protects terminal flushing.

Proposed fix
       this.#timer = null;
       if (this.#pending !== null) {
-        this.#deliverPending();
+        try {
+          this.#deliverPending();
+        } catch {
+          // Progress rendering must not replace the migration outcome.
+        }
         this.#scheduleWindow();
       }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/v18-to-v19/V18MigrationProgressCoalescer.ts` around lines 91 - 95,
Update the scheduled callback in V18MigrationProgressCoalescer’s timer flow to
catch and contain exceptions from `#deliverPending`, routing failures through the
migration’s existing error-handling mechanism instead of allowing them to escape
the timer. Keep `#scheduleWindow` behavior intact and preserve flushBestEffort’s
separate terminal-flush protection.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@scripts/v18-to-v19/V18MigrationProgressCoalescer.ts`:
- Around line 91-95: Update the scheduled callback in
V18MigrationProgressCoalescer’s timer flow to catch and contain exceptions from
`#deliverPending`, routing failures through the migration’s existing
error-handling mechanism instead of allowing them to escape the timer. Keep
`#scheduleWindow` behavior intact and preserve flushBestEffort’s separate
terminal-flush protection.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: e8bd3571-9519-438b-b3bb-0057c554b85b

📥 Commits

Reviewing files that changed from the base of the PR and between 91dd532 and d495338.

📒 Files selected for processing (4)
  • scripts/v18-to-v19/V18MigrationApp.ts
  • scripts/v18-to-v19/V18MigrationProgressCoalescer.ts
  • scripts/v18-to-v19/migrate.ts
  • test/unit/scripts/v18-migration-progress.test.ts
📜 Review details
⏰ Context from checks skipped due to timeout. (11)
  • GitHub Check: coverage-threshold
  • GitHub Check: test-node (22)
  • GitHub Check: test-deno
  • GitHub Check: type-firewall-lint
  • GitHub Check: typecheck-test-advisory
  • GitHub Check: test-bun
  • GitHub Check: type-firewall-generated-sdk
  • GitHub Check: type-firewall-semgrep
  • GitHub Check: type-firewall-types
  • GitHub Check: v19 base/head performance
  • GitHub Check: preflight
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{ts,tsx,js,jsx}: Do not use direct imports from src/infrastructure/** in src/domain/** or src/ports/**; depend on a port instead.
Do not use direct Node built-ins in src/domain/** or src/ports/**; use a port instead.

Files:

  • test/unit/scripts/v18-migration-progress.test.ts
  • scripts/v18-to-v19/V18MigrationProgressCoalescer.ts
  • scripts/v18-to-v19/V18MigrationApp.ts
  • scripts/v18-to-v19/migrate.ts
🔇 Additional comments (4)
scripts/v18-to-v19/V18MigrationProgressCoalescer.ts (1)

54-60: LGTM!

test/unit/scripts/v18-migration-progress.test.ts (1)

11-23: LGTM!

Also applies to: 38-53, 55-90

scripts/v18-to-v19/V18MigrationApp.ts (1)

54-71: LGTM!

scripts/v18-to-v19/migrate.ts (1)

56-97: LGTM!

coderabbitai[bot]
coderabbitai Bot previously approved these changes Jul 29, 2026
@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 19.0.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v19.0.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@github-actions

Copy link
Copy Markdown

Release Preflight

  • package version: 19.0.1
  • prerelease: false
  • npm dist-tag on release: latest
  • npm pack dry-run: passed
  • jsr publish dry-run: passed

If this PR is from a release/* branch and merges to main, Main Push Release Branch Check will run final preflight and create v19.0.1. A maintainer who is a JSR @git-stunts scope member must then dispatch the Release workflow manually.

@flyingrobots
flyingrobots merged commit 8b324a3 into main Jul 29, 2026
19 checks passed
@flyingrobots
flyingrobots deleted the fix/migration-progress-report branch July 29, 2026 22:57
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.

Keep migration progress and completion visible

1 participant