Skip to content

cache-hit needs to be replaced #1566

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

Open
jshier opened this issue Mar 6, 2025 · 4 comments
Open

cache-hit needs to be replaced #1566

jshier opened this issue Mar 6, 2025 · 4 comments

Comments

@jshier
Copy link

jshier commented Mar 6, 2025

According to #1514, cache-hit is true when the cache is restored from the full key, false when the cache is restored from a fallback key, and empty when the cache wasn't hit at all. First, please merge this documentation update, as it means most usage of this value is wrong (few people care if the fallback key was used, quite a lot of people care when the cache wasn't hit). Second, this needs to be a different API, as a Bool is inappropriate for a three part value. Instead it should be replaced with something like cache-status: found | fallbackUsed | notFound, so users can be completely clear about what's happening.

@PaulRBerg
Copy link

PaulRBerg commented Apr 16, 2025

I just spent an hour or so debugging an issue I thought was due to my YML code being incorrect, but in fact it was correct and I was getting a cache miss (and cache-hit was the empty string).

It is really, really confusing UX to:

  1. Use a boolean for a three-part value.
  2. Return cache-hit as false when a restore-keys is matched .. because a cache was actually found.

Can one of the contributors please merge PR #1514?

@joshmgross @kotewar @dhadka @lvpx @takost

@PaulRBerg
Copy link

And while we are at it, restore-keys should be renamed to something else.

@andreasabel
Copy link

And while we are at it, restore-keys should be renamed to something else.

Dream on.

This would break a gazillion of workflows without good reason.

@jshier
Copy link
Author

jshier commented May 31, 2025

Luckily they can version releases so that's not a problem. Or just deprecate the key while adding a more accurate one.

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

No branches or pull requests

3 participants