Skip to content

fix: fall back to next scope when no restore keys#229

Open
dulacp wants to merge 1 commit intofalcondev-oss:devfrom
dulacp:fix-scope-fallback-no-restore-keys
Open

fix: fall back to next scope when no restore keys#229
dulacp wants to merge 1 commit intofalcondev-oss:devfrom
dulacp:fix-scope-fallback-no-restore-keys

Conversation

@dulacp
Copy link
Copy Markdown

@dulacp dulacp commented Apr 17, 2026

Bug

A PR workflow that restores a cache gets a miss, even when an entry with the exact same key exists on the base branch scope.

Expected: the lookup should fall back from the PR scope (refs/pull/N/merge) to the base-branch scope (refs/heads/main) and return that entry.

Impact

Every PR misses the base-branch cache and creates its own copy on first run. In one repo we observed 26 duplicate copies of the same key across PR scopes because fallback never kicked in.

Fix

Change return to continue so the loop proceeds to the next scope.

Test

No existing test covers multi-scope lookups without restore keys. Happy to add one if helpful — the current tests/e2e.test.ts uses a single scope so the bug doesn't surface there.

@kuhnroyal
Copy link
Copy Markdown
Contributor

This is probably the reason my storage requirements are blowing up :)
@LouisHaftmann Can you merge and release this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants