Skip to content

cache trim/janitor: entries keyed by cache key collapse across refs (can target the wrong id) #137

Closed

Description

@zackees

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions