Repository navigation
cacheserver: scope entries by repository ID as well as name - #216
Merged
Merged
Conversation
Job identity and cache scope used the repository's owner/name, which passes to a different repository once its first owner renames or deletes it. A repository later created under that name, served by the same cache, could read the earlier one's retained entries, git packs included, through an empty restore prefix, without knowing a key. Resolution now reads GitHub's repository ID and requires the run to report the same one, Validate requires it, and the cache server scopes entries by "<name>#<id>". Keeping the name in the key also means a repository transferred to another owner does not carry caches built there into its new one. Entries saved under the name alone match no identity and age out. Signed-off-by: Yi-Ru Lin <deduce@gmail.com>
linyiru
enabled auto-merge
November 8, 2026 04:45
Signed-off-by: Yi-Ru Lin <deduce@gmail.com>
…y IDs The cache-protocol test's identity records had no repository_id, so every request was denied once Validate required one, and the entry-cap test from #215 compared entries against the bare name, which no longer is the scope. Signed-off-by: Yi-Ru Lin <deduce@gmail.com>
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.
Job identity and cache scope used the repository's
owner/name. That name passes to a different repository once its first owner renames or deletes it. A repository later created under the same name, and served by the same cache, could then read the earlier repository's retained entries, git packs included, through an empty restore prefix and without knowing any key.Changes:
GET /repos/{name}. The workflow run must report the same ID, or resolution fails.Identity.RepositoryIDis required byValidate.Identity.ScopeKey(), which is<lowercased name>#<id>. Keeping the name in the key also means a repository transferred to another owner does not carry caches built there into its new owner.Tests:
Validaterequires the ID.scripts/mutate.shconfirmed that the scope key, the required run ID and theValidatecheck are each caught by a test.Review: a fresh reviewer agent reviewed the change. It confirmed that the only identity that grants access comes from
Registry.StartthroughGitHub.Resolve, that an old name cannot resolve to a renamed repository's ID, and that nothing builds a URL from the rewritten field. Its should-fixes are fixed here: the run's ID is now required, and the upgrade path has a test.