Add git task web subcommand (start/stop/status) - #7
Merged
Conversation
Manages the companion git-task-web server as a detached background process. First `start` installs it via npm if missing (prompts unless --yes), then spawns it with a real setsid detach so it survives the invoking shell exiting — a plain spawn left it in the same session and it died when that session tore down. State (pid/host/port) lives under a new machine-local data dir (~/.local/share/git-task), liveness/stop use libc kill signals.
CI rejects a PR whose Cargo.toml version isn't above the latest release tag.
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
git task web start/stop/statusmanages the companion git-task-web server as a detached background process.startinstalls git-task-web vianpm install --prefix ~/.local/share/git-task/web git-task-web@latestif missing — prompts interactively, or pass--yesfor non-interactive/CI use. Requiresnode/npmon PATH.~/.local/share/git-task/web.state; combined stdout+stderr logged toweb.log.libc::kill, SIGTERM then SIGKILL after 5s) — newlibcdependency.setsid()(viapre_exec) so the server survives the invoking shell exiting — verified this was necessary: a plainCommand::spawn()leaves the child in the same session, and it died when that session tore down.Known limitation
git-task-webisn't published to npm yet, sogit task web startwill currently fail with an ordinary npm 404 until it is. Verified that failure path is clean (proper error, exit 1, no crash).Test plan
cargo build— cleancargo test— all unit + integration tests pass (98 lib tests incl. newweb::processtests, all integration suites)start→ spawns, confirms readiness, prints URL;statuswhile running; duplicatestartcorrectly detects already-running;stopsends SIGTERM and the process actually exits (confirmed viaps);statusafter stop reports not runningps -o pid,ppidthat the spawned server reparents toppid=1and keeps serving (curl200) across separate CLI invocations, seconds apart