Fix stale install artifact cache pruning#182
Merged
Merged
Conversation
There was a problem hiding this comment.
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 insurge-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
UpdateManagertest ensuringlatest_fullretention 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.
8b64406 to
3a9fa38
Compare
3a9fa38 to
f56340d
Compare
f56340d to
cd2398b
Compare
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
Fixes #181
Tests