fix(installer): make completion summary dry-run aware - #171
Conversation
A TTY `install --dry-run` printed the real-run summary after the preview: "Installation Complete!", "OpenBoot has successfully configured your Mac.", "What was installed: ...", and "Restart your terminal to apply changes", although nothing was changed. showCompletionFromPlan now hands dry-run plans to a separate summary: "Dry run complete — no changes were made" (or "... finished with errors"), "Would install:" with the package counts, and a next step to re-run without --dry-run. It has no Git line, because whether Git would be configured depends on the existing identity, which the Git step already reports. The real-run summary is unchanged and now pinned line for line by a test. recordReporter also records non-header messages so tests can assert what the summary says.
|
@claude please review this PR — focus on correctness, design, test coverage for the branches it adds, risk, and how it rolls back. (The automatic claude-review run posted nothing: 1 permission denial, "No buffered inline comments".) |
|
Claude finished @fullstackjam's task in 1m 1s —— View job Review: fix(installer): make completion summary dry-run aware
CorrectnessThe fix is sound. Design
Test coverageGood coverage of the branches this PR adds:
One small gap: there's no test combining RiskLow. This is purely cosmetic/output-text logic in a single function, gated behind RollbackTrivial — a single revert of this commit removes the new NoteI wasn't able to execute |
What does this PR do?
Makes the post-apply completion summary dry-run aware, so
openboot install --dry-runno longer ends by claiming it installed and configured everything.Why?
On a TTY,
openboot install -p minimal --dry-runruns the wizard, then the linear apply. The apply correctly prints[DRY-RUN MODE - No changes will be made]and[DRY-RUN] Would ...for each step. ButshowCompletionFromPlanignoredplan.DryRun, so the preview ended with:Now
showCompletionFromPlanpasses dry-run plans to a newshowDryRunCompletionFromPlan:If any step fails, the header is
Dry run finished with errors — no changes were made, followed by the sameN step(s) had errorswarning as before.The real-run summary is unchanged: the new code is an early return, and the old body is not edited.
Testing
go vet ./...passesTestShowCompletionFromPlan_DryRunDoesNotClaimChanges(clean and with errors). Written first; it failed before the fix withexpected: "Dry run complete — no changes were made",actual: "Installation Complete!".TestShowCompletionFromPlan_RealRunOutputpins the real-run summary line for line, clean and with errors. It passed both before and after the fix.recordReporter(inapplycontext_abort_test.go) now also records non-header messages inlines, so tests can check what the summary says. The existing completion tests usedNopReporterand only checkedNotPanics.make test-unitpasses (exit 0). archtest re-run uncached: ok.OPENBOOT_DISABLE_AUTOUPDATE=1 go run ./cmd/openboot install -p minimal --dry-run --silent(non-TTY, sameApplyContextpath) prints the new summary shown above.Cross-repo checklist
openboot.dev? No. The landing page's terminal mock (src/routes/+page.svelte) shows the real-run summary, which is unchanged.Notes for reviewer
applyGitConfigskips when an identity already exists ("Already configured"), so "would configure Git" would be false on most machines. The Git step's own output already says which way it goes.!plan.PackagesOnly, even whenSkipGitis set or git was already configured.runUpdateprints "Update Complete!" under--dry-run.