You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cache trim/janitor: entries keyed by cache key collapse across refs (can target the wrong id) #137
Found in M2-41 (kernal-api #93) at ci.yml@78506e7.
ci_lint.cache.ops.trim and janitor build by_key = {c.entry.key: c for c in classified}, and _findings_to_plan resolves each finding through path = "cache:<key>". GitHub cache keys are unique per ref, not per repository. The same key can live on refs/heads/main and on refs/pull/N/merge at the same time, so these entries collapse:
Worse, for a shared key by_key[key] can resolve to the main entry's id. trim would then delete the default-branch entry instead of the closed PR's.
Fix: key findings and plans by cache id, not by key. Findings could carry the id, e.g. cache:<id>:<key>, or the audit could pass ids through. Add a fixture with one key on two refs.
Workaround used in kernal-api: ci-lint cache heal --key K --ref refs/pull/360/merge for the 4 shared-key entries.
Activity