Skip to content

feat: report installed versions and add an update command - #18

Merged
abruption merged 1 commit into
mainfrom
feat/16-version-and-update
Sep 7, 2026
Merged

abruption merged 1 commit into
mainfrom
feat/16-version-and-update

Conversation

@abruption

Copy link
Copy Markdown
Owner

Summary

Closes #16.

Rolling out 0.3.0 meant running install.sh against four machines by hand, from memory, with nothing to say which were stale. That is exactly the case where being behind matters most — a messaging tool's whole job is the fleet.

$ cc-peer list --host build-server
build-server runs cc-peer 0.2.0; this machine has 0.3.0.
Update it with:  cc-peer update --host build-server

NAME         PID   STATUS  CWD
api-worker   4011  idle    /srv/api

$ cc-peer update --check
cc-peer 0.3.0 — up to date

A mistake worth recording

The first draft read the version out of the run_remote() response. That looks right and is wrong: run_remote ships this file and runs it over there, so the reply always echoes our own version. It surfaced when a host I had deliberately put on 0.4.0-test reported 0.3.0.

The fix asks the machine what it has installed, over SSH, at the path install.sh uses — the copy a session over there will actually run, and the only one that can fall behind. That probe validates its ssh arguments too, since it builds its own command (#6).

Design notes

  • update stages and renames. We are running from the file being replaced, so it writes cc_peer.py.new alongside and moves it into place; a failed download can't leave half a script behind. Permissions are carried over.
  • update --host reports, it does not make the target fetch. Hosts with no route to GitHub are one of the reasons this tool exists, and install.sh --host already pushes over the SSH connection itself. Making the far side reach out would break the air-gapped case the README advertises.
  • A missing or too-old remote install says so plainly rather than looking like a version match.

Type

  • feat
  • fix
  • docs
  • chore / refactor / test / perf

Checklist

  • python3 cc_peer.py list works locally
  • python3 cc_peer.py list --host <a real host> works over SSH
  • --dry-run resolves a target without posting anything
  • Commits follow Conventional Commits
  • Docs updated if behavior changed (README / SKILL.md / CLAUDE.md)
  • No secrets, tokens, or session keys in the diff

Verified against

v2.1.263 — 41/41 tests passing (7 new). Mismatch detection exercised for real by installing 0.4.0-test on the KR host, confirming the warning, then restoring 0.3.0. Backwards compatible: a remote without the probe path reports nothing rather than failing.

Rolling out 0.3.0 meant running install.sh against four machines by hand,
from memory, with nothing to say which were stale. That is the case where
being behind matters most — a messaging tool's whole job is the fleet.

list --host now reports what that machine has installed and flags a
mismatch. It has to ask over SSH rather than read it from the response:
run_remote ships and runs this very file, so the reply would only ever echo
our own version back. That mistake was in the first draft of this change and
showed up as a remote reporting 0.3.0 while actually running 0.4.0-test.

update refreshes this installation from the latest GitHub release, staging
to a temp file and renaming, because we are running from the file being
replaced. update --host reports the remote version instead of making the
target fetch — hosts with no route out are one of the reasons this exists,
and install.sh --host already pushes over the SSH connection itself.
@abruption
abruption merged commit 3965af2 into main Sep 7, 2026
6 checks passed
@abruption
abruption deleted the feat/16-version-and-update branch September 7, 2026 09:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

No way to see which machines are running an old version, or to update in place

1 participant