feat: replace the host updater during managed updates - #103
Merged
Conversation
Stage the GitHub updater binary next to the running daemon while the target image is prepared, then swap it in after the new container is healthy so the next update uses the matching protocol. Installers now prefer the latest release asset instead of copying an old binary from the current container.
After a managed container recreate succeeds, copy or keep the staged host updater, atomically rename the running binary, and exit 0 so systemd or LaunchAgent starts the new process.
Fail the whole update if the host updater cannot replace itself, discard a staged binary on container rollback, stamp Version/Commit into updater assets, let an old updater complete one jump, and offer the three previous stable releases on the System page.
Keep the host-updater self-update notes ready for the next patch release so GitHub Actions does not have to push the freeze to protected main.
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
.new. Release updater assets are stamped with Version/Commit. An old updater can complete one jump, and the System page can roll back to one of the three previous stable releases.v0.2.48in this PR so the release workflow does not need to push the freeze onto protectedmain.Test plan
go test ./internal/api ./internal/updater ./internal/updatenpm run syncmainto publishv0.2.48ghcr.io/caigee-cmd/cli2api:v0.2.48, recreate the container, and reinstall the host updater from the new image