Restore keys by using the prefix #3
Open
+112
−63
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.
Description
Hi, thanks for the cool action! This PR attempts to keep behavior of restoring keys by "prefix" instead of exact match (which is exactly the behavior of actions/cache). It could be useful in fallback scenarios.
Motivation and Context
For example:
Suppose that our hash was updated from aaaaaa to bbbbbb, with cache of aaaaaa is available.
Previously actions/cache would first try to restore with keys
Linux-go-bbbbbband then fallback to latest cache with keyLinux-go-<any>, which becomes a successful lookup ofLinux-go-aaaaaa. So the cache is hit, and try to utilized as much as possible.In gcs-cache, however, cache will be missed totally because there is no key
Linux-go-bbbbbbandLinux-go-.How Has This Been Tested?
I'm also wondering how this could be tested automatically! Could you give me some advice? Currently I'm testing it manually by applying it in my own workflow.
Screenshots (if appropriate):
Types of changes
Considered as a bug fix because it now follows the actions/cache behavior.
Checklist: