Repository navigation
refactor(converge): render the goldens through the production printer and probe the terminal once - #2491
Conversation
… and probe the terminal once
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
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. Comment |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
⚙️ Agent run details
|
Review triageReviewers: PR-Agent (openai/mimo-v2.6-flash) reviewed
CI: |
printConvergeReport left with #2491; the BUG-136 summary test now uses the renderConvergeReport helper that replaced it.
…mmary (#2492) * fix(converge): keep what a failed step changed in its line and the summary * fix(converge): say a dry run's failed-step changes were planned The failed-changes note read "(after 2 changes)" under --dry-run too, where nothing changed. Word it from rep.DryRun, like the changed column beside it. * test(converge): render the summary tests through the streaming printer printConvergeReport left with #2491; the BUG-136 summary test now uses the renderConvergeReport helper that replaced it.
Summary
Two Minor findings from CLI-114's independent review (
specs/archive/CLI-114-converge-console-ux/review.md).1. The goldens tested a renderer production no longer called.
printConvergeReporthad no production caller oncerunConvergemoved tonewConvergePrinter+RunObserved+finish, and it took its column width from the report rather than the registry. It is deleted. The tests render throughnewConvergePrinter, with a registry built from the report's names,Donefor each entry, thenfinish. The golden files are unchanged byte for byte: production prints what the old fixture printed. From now on, a change to the production printer reaches them.2. Two terminal probes.
console.IsTerminalBy(w, isTerminal)is the descriptor seam the converge tests need.console.IsTerminalis now that function withterm.IsTerminal, so both share one*os.Filecheck.convergeTerminalis gone.runConvergeprobes once, on the raw writer, and passes the answer toconvergePainter(terminal bool). A caller can no longer hand the tee to one probe and the raw writer to the other.Closes #2487
Verification
16->10.TestConvergeConsole_ColourandTestConvergeConsole_FailureSummaryfail. Before this change they passed, because the deleted fixture had its own16.runConvergeignores its probe (convergePainter(false)).TestConvergeConsole_ARunOnATerminalIsColouredandTestConvergeConsole_AnAppliedRunColoursTheTerminalNotTheTranscriptfail.TestIsTerminal_NeverForANonFile,TestConvergeConsole_ColourOnATerminal, and the transcript test.go build ./...,go vet ./...,GOOS=windows go vet ./...andgo test ./...all pass.golangci-lint runreports 0 issues.SDD skip rationale
A refactor with 37 production LOC across
converge.goandconsole.go. Output is unchanged (the goldens are byte-identical), and it adds no CLI flag, contract or dependency.Knowledge