fix(installer): separate contributor setup from user install - #95
Conversation
just setup enabled the repository git hooks, so installing stoat rewrote git config core.hooksPath. The hooks move to a new just dev-setup recipe. InstallData created ~/.stoat and copied internal/recipes/*.yaml and *.sh. Bundled recipes moved to internal/recipes/bundled/<name>/ before v0.2.0, so the copy loop matched nothing. The path also ignored STOAT_HOME. Every stoat command already runs config.EnsureRoot, recipes.Install and keys.Ensure, which honour it, so InstallData is deleted. The installer read os.Args[1] alone, so --no-tty in any other position started the interactive UI. parseFlags now rejects an unknown flag, a misplaced flag, and a positional argument with exit code 2. On a host that is not Linux, the installer now names the next command. Signed-off-by: NovusEdge <novusedge0@gmail.com>
|
Warning Review limit reachedNext included review available in 25 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (3)
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Team Run ID: 📒 Files selected for processing (9)
💤 Files with no reviewable changes (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. WalkthroughThe installer now validates command-line flags, supports ChangesInstaller and development setup
Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to The installer now rejects invalid arguments before installation, supports headless mode through parsed flags, and installs only the binary while contributor hook setup is explicitly separated. No concrete merge-blocking risk remains. Sequence Diagram(s)sequenceDiagram
participant CLI
participant parseFlags
participant run
participant installCmd
CLI->>parseFlags: pass installer arguments
parseFlags-->>run: return noTTY or usage error
run->>installCmd: install the built binary
installCmd-->>run: return installation result
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 40.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 10 functions across 6 files. (2 skipped: 2 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
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 |
Signed-off-by: NovusEdge <novusedge0@gmail.com>
The installer carried its own light colours after the presentation pass, so the main TUI kept rendering the dark palette on a light terminal, where every colour fell below WCAG AA. Against #F7F7F7 accent measured 2.70:1, up 2.36:1, warn 2.04:1 and err 3.30:1. The light values move into internal/theme beside the dark ones, and For selects a Palette from the background the terminal reports. The exported vars keep the dark values, so internal/tui compiles unchanged. Down measured 3.41:1 against #1E1E1E and moves from #6C7086 to #868CAA, which is 5.04:1. Dim moves from #7A7A7A to #8B949E for the same reason. A test measures all twelve values, so a later colour edit cannot drop below 4.5:1 unnoticed. Signed-off-by: NovusEdge <novusedge0@gmail.com>
The main TUI drew the dark palette on every terminal. Against #F7F7F7 the six colours measured between 2.04:1 and 4.01:1, all below WCAG AA. #95 added theme.For for the installer and left this UI on the fixed set. Init now requests the background colour and Update applies the matching palette. A terminal that never answers keeps the dark set. The styles stay package-level values: about 150 call sites read them by name, and one program draws with them at a time. Signed-off-by: NovusEdge <novusedge0@gmail.com>
Three defects in the install path, and one message that gave no next step.
Contributor setup sat inside the user install.
just setupdepended onhooks, so installing stoat rewrotegit config core.hooksPath. The hooks moveto a new
just dev-setup. CONTRIBUTING tells contributors to run it once perclone.
InstallDatawas dead and wrong. It created~/.stoat/{recipes,isos,logs}and copied
internal/recipes/*.yamland*.shinto the data root. Bundledrecipes moved to
internal/recipes/bundled/<name>/before v0.2.0, so the copyloop matched nothing:
find internal/recipes -maxdepth 1 -name '*.yaml' -o -maxdepth 1 -name '*.sh'returns zero files. The path also joined~/.stoatdirectly and ignored
STOAT_HOME.Deleting it costs nothing.
internal/cli/cli.go:476runsconfig.EnsureRoot,recipes.Installandkeys.Ensurebefore every subcommand, andinternal/tui/app.go:129does the same for the TUI. Those honourSTOAT_HOME.This also removes the difference between
just installandjust setup: bothnow install a binary, and the binary initialises its own data root.
--no-ttywas positional.cmd/installer/main_linux.goreados.Args[1]alone, so
--no-ttyanywhere else started the interactive UI, and an unknownflag was ignored.
parseFlagsnow rejects an unknown flag, a misplaced flag,and a positional argument with exit code 2, and prints usage.
The non-Linux message names the next command. It previously stated that the
binary builds for diagnostics and that source installation is Linux-only,
without saying what to run.
Checks
go build ./...,go vet ./...,go test ./...andgofmt -l .are clean.just --listshowsdev-setup,setupandsetup-headless.The bad-flag path prints usage and exits 2.
Not in this change
The installer's terminal UI is unchanged here. Its visual pass is separate.
Summary by CodeRabbit
New Features
--no-ttyinstaller flags in any valid command-line position, with clear errors for unknown or misplaced arguments.Bug Fixes
Documentation