Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong Cache restore operation #1433

Open
P1119r1m opened this issue Jul 18, 2024 · 3 comments
Open

Wrong Cache restore operation #1433

P1119r1m opened this issue Jul 18, 2024 · 3 comments
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@P1119r1m
Copy link

When trying to restore the "cache-toolchains-atf-d64" the Cache action actually restores "cache-toolchains-atf-d64x" (with 'x' at the end):

Run actions/cache/restore@v3
with:
path: /work/atf_toolchains
key: cache-toolchains-atf-d64
enableCrossOsArchive: false
fail-on-cache-miss: false
lookup-only: false
...
Cache restored successfully
Cache restored from key: cache-toolchains-atf-d64x

@joshmgross
Copy link
Member

Cache keys are prefix-matched, so if your restore key is cache-toolchains-atf-d64 then both cache-toolchains-atf-d64 and cache-toolchains-atf-d64x would be a valid cache to restore.

restore-keys - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key.

@P1119r1m
Copy link
Author

P1119r1m commented Jul 26, 2024

Cache keys are prefix-matched, so if your restore key is cache-toolchains-atf-d64 then both cache-toolchains-atf-d64 and cache-toolchains-atf-d64x would be a valid cache to restore.

restore-keys - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key.

Thank you for clarifying.

UPD. Please note that the original issue was related to the key input, not the restore-keys.

Could you please update the documentation to include information about the key as well, since it currently only details the "prefix-match" behavior for restore-keys?

The current documentation contains following infomation:

Inputs

  • key - An explicit key for a cache entry. See creating a cache key.
  • ...
  • restore-keys - An ordered list of prefix-matched keys to use for restoring stale cache if no cache hit occurred for key.

It would be helpful to provide additional details on how the key itself functions in relation to cache hits and misses.

@joshmgross joshmgross added the question Further information is requested label Jul 29, 2024
@joshmgross joshmgross self-assigned this Jul 30, 2024
@joshmgross
Copy link
Member

👋 I've checked the internal service implementation and it appears that our documentation is incorrect. key uses prefix-matching similar to how restore-keys works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

2 participants