Repository navigation
feat: clearer runtime vs CLI updates, default checkpoint path, self-update - #10
Merged
Merged
Conversation
…pdate - update: checkpoint defaults to <home>/backups/ (or COSIGNER_BACKUP_DIR); backups/ is the only folder inside an instance that may hold archives - update: shows the plan and asks before stopping Cosigner (--yes without a terminal), prints the restore command afterwards, adds --check (exit 10) and --json - name the component everywhere: runtime update vs cosigner-cli update notices, version prints both (--check, --json) - self-update: cosign-verified, atomic replacement of the CLI binary - runtime needing a newer CLI points at self-update; errors carry hint: lines - backup --out is optional; restore accepts a directory holding backups/ - doctor --json, help environment Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anhthii
self-requested a review
November 10, 2026 10:41
anhthii
approved these changes
Nov 10, 2026
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.
Why
update --backup-outwas mandatory and had to be outside the instance. With--homedefaulting to., a path like./backups/was always rejected.updateonly updates the runtime (container image), but nothing said so: not the help text, not theUpdate available: v1.2.3 → v1.3.0notice, and notversion, which printed only the CLI version. There was also no way to update the CLI apart from rerunninginstall.sh.What changes
Checkpoint location
<home>/backups/pre-update-<from>-to-<to>-<UTC time>.enc.COSIGNER_BACKUP_DIRor--backup-outoverride it.backups/may hold archives. Snapshots only read config, settings,state/andsecrets/, so archives are never captured into later ones. Symlinks are resolved first, so abackups/link intostate/is refused.backup --outis now optional, with the same default.restoreaccepts a target directory that contains onlybackups/.Runtime vs CLI
Runtime update available …(update) andcosigner-cli update available …(self-update).versionprints both components.--checklooks up the newest release of each, and--jsonis available. The first line is unchanged becauseinstall.shparses it.self-updatecommand. It downloads the platform binary and runscosign verify-blobagainst this repo's release workflow for that tag, the same identityinstall.shchecks. It runs even whenCOSIGNER_SKIP_IMAGE_SIGNATURE_VERIFICATION=1is set. Then it smoke-tests thatversionreports the expected tag, and only then renames the binary into place. On a root-owned directory, the error suggests running it withsudo.runtime vX needs a newer cosigner-cliand a hint to runself-update. The existing contract fields cover this, so the runtime repo needs no change.Update flow
updateprints the plan: installed and candidate versions with digests, the verification result, the storage schema, the checkpoint path and the expected downtime.For scripts and agents
--jsononupdate,self-update,versionanddoctor. The JSON goes to stdout and progress goes to stderr.update --checkandself-update --checkexit with status10when an update exists.hint:line naming the next command or variable. Missing-password errors now name the right variable: the recovery password used to reportCOSIGNER_PASSWORD.cosigner-cli help environmentlists everyCOSIGNER_*variable.Without a terminal,
updatenow needs--yes. That's the same convention ascallback remove. Scripts that runupdate --backup-out …unattended must add--yes.Testing
make test(vet + race) passes. New tests are inupdate_test.goandselfupdate_test.go. They cover:backups/--yesbeing required without a terminal--checkexit codes and--jsonoutput--help,version,version --json,update --help, andself-update --checkagainst the real GitHub API.self-update(it needs a published release newer than the binary) and a real runtimeupdateagainst Docker.🤖 Generated with Claude Code