Skip to content

feat: install updates directly from forgeguard update - #66

Merged
mulhamna merged 5 commits into
mainfrom
feat/update-command-installer
Aug 29, 2026
Merged

feat: install updates directly from forgeguard update#66
mulhamna merged 5 commits into
mainfrom
feat/update-command-installer

Conversation

@mulhamna

Copy link
Copy Markdown
Member

Summary

  • forgeguard update now installs a newer release directly instead of only printing a notice.
  • Background refreshes (spawn_refresh_if_stale) are pinned to --check so hooks never trigger an unintended in-place install.
  • Adds a structured UpdateCheck query so check-only and install paths share one code path.

Changes

  • core (crates/forgeguard-core):
    • New UpdateCheck struct and check_for_update(_for) helpers returning {current, latest, update_available}.
    • refresh_for now derives its notice from the structured check.
    • spawn_refresh_if_stale invokes update --check (check-only, never installs).
    • run_install_command gains a Windows powershell branch mirroring install.ps1.
  • cli (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 --json output with status/current/latest).
    • --mode, --global, --json behavior unchanged.
  • tests: unit tests for UpdateCheck variants (newer / equal / ahead), cache freshness helper.
  • docs: README "Updating" section rewritten for the new behavior.

Test plan

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo test --locked --workspace (172 passed)
  • cargo build --locked --workspace --release
  • sh tests/install_test.sh
  • Manual smoke: forgeguard update --check, update --check --json, update, update --json on an up-to-date install

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.
@mulhamna
mulhamna requested a review from a team August 29, 2026 17:24
@suiflex-bot suiflex-bot Bot added maintainer commit: chore commit: feat commit: test commit: docs area: cli ForgeGuard CLI crate (crates/forgeguard-cli) area: core Core engine crate (crates/forgeguard-core) area: docs Documentation (README, docs/, markdown files) and removed maintainer commit: chore commit: feat commit: test commit: docs labels Aug 29, 2026
@mulhamna mulhamna closed this Aug 29, 2026
@mulhamna mulhamna reopened this Aug 29, 2026
@mulhamna
mulhamna merged commit a246210 into main Aug 29, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: cli ForgeGuard CLI crate (crates/forgeguard-cli) area: core Core engine crate (crates/forgeguard-core) area: docs Documentation (README, docs/, markdown files) commit: chore commit: docs commit: feat commit: test maintainer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant