GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

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

@andreasabel

@andreasabel andreasabel commented Oct 17, 2023

Copy link
Copy Markdown

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
@andreasabel
andreasabel requested a review from a team as a code owner October 17, 2023 20:40
@andreasabel andreasabel mentioned this pull request Oct 25, 2023
!cache-hit is false when cache-hit is false #1262
Closed
miparnisari
miparnisari approved these changes Nov 22, 2023
View reviewed changes
@andreasabel

andreasabel commented Dec 8, 2023

Copy link
Copy Markdown
Author

@bethanyj28 : Anything left to do here?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

itchyny
itchyny reviewed Mar 20, 2024
View reviewed changes
Comment thread README.md Outdated
* `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'`.

@itchyny itchyny Mar 20, 2024

Copy link
Copy Markdown

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
All reactions
  • ❤️ 1 reaction

@andreasabel andreasabel Mar 21, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Author

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.

All reactions

@itchyny itchyny Mar 22, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

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.

@andreasabel Exactly. A bit surprising behavior though. See https://github.com/itchyny/actions-cache-issues-1263/actions/runs/8385497449.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@andreasabel andreasabel Mar 22, 2024

Copy link
Copy Markdown
Author

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
All reactions
  • ❤️ 1 reaction
andreasabel added 2 commits March 22, 2024 07:32
@andreasabel
README: clarify that cache-hit returns a string and not a boolean
8fc291c
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.
@andreasabel
README: clarify that cache-hit is 3-valued, not a boolean
3182ee5
Evidence at https://github.com/itchyny/actions-cache-issues-1263
@andreasabel
andreasabel force-pushed the cache-hit-README branch from 6710a4f to 3182ee5 Compare March 22, 2024 06:44
@andreasabel
andreasabel requested review from itchyny and miparnisari March 22, 2024 06:45
@no-yan no-yan mentioned this pull request May 4, 2024
cache-hit undefined on cache miss? #1334
Closed
@fchimpan fchimpan mentioned this pull request May 22, 2024
Fix cache-hit output when cache missed #1404
Merged
4 of 10 tasks
@joshmgross

joshmgross commented Oct 8, 2024

Copy link
Copy Markdown
Contributor

👋 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
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@itchyny itchyny mentioned this pull request Oct 8, 2024
Cache-Hit set to string, not boolean, as of v4.1.0 #1466
Closed
@joshmgross joshmgross closed this Oct 8, 2024
@andreasabel andreasabel mentioned this pull request May 30, 2025
Clarify that the empty string is returned if no cache is restored. #1514
Open
6 of 10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@itchyny itchyny Awaiting requested review from itchyny
@miparnisari miparnisari Awaiting requested review from miparnisari

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

!cache-hit is false when cache-hit is false

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@andreasabel @joshmgross @itchyny @miparnisari
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.