Skip to content

Fix stale install artifact cache pruning#182

Merged
peters merged 1 commit into
mainfrom
issue-181-prune-artifact-cache
Jun 26, 2026
Merged

Fix stale install artifact cache pruning#182
peters merged 1 commit into
mainfrom
issue-181-prune-artifact-cache

Conversation

@peters

@peters peters commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • route successful install/update artifact-cache cleanup through shared core helpers
  • surface retained/pruned artifact counts for setup, GUI install, and update finalize logs
  • add update-manager coverage for latest_full cache retention pruning stale full and delta artifacts

Fixes #181

Tests

  • ./scripts/sync-surge-core-vendor.sh --check
  • ./scripts/check-version-sync.sh
  • cargo fmt --all -- --check
  • RUSTFLAGS="-D warnings" cargo test --workspace
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo clippy --workspace --lib --bins --examples -- -D warnings -D clippy::unwrap_used -D clippy::expect_used
  • cargo clippy --workspace --all-targets --all-features -- -D warnings -W clippy::pedantic
  • dotnet format dotnet/Surge.slnx --verify-no-changes
  • dotnet test dotnet/Surge.slnx --configuration Release

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses stale install/update artifact-cache accumulation by routing post-success artifact-cache pruning through shared surge-core helpers, surfacing prune/retain counts in key install/update paths, and adding regression coverage to ensure latest_full retention prunes stale full/delta artifacts.

Changes:

  • Introduces a shared InstallArtifactCachePruneResult + prune_install_artifact_cache_dir(...) helper in surge-core, and a small helper to resolve retained-artifact sets for a resolved installer package.
  • Updates update finalize, CLI setup, and installer UI install flows to use the shared prune helper and emit prune/retain counts.
  • Adds an UpdateManager test ensuring latest_full retention keeps only the latest full artifact and prunes stale full/delta cache entries.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
crates/surge-installer-ui/src/install.rs Uses shared retained-artifacts helper and reports pruning outcome after install.
crates/surge-core/src/update/manager/finalize.rs Routes artifact-cache pruning through the shared core prune helper and logs structured counts.
crates/surge-core/src/update/manager.rs Adds regression test verifying latest_full cache retention prunes stale artifacts.
crates/surge-core/src/installer_package.rs Adds prune result type + directory prune helper; adds helper for deriving retained artifacts for installer cache pruning.
crates/surge-cli/src/commands/setup.rs Uses shared retained-artifacts helper and reports pruning outcome after successful setup.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread crates/surge-cli/src/commands/setup.rs
Comment thread crates/surge-installer-ui/src/install.rs Outdated
Comment thread crates/surge-core/src/installer_package.rs
@peters peters force-pushed the issue-181-prune-artifact-cache branch from 8b64406 to 3a9fa38 Compare June 26, 2026 13:00
@peters peters requested a review from Copilot June 26, 2026 13:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Comment thread crates/surge-core/src/installer_package.rs Outdated
Comment thread crates/surge-installer-ui/src/install.rs Outdated
Comment thread crates/surge-installer-ui/src/install.rs Outdated
Comment thread crates/surge-cli/src/commands/setup.rs
@peters peters force-pushed the issue-181-prune-artifact-cache branch from 3a9fa38 to f56340d Compare June 26, 2026 13:12
@peters peters requested a review from Copilot June 26, 2026 13:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Comment thread crates/surge-installer-ui/src/install.rs Outdated
Comment thread crates/surge-cli/src/commands/setup.rs Outdated
@peters peters force-pushed the issue-181-prune-artifact-cache branch from f56340d to cd2398b Compare June 26, 2026 13:30
@peters peters requested a review from Copilot June 26, 2026 13:40

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated no new comments.

@peters peters merged commit ef6c572 into main Jun 26, 2026
13 checks passed
@peters peters deleted the issue-181-prune-artifact-cache branch June 26, 2026 13:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prune stale local artifact cache after successful installs and updates

2 participants