GeezerVison is showing github.com — README: clarify that `cache-hit` returns a string and not a boolean by andreasabel · Pull Request #1263 · actions/cache
Conversation
Rationale: if cache-hit was a boolean, then ! could be used to get the opposite.
However, it is really a string, and this should be pointed out clearly in the documentation.
Because both !'true' and !'false' are false, so customers can shoot themselves in the foot here.
Closes #1262.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
samueljsb, hintron, stof, and nati-levi reacted with thumbs up emoji
ulgens, no-yan, and nati-levi reacted with heart emoji
ulgens and nati-levi reacted with eyes emoji
All reactions
-
👍
4 reactions
-
❤️
3 reactions
-
👀
2 reactions
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
|
* `cache-hit` - A string `'true'` or `'false'` indicating whether an exact match was found for the key.
|
|
|
|
|
|
> **Note** `cache-hit` will only be set to `true` when a cache hit occurs for the exact `key` match. For a partial key match via `restore-keys` or a cache miss, it will be set to `false`.
|
|
|
> **Note** `cache-hit` will only be set to `'true'` when a cache hit occurs for the exact `key` match. For a partial key match via `restore-keys` or a cache miss, it will be set to `'false'`.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still incorrect. On a cache miss, the output is not set, i.e. empty string.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ulgens reacted with heart emoji
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@itchyny So you are saying it is three-valued, 'true', 'false' or empty?
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
itchyny
Mar 22, 2024
•
edited
Loading
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the thorough investigation @itchyny ! I updated the text accordingly.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
ulgens reacted with heart emoji
Rationale: if `cache-hit` was a boolean, then `!` could be used to get the opposite.
However, it is really a string, and this should be pointed out clearly in the documentation.
Because both `!'true'` and `!'false'` are `false`, so customers can shoot themselves in the foot here.
Closes actions#1262.
|
👋 Hey @andreasabel thank you for these changes!
I'm updating the README to reflect this behavior as part of a bug fix in #1467
|
andreasabel reacted with heart emoji
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
itchyny
Awaiting requested review from itchyny
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
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.
|