Repository navigation
feat: report installed versions and add an update command - #18
Merged
Merged
Conversation
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.
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
Closes #16.
Rolling out 0.3.0 meant running
install.shagainst 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.A mistake worth recording
The first draft read the version out of the
run_remote()response. That looks right and is wrong:run_remoteships this file and runs it over there, so the reply always echoes our own version. It surfaced when a host I had deliberately put on0.4.0-testreported0.3.0.The fix asks the machine what it has installed, over SSH, at the path
install.shuses — 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
updatestages and renames. We are running from the file being replaced, so it writescc_peer.py.newalongside and moves it into place; a failed download can't leave half a script behind. Permissions are carried over.update --hostreports, it does not make the target fetch. Hosts with no route to GitHub are one of the reasons this tool exists, andinstall.sh --hostalready pushes over the SSH connection itself. Making the far side reach out would break the air-gapped case the README advertises.Type
Checklist
python3 cc_peer.py listworks locallypython3 cc_peer.py list --host <a real host>works over SSH--dry-runresolves a target without posting anythingVerified against
v2.1.263 — 41/41 tests passing (7 new). Mismatch detection exercised for real by installing
0.4.0-teston the KR host, confirming the warning, then restoring0.3.0. Backwards compatible: a remote without the probe path reports nothing rather than failing.