Repository navigation
Follow-ups: optimize help + goldens, harden purge/installer non-TTY exit - #7
Merged
Merged
Conversation
`mu optimize` runs 13 steps (src/optimize.rs::all_steps) but --help still described the original 3 and listed only 3 --skip values. Help now names each step id with its implementation description in run order, and --skip documents the full id set. Both optimize goldens were re-captured from the built binary (stdout, stderr, exit code; stdin </dev/null). The dry-run capture uses an empty HOME so the sqlite step renders its static `<db_path>` placeholder instead of freezing this host's Chrome database paths.
… without --yes Citing principle-test-behavior-not-implementation: assert observable process exit code (1) and stderr message when stdin is non-interactive and --yes is omitted, plus exit code (0) for --dry-run on the same fixture.
…ore scanning Citing principle-fix-root-causes: check stdin TTY status before running scan roots or attempting deletions when neither --yes nor --dry-run is present. Emit clear guidance to stderr and exit 1 matching uninstall. Preserve exit 0 for TTY cancel, empty selection, and --dry-run. Update test fixtures and add real run() test cases for purge and installer.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two approved follow-ups from the B3 triage, no behaviour change beyond them.
mu optimize --help+ goldens (ecb71dd) — the help advertised the original 3 steps while the binary runs 13. It now lists all 13 (apt, journal, caches, dns, packages, systemd, flatpak, sqlite, state, autostart, services, permissions, disk-health) with their real descriptions, and--skipdocuments the real id set.tests/golden/help-optimize.txtandtests/golden/optimize-dry-run.txtwere regenerated from the binary (the old dry-run golden was a pre-cutover Go capture; the binary has always printed[dry-run] <dry_run_cmd>, whichsrc/optimize.rs:1583already pinned). Goldens were captured with an emptyHOMEbecause thesqlitestep enumerates$HOMEbrowser DBs — that yields the documented<db_path>placeholder, so the fixture is host-independent; two independent captures diffed identical.mu purge/mu installernon-interactive exit (eb75afc, plus failing-repro commit7f763d4) — without--yes, a non-TTY run used to print "Non-interactive…" to stdout and exit 0 after a full scan. The gate now runs before scan-root resolution and scanning, writes the message to stderr, and exits 1 — the same contractmu uninstallalready follows. A TTY cancel still exits 0 with "Cancelled. Nothing was deleted.", and--dry-runstill exits 0.Verification (re-run on the merged tip
4192683by the Lead)make test→ 517 unit + 63 integration, 0 failedmake lint(cargo clippy --all-targets -- -D warnings) → cleancargo fmt --check→ cleangit diff --stat origin/main -- tests/golden→ only the two approved optimize goldensmu purge --paths=<tmp> </dev/null→ exit 1 + stderr message; same formu installer; both--dry-run→ exit 0; fixture files intact afterwardsmu optimize --helpandmu optimize --dry-run(emptyHOME) diff byte-identical against the new goldensNotes
runs/sude-nonexit.md(both*_aborts_without_auto_yestests moved fromcode == 0to1); no guard test was deleted.--yesdeletion test) and the walker-performance work.No merge performed — leaving that to the owner.
from therealTINHTUTE with love ❤️❤️❤️