Repository navigation
fix: delete build cache with its function, site or runtime - #14761
Conversation
…untime Builds keep a package-manager cache per resource and runtime image. Pin that deleting a function or site, or changing its runtime, removes the cache those builds wrote. Deployments::resourceCachePath() names that path, and a unit test holds it to the path storage() hands the build.
Security rulesNo new WARNING or ERROR findings from security rules. 6 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
node-20 is listed as node-20.0, so the update was refused before it could reach the cache.
748900f to
083f984
Compare
The cache key hashes project, resource and runtime image, and only a project delete removed the cache directory. Deleting a function or site left its cache behind, and changing the runtime stranded the previous image's cache where no later build or delete looks. The deletes worker now removes the resource's current cache, and the function and site update endpoints remove the previous cache when the runtime image changes. The key stays as it is, so existing caches keep working.
|
Review complete. No blocking issues — approved ✅; 1 nitpick below. 🧹 Nitpicks (1) — 🟢 1 low
This PR introduces per-resource build-cache reclamation: a new
Reviewed commit: d62378f |
🟢 Tier S · Ready to mergeThis pull request resolves build-cache paths from each resource’s runtime image and removes the corresponding cache when a function or site is deleted or its runtime changes. It adds coverage for cache-path identity and cleanup, and the latest updates keep the function and site update actions compatible with callers that do not provide a builds device. Latest changes: The newest commits make the builds device nullable and optional in both update actions, skipping stale-cache cleanup when a direct caller omits it to preserve backward compatibility.
📂 Walkthrough · 9
Reviewed the commits since |
The build device was a new required parameter on the function and site update actions, so a subclass calling parent::action() with the previous argument list would fail on every update. Make it optional and last; without it the stale cache is left as before.
fix: delete build cache with its function, site or runtime (cherry picked from commit d61aa63)
Site deployment screenshots leave platform file rows behind.
bucket_<screenshots>keptTests (
SitesConsoleClientTest,screenshotsgroup):testDeleteDeploymentScreenshots: screenshot rows 404 after the deployment is deletedtestDeleteDeploymentDuringScreenshotCapture: no screenshot rows remain when the deployment is deleted mid-captureRelated: appwrite-labs/cloud#6628