Merged
Conversation
Co-authored-by: 403-html <57900160+403-html@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add way of updating script via nillsec upgrade
Add Mar 17, 2026
nillsec upgrade command for self-updating
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a nillsec upgrade command that enables self-updating the binary by checking GitHub Releases for the latest version, comparing semver, and atomically replacing the running executable.
Changes:
- New
upgrade.gowith full upgrade logic: GitHub API fetch, semver comparison, tar.gz extraction, and atomic binary replacement - New
upgrade_test.gowith 7 tests covering version parsing, asset naming, dev skip, up-to-date check, major version prompt (cancel/confirm), and minor version upgrade main.goupdated to wire theupgradesubcommand into the command router and usage text
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| upgrade.go | New file implementing the self-update command: fetches latest release, compares versions, downloads platform-specific asset, extracts and atomically replaces binary |
| upgrade_test.go | New file with comprehensive tests using httptest servers and injectable globals |
| main.go | Registers upgrade subcommand in the router and adds it to usage/doc strings |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: 403-html <57900160+403-html@users.noreply.github.com>
Copilot
AI
changed the title
Add
Add Mar 17, 2026
nillsec upgrade command for self-updatingnillsec upgrade self-update command
…alize version prefix in comparison Co-authored-by: 403-html <57900160+403-html@users.noreply.github.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.
### Upgrade to the latest releasesection to READMEparseMajorVersionto preserve original input in error message (useorigbefore mutation)vprefix when comparing current vs latest version to avoid false "update available" when versions differ only by prefix✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.