Skip to content

fix(installer): separate contributor setup from user install - #95

Merged
NovusEdge merged 3 commits into
mainfrom
fix/setup-split
Sep 6, 2026
Merged

fix(installer): separate contributor setup from user install#95
NovusEdge merged 3 commits into
mainfrom
fix/setup-split

Conversation

@NovusEdge

@NovusEdge NovusEdge commented Sep 6, 2026

Copy link
Copy Markdown
Owner

Three defects in the install path, and one message that gave no next step.

Contributor setup sat inside the user install. just setup depended on
hooks, so installing stoat rewrote git config core.hooksPath. The hooks move
to a new just dev-setup. CONTRIBUTING tells contributors to run it once per
clone.

InstallData was dead and wrong. It created ~/.stoat/{recipes,isos,logs}
and copied internal/recipes/*.yaml and *.sh into the data root. Bundled
recipes moved to internal/recipes/bundled/<name>/ before v0.2.0, so the copy
loop matched nothing: find internal/recipes -maxdepth 1 -name '*.yaml' -o -maxdepth 1 -name '*.sh' returns zero files. The path also joined ~/.stoat
directly and ignored STOAT_HOME.

Deleting it costs nothing. internal/cli/cli.go:476 runs config.EnsureRoot,
recipes.Install and keys.Ensure before every subcommand, and
internal/tui/app.go:129 does the same for the TUI. Those honour STOAT_HOME.
This also removes the difference between just install and just setup: both
now install a binary, and the binary initialises its own data root.

--no-tty was positional. cmd/installer/main_linux.go read os.Args[1]
alone, so --no-tty anywhere else started the interactive UI, and an unknown
flag was ignored. parseFlags now 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 ./... and gofmt -l . are clean.
just --list shows dev-setup, setup and setup-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

    • Added support for --no-tty installer flags in any valid command-line position, with clear errors for unknown or misplaced arguments.
    • Added a dedicated developer setup command for enabling repository hooks.
  • Bug Fixes

    • Improved installer diagnostics on unsupported platforms.
    • Installation now focuses on placing the binary without modifying user configuration directories.
  • Documentation

    • Updated contributor setup instructions and documented the behavior of repository hooks.

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>
@NovusEdge NovusEdge added the bug Something isn't working label Sep 6, 2026
@NovusEdge NovusEdge self-assigned this Sep 6, 2026
@coderabbitai

coderabbitai Bot commented Sep 6, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

Next included review available in 25 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 082b7b02-def8-4f69-b651-a5fbd2c37cee

📥 Commits

Reviewing files that changed from the base of the PR and between bfac590 and d7e572e.

📒 Files selected for processing (3)
  • internal/installer/tui.go
  • internal/theme/theme.go
  • internal/theme/theme_test.go

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 2a91ef04-0947-4507-b86e-671d058e4867

📥 Commits

Reviewing files that changed from the base of the PR and between 2f83308 and bfac590.

📒 Files selected for processing (9)
  • CONTRIBUTING.md
  • cmd/installer/flags.go
  • cmd/installer/flags_test.go
  • cmd/installer/main_linux.go
  • cmd/installer/main_other.go
  • internal/installer/build.go
  • internal/installer/tui.go
  • internal/installer/tui_test.go
  • justfile
💤 Files with no reviewable changes (1)
  • internal/installer/build.go

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


Walkthrough

The installer now validates command-line flags, supports --no-tty in valid positions, and returns usage errors. Installation copies only the binary. Git hook setup moved to just dev-setup, with updated contributor documentation and non-Linux diagnostics.

Changes

Installer and development setup

Layer / File(s) Summary
Installer flag validation
cmd/installer/flags.go, cmd/installer/flags_test.go, cmd/installer/main_linux.go
The installer validates --no-tty, rejects invalid arguments, and returns a usage exit code.
Binary-only installation
cmd/installer/main_linux.go, internal/installer/tui.go, internal/installer/tui_test.go
Installation copies the built binary without creating ~/.stoat data or copying bundled recipes.
Development setup and diagnostics
justfile, CONTRIBUTING.md, cmd/installer/main_other.go
Hook setup moves to just dev-setup. Documentation describes the new setup flow. Non-Linux diagnostics print separate messages.

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

Merge Risk: ⚪ Minimal · up to bfac5

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
Loading

Poem

A rabbit checks the flags with care
No stray arguments hop in there
The binary lands, recipes stay
Hooks wait for dev-setup day
Clean paths guide the build away

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: separating contributor setup from user installation. It is concise, specific, and related to the changeset.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

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 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/setup-split

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.

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>
@NovusEdge
NovusEdge merged commit 47ec90e into main Sep 6, 2026
8 of 9 checks passed
@NovusEdge
NovusEdge deleted the fix/setup-split branch September 6, 2026 13:54
NovusEdge added a commit that referenced this pull request Sep 6, 2026
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant