Repository navigation
feat(install): set Ovis up on herdr-core where there is no herdr - #2688
Conversation
|
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 30 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. |
|
Review round 1 (omo reviewer + Codex) on ea507df, fixed in bbd6b7c: Fixed
Not changed
Validation after the fixes
|
|
Review round 2 (omo reviewer + Codex) on bbd6b7c: neither reviewer found a HIGH. The cheap MEDIUM/LOW items are fixed in this push:
Left as notes, not changed: the service does not carry the installing shell's Validation at this head: |
|
Review round 3 (omo reviewer) at 868ae08: CLEAR, no HIGH or MEDIUM. Its LOW notes are left as follow-ups rather than another push:
Not reproduced as user-hittable, so no follow-up issue. |
|
Merge note: CodeRabbit was rate-limited for this head; merged on the omo review (CLEAR at 4fcfc7c), Codex Terra (round-1 HIGHs reproduced and fixed; round 2 no HIGH), container verification (hc-only install, systemd autostart/restart/stop) and green required checks. Only docs/guide.md changed on main since this head's CI, and it merges cleanly. |
Summary
On a Linux or macOS PC that has herdr-core (
hc) and no herdr,curl -fsSL https://ovis.sh/install.sh | shused to install herdr's TUI and the herdr plugin anyway, and then stop at "herdr is not running ... Run: herdr". It now sets Ovis up on herdr-core instead:OVIS_RUNTIME(herdr/herdr-core) when set. Otherwise herdr-core when an earlier run installed Ovis on it, or when there is noherdrand an hc answers--versionwithhc <version>. Otherwise herdr, installed when missing, as before. Only--versionis run (any other hc command starts a core), within a 5 s bound. Candidates follow the server's own search:OVIS_HC_BIN, the PATH,~/.local/bin, Homebrew,/usr/local/bin, mise, Nix, cargo, withherdr-corebeforehcin each.--versionmust exit 0.--depth 1, then a localmainbranch at that commit so Settings → Updates accepts the checkout) into~/.local/share/ovis/app.new, built with the same steps asherdr-plugin.toml's Linux/macOS[[build]](preflight,bun install,bun run build; the Rust PTY host is skipped because herdr-core's terminals don't use it), and moved to~/.local/share/ovis/apponly once built. A rerun keeps that checkout. Settings → Updates keeps it current through the managed launcher, as it does for the plugin. I checked the updater's tag fetch, unshallow fetch and ancestry check on a shallow tag clone.~/.config/ovis/env, owner-only, getsOVIS_RUNTIME=herdr-core(replacing any other runtime named inenvor.env). It also gets the hc found, asOVIS_HC_BIN(released servers run only that orhcon the PATH), andHC_SESSION/HC_SOCKETwhen the installer ran with them. The service and the installer's start passHERDR_PLUGIN_CONFIG_DIR/HERDR_PLUGIN_STATE_DIRfor this folder and~/.local/state/ovis, so a herdr plugin's config found later is never read in its place. Where the herdr plugin already runs Ovis,OVIS_RUNTIME=herdr-coreis refused with a pointer to the plugin's own settings.bun <app>/scripts/plugin.ts start, the managed launcher the plugin uses too, so telemetry reportsinstall_method: managed. Its start, stop and status work the same. It is registered as a user service that starts it at login:~/.config/systemd/user/ovis.service(oneshot +RemainAfterExit;ExecStoprunsplugin.ts stop),systemctl --user enable --now. When linger is off, it prints theloginctl enable-lingerhint.sh.ovis.serverLaunchAgent (RunAtLoad,AbandonProcessGroup), loaded withlaunchctl bootstrap.install.ps1keeps herdr. When it finds herdr-core, it says Ovis runs on herdr-core on Linux and macOS only for now.Note on #2667: that PR picks the runtime from facts and offers a Settings switch, and
OVIS_RUNTIMElocks that switch. This installer writesOVIS_RUNTIME=herdr-corebecause today's server only serves herdr-core when it is set. Once #2667 is merged, the env line can be dropped in favor of its detection; I'll follow up if this lands first. No #2667 file is touched here.Validation
ubuntu:24.04container with only hc 0.1.17 (fromreleases.herdr.dev/core/install.sh). main's install.sh installed herdr 0.9.5 and the plugin v0.4.22, and the app was not running.~/.local/share/ovis/app,/api/healthanswers"runtime":"herdr-core", andGET /api/telemetryshowsinstall_method: "managed". A second run says "already installed" and keeps the running server.ovis.serviceenabled andactive (exited)with the server processes in its cgroup.systemctl --user restart ovisbrings it back. After a container restart, Ovis answers again within 2 s.systemctl --user stop ovisends it.scripts/install-herdr-core.test.ts(new, 24 tests): runtime pick, hc probing (another program named hc, a hung one, a failing one, OVIS_HC_BIN, a saved one, cargo), the env file (mode 0600, idempotent, an existing runtime kept, the pre-rename dir), the systemd unit and LaunchAgent with stand-in tools, and the build steps matchingherdr-plugin.toml.sh -n/dash -npass. shellcheck (koalaman/shellcheck:stable) reports only info-level SC2030/SC2031 PATH notes, the same kind as on main.bun run check fast: passed at 868ae08: workflow syntax, generated types/themes fresh, typecheck, build, unit tests (10915 pass, 0 fail, 42 skip). Earlier runs on this busy host failed in unrelated files from /tmp running out of inodes (ENOSPC); those files passed when rerun alone.