Add status subcommand: read-only deployment view across hosts - #30
Merged
Conversation
Signed-off-by: JF Ding <jfding@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Create src/status_probe.sh with TSV-per-finding output, dotted-repo longest-prefix matching, and flag collection. Expose it via STATUS_PROBE_SCRIPT in src/status.rs using include_str!. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Stale .to-be-removed dirs can carry .stopping/.skipping (check-push.sh:648-657); previously hardcoded flags='-' silently dropped them. - Add 'local f' to collect_flags loop. - Document probe exit code semantics in header comment.
The sequential stdout-then-stderr read in ssh_run_capture risks deadlock if remote stderr fills the 64 KiB pipe buffer before stdout EOFs. wait_with_output drains both pipes concurrently via internal threads.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
… skew - Add direct tests for cmp_version_tags_desc (basic, Q-notation, missing segments) - Add tests for host_filter_matches (empty patterns, union semantics) - Add test for format_relative_time future-mtime case - Remove dead Debug derive on private HostOutcome enum - Comment intent for clock-skew saturation in format_relative_time
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Adds
git-supervisor status— a read-only subcommand that SSHes each configured host in parallel and prints a grouped per-host/per-repo view of deployed branches, releases, theprod.latestsymlink target, stale dirs, and user dot-flag files. Read-only: no fetch, no clone, no docker actions.Example output:
What's in this branch
Status(StatusArgs)insrc/main.rs, with--host PATTERN(repeatable, glob*/?, union semantics; zero matches exits non-zero).src/status_probe.sh(~120 lines bash) embedded viainclude_str!. Uses the sameDIR_BASEenv contract ascheck-push.sh. Longest-prefix matching against\$DIR_REPOScorrectly handles dotted repo names likemy.api. Distinguishes missing\$DIR_COPIES(legitimate empty, exit 0) from unreadable (stderr + exit 1).src/status.rs: grouped hierarchical layout, branches sorted alphabetically, releases sorted version-desc via a Rust port ofcheck-push.sh'ssort_version_tags_desc(handlesvX.Y.ZandvYYYYQN.X.YQ-notation). Adaptive relative time (just now/Nm/Nh/Nd ago/YYYY-MM-DDafter 7d). 7-char SHA truncation. Color rules for.debugging/.stopping(red),.skipping(grey), stale section (yellow), latest annotation (green/yellow/red by health).std::thread::scope, mirroringrun_cycle. Output buffered and sorted by host ID for deterministic rendering.src/ssh.rs: extractedbuild_ssh_commandshared byssh_run/ssh_run_with_stdin/ newssh_run_capture.ssh_run_capturepipes all three streams and useswait_with_outputto drain stdout+stderr concurrently (avoids a deadlock latent in the naive sequential-read pattern).ERROR(red) or(no deployments yet)(grey) — never silently dropped.Test plan
src/status.rs(parser + helpers: time format, glob, version sort, group, repo header)src/ssh.rs(incl.ssh_run_capturestdout + stderr+exit-code propagation)src/main.rs(CLI parser for--hostflag)tests/integration_status.rsagainst localhost (happy path, dotted repomy.api,--hostzero-match)Design plan
The design was iterated through a structured interview before implementation (see `docs/superpowers/plans/2026-05-20-01-status-subcommand.md` for the full rationale on each decision: output format, layout, sort order, repo-name parsing, concurrency, SSH helper architecture, exit code semantics, time format, probe robustness, env-var contract, filter flags, renderer specifics, and test tiers).
🤖 Generated with Claude Code