feat: install updates directly from forgeguard update - #66
Merged
Conversation
Switch project configuration from default to strict mode to enforce stricter verification rules and prevent regressions.
Add UpdateCheck model and check_for_update query helper to distinguish between checking version availability and triggering installation. Update spawn_refresh_if_stale to invoke check-only mode so background hook runs do not trigger unintended in-place updates.
Add integration tests verifying structured version checking when releases are newer, up-to-date, or ahead of remote tags.
Execute the installer when a newer release is discovered during forgeguard update, rather than only printing the notice. Introduce the --check flag to preserve check-only behavior for scripts and background watchers.
Update README instructions to document automatic in-place upgrades via forgeguard update and check-only usage with --check.
3 tasks
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
forgeguard updatenow installs a newer release directly instead of only printing a notice.spawn_refresh_if_stale) are pinned to--checkso hooks never trigger an unintended in-place install.UpdateCheckquery so check-only and install paths share one code path.Changes
crates/forgeguard-core):UpdateCheckstruct andcheck_for_update(_for)helpers returning{current, latest, update_available}.refresh_fornow derives its notice from the structured check.spawn_refresh_if_staleinvokesupdate --check(check-only, never installs).run_install_commandgains a Windowspowershellbranch mirroringinstall.ps1.crates/forgeguard-cli):update(no flags): checks the remote, then runs the installer when a newer release exists; reports success/failure with proper exit codes.update --check: check-only, prints availability (plus--jsonoutput withstatus/current/latest).--mode,--global,--jsonbehavior unchanged.UpdateCheckvariants (newer / equal / ahead), cache freshness helper.Test plan
cargo fmt --all -- --checkcargo clippy --workspace --all-targets --all-features -- -D warningscargo test --locked --workspace(172 passed)cargo build --locked --workspace --releasesh tests/install_test.shforgeguard update --check,update --check --json,update,update --jsonon an up-to-date install