Repository navigation
Conversation
…then-delete markForRemoval uses fs.renameSync so the directory vanishes in the same execution frame — no event-loop yield between call and rename completing. removePendingDir and scanPendingRemovals are async (background cleanup).
FrameworkCache now delegates its inline rename-then-delete and stale-dir scan logic to these helpers. Zero behavior change. Prepares the abstraction for reuse in build-cache older-version cleanup.
Introduces parseCacheVersion and compareCacheVersion utilities for classifying versioned build-cache directories (^v(major)_(minor)$) relative to CACHE_VERSION. Numeric comparison handles v0_9 < v0_10 < v2_15 correctly. Regex rejects leading zeros. These helpers will be used in CacheManager to partition build-cache sibling dirs into removable (≤ current version) and newer-warning categories.
Adds two static methods that enumerate and remove build-cache version
directories older than CACHE_VERSION:
- getOlderVersionsInfo(ui5DataDir): partitions sibling buildCache/ dirs
into removable (< current) and newer (> current, warn-only). Size via
O(1) fs.stat — never opens incompatible older schemas. Each removable
entry carries {name, path, size} so callers don't need to re-parse the
display path.
- cleanOlderVersions(ui5DataDir): atomically renames then removes older
dirs via the interruptibleRemoval helper. Resumes leftover
_buildcache_to_delete_* dirs from interrupted prior runs silently
(original version name is not recoverable from the renamed dir).
Per-dir errors are swallowed.
d3xter666
marked this pull request as draft
November 10, 2026 11:33
ui5 cache clean now removes every build-cache version directory at or below the current CACHE_VERSION, warns about newer ones created by a newer CLI, and never touches them. - Detect sibling version dirs and partition into removable (older), current, and newer; surface newer ones via an unconditional stderr warning, never deleting them. - Detect leftover _buildcache_to_delete_* remnants from a previously interrupted clean so a data dir containing only remnants is no longer reported as "Nothing to clean". - Remove older versions in two phases: mark all of them for removal in one atomic rename burst before opening/dropping the current-version database, then run the slow recursive deletes. An interrupt mid-clean now leaves every dir resumable instead of stranded under its live version name. - Group output honestly: live version dirs (current + older) appear under Active Cache > Build with (current version)/(outdated) qualifiers; identity-less rename remnants appear under Stale Cache > Build with no qualifier.
d3xter666
force-pushed
the
feat/cache-clean-all-versions
branch
from
November 10, 2026 12:25
0b1fcef to
59b033f
Compare
Replace the numeric version-comparison approach to cleaning older build cache directories with an explicit allowlist. Deletion is now decided by membership in KNOWN_DELETABLE_VERSIONS (["v0_7", "v0_9"], derived from the CACHE_VERSION history on main) rather than by "version < current", so an unshipped feature-branch dir such as v0_8 is preserved and warned about instead of silently deleted. getOlderVersionsInfo now classifies sibling dirs into three buckets via the new classifyVersionDirs() helper: removable (allowlisted), unknown (version- shaped but unrecognized or newer -> warn, never delete), and foreign (ignored). The returned "newer" field is renamed to "unknown" accordingly. Simplify cacheVersions.js: drop the pseudo-semver helpers parseCacheVersion and compareCacheVersion, which had no remaining production caller once comparison was no longer the deletion gate. Replace them with a single boolean isCacheVersionDir() over the same general vMAJOR_MINOR regex, kept general so a future v1_0 still routes to unknown/warn and the CACHE_VERSION guard survives a post-GA major bump.
d3xter666
force-pushed
the
feat/cache-clean-all-versions
branch
from
November 16, 2026 13:08
5577055 to
32803c3
Compare
removePendingVersions returns per-path outcomes with removed:true only after fs.rm succeeds. cache.js warns on failures and shows only actually deleted dirs. Size displays labelled "(main db)" throughout.
This branch has not been deployed
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.
ui5 cache clean now removes every build-cache version directory at or
below the current CACHE_VERSION, warns about newer ones created by a
newer CLI, and never touches them.
current, and newer; surface newer ones via an unconditional stderr
warning, never deleting them.
interrupted clean so a data dir containing only remnants is no longer
reported as "Nothing to clean".
one atomic rename burst before opening/dropping the current-version
database, then run the slow recursive deletes. An interrupt mid-clean
now leaves every dir resumable instead of stranded under its live
version name.
under Active Cache > Build with (current version)/(outdated)
qualifiers; identity-less rename remnants appear under Stale Cache >
Build with no qualifier.