Fix OCI prune cleanup of broken tag symlinks - #1312
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 33c49e5f81
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
33c49e5 to
beac7ea
Compare
beac7ea to
4626d57
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4626d57bf7
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
@mikemikimike just need to fix the unit test |
|
@mikemikimike test still failing |
df3a16a to
01c822a
Compare
|
Thanks @yzhuang-oai. I addressed both reported I could not run the Swift XCTest suite on this Windows host because Swift/Xcode is unavailable here. Please rerun the macOS CI job to confirm the updated fixtures in the project environment. |
Use the existing OCI garbage collector after deleting a cached image so broken tag symlinks are removed for both prune criteria. Fix the regression fixture to measure the VM directory through its Prunable implementation.\n\nCloses openai#1293\n\nGenerated-by: Codex
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: d6c9bde8ad
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
|
Pushed commit 5238e0a to address the requested cleanup scope. Cached-image pruning now removes only tag symlinks targeting the deleted digest, then runs content-only GC; it no longer invokes full record GC and cannot delete unrelated prune candidates. The Windows environment cannot run the repository's macOS/Xcode test suite locally. The new CI run is currently awaiting fork workflow approval (action_required, no jobs); please approve and run it so the regression tests can execute. |
|
@mikemikimike CI still failing with unit test failures |
|
Fixed the CI regression in commit |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 63ab43a114
ℹ️ About Codex in GitHub
Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".
| fileURLWithPath: destination, | ||
| relativeTo: foundURL.deletingLastPathComponent() | ||
| ).standardizedFileURL | ||
| if destinationURL == standardizedTargetURL { |
There was a problem hiding this comment.
Compare symlink targets without directory URL hints
When pruning a digest record that has a tag, vmDir.delete() removes the target directory before this comparison runs. Constructing destinationURL after that removal produces a file URL without a directory marker, while targetURL came from the directory enumerator and retains its trailing-slash directory hint; Foundation treats those URLs as unequal, so the branch is skipped and the broken tag symlink remains. The new tests do not catch this because fileExists(atPath:) follows a dangling symlink and returns false even when the link itself still exists; compare normalized path strings or otherwise inspect the symlink itself.
Useful? React with 👍 / 👎.
|
Addressed the review feedback in commit |
Related issue
Closes #1293
Background
tart prunecan remove a digest-addressed OCI cache entry while leaving tag symlinks pointing to the deleted directory. The cache then contains broken links until a separate garbage-collection run.Changes
Run
VMStorageOCI.gc()after OCI cache pruning completes. This covers both age-based and space-budget pruning, including invocations that also pass--gc.Compatibility
No CLI or storage format changes. Healthy tag symlinks and local VM pruning are unaffected.
Verification
git diff --check— passedswift test --filter HumanReadableByteCountTests— not run: Swift is not installed in the current Windows environmentThe change is intentionally small and relies on the existing OCI garbage collector.