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 — Add `fail-on-cache-miss` option by cdce8p · Pull Request #1036 · actions/cache

Conversation

@cdce8p

@cdce8p cdce8p commented Dec 22, 2022

Copy link
Copy Markdown
Contributor

Description

Add an advanced option to fail job if cache miss occurs.
Based on the work from @kotewar which was reverted in 11ab7cc.

Motivation and Context

Fixes #955 and partially #1020 (comment)

This is already possible via the cache-hit output. However, especially for advanced workflows, this quickly becomes cumbersome to add every time. It's also an additional 3 line for each job and doesn't include a good error message.

  - name: Check cache hit
    if: steps.cache.outputs.cache-hit != 'true'
    run: exit 1

As mentioned in #955 (comment), the goal to simplify the configuration doesn't exclude the possibility to help with more advanced use cases. Including the new option will make it easier to use, help keep workflows more readable, and enable better error messages.

How Has This Been Tested?

Added test cases and run a test workflow using the feature branch.

Screenshots (if appropriate):

--

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation (add or update README or docs)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Sorry, something went wrong.

Uh oh!

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

All reactions
@cdce8p
cdce8p requested a review from a team as a code owner December 22, 2022 16:09
@github-actions
github-actions Bot requested a review from lvpx December 22, 2022 16:10
@github-actions github-actions Bot assigned lvpx Dec 22, 2022
@kotewar kotewar added the area:advanced-control label Dec 26, 2022
@kotewar
kotewar requested review from kotewar and removed request for lvpx December 26, 2022 04:51
@kotewar kotewar assigned kotewar and unassigned lvpx Dec 26, 2022
cdce8p added 3 commits January 8, 2023 10:38
@cdce8p
Add fail-on-cache-miss option
a5631ab
@cdce8p
Small improvements
64ae8e0
@cdce8p
Changes after rebase
ec9f13e
@cdce8p

cdce8p commented Jan 8, 2023

Copy link
Copy Markdown
Contributor Author

@kotewar I rebased all my PRs to resolve the merge conflicts and update the tests after the recent changes. Is there a timeline when this can move forward? It would be awesome if I wouldn't have to resolve merge conflicts every other week.

All reactions

Sorry, something went wrong.

Uh oh!

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

bishal-pdMSFT
bishal-pdMSFT reviewed Jan 9, 2023
View reviewed changes
Comment thread restore/action.yml Resolved

Uh oh!

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

cdce8p added 2 commits January 9, 2023 11:20
@cdce8p
Update description
d05f7e6
@cdce8p
Only fail if no cache entry is found
155f8e7
bishal-pdMSFT
bishal-pdMSFT reviewed Jan 10, 2023
View reviewed changes
Comment thread action.yml Resolved

Uh oh!

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

bishal-pdMSFT
bishal-pdMSFT reviewed Jan 10, 2023
View reviewed changes
Comment thread restore/README.md Resolved

Uh oh!

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

cdce8p added 2 commits January 10, 2023 09:35
@cdce8p
Merge branch 'main' into fail-on-cache-miss
bb5b1c3
@cdce8p
Code review
ff0920f
@cdce8p
cdce8p requested review from bishal-pdMSFT and removed request for kotewar January 13, 2023 11:43
cdce8p added 2 commits January 16, 2023 23:03
@cdce8p
Merge branch 'main' into fail-on-cache-miss
f2d21e5
@cdce8p
Update readme
2a9576c
kotewar
kotewar suggested changes Jan 30, 2023
View reviewed changes
Comment thread __tests__/restore.test.ts Resolved

Uh oh!

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

@kotewar kotewar mentioned this pull request Jan 30, 2023
Add lookup-only option #1041
Merged
7 of 10 tasks
cdce8p added 2 commits January 30, 2023 10:46
@cdce8p
Merge branch 'main' into fail-on-cache-miss
1c9e1e1
@cdce8p
Add additional test case
084782a
@kotewar

kotewar commented Jan 30, 2023

Copy link
Copy Markdown
Contributor

Looks good to me, before we can release this out, we need a few additions

  1. Please update the patch version in package.json
  2. Please update RELEASES.md and the Whats new section of README.md with appropriate release info.

I'll approve, merge the PR and release the new version once the info is updated! Thanks :)

cdce8p reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

cdce8p added 2 commits January 30, 2023 11:40
@cdce8p
Bump version + changelog
d69d1b2
@cdce8p
Update package-lock.json
7a02e3a
@kotewar

kotewar commented Jan 30, 2023

Copy link
Copy Markdown
Contributor

Whats new section of README.md with appropriate release info.

This also please. Just one liner is enough.

All reactions

Sorry, something went wrong.

Uh oh!

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

@cdce8p
Update Readme
57a5a1f
@cdce8p

cdce8p commented Jan 30, 2023

Copy link
Copy Markdown
Contributor Author

Whats new section of README.md with appropriate release info.

This also please. Just one liner is enough.

Sorry. Missed that the first time. Should be good now.

kotewar reacted with thumbs up emoji kotewar reacted with laugh emoji
All reactions
  • 👍 1 reaction
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

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

kotewar
kotewar approved these changes Jan 30, 2023
View reviewed changes

@kotewar kotewar left a comment

Copy link
Copy Markdown
Contributor

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.

LGTM

Sorry, something went wrong.

Uh oh!

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

cdce8p reacted with hooray emoji
All reactions
  • 🎉 1 reaction
@kotewar
kotewar merged commit 627f0f4 into actions:main Jan 30, 2023
@kotewar

kotewar commented Jan 30, 2023 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Thanks @cdce8p for your contribution, the changes are live 🚀

Please do test the positive and negative responses once with the latest tag actions/cache@v3 and actions/cache/restore@v3.

All reactions

Sorry, something went wrong.

Uh oh!

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

@cdce8p

cdce8p commented Jan 30, 2023

Copy link
Copy Markdown
Contributor Author

Thanks @cdce8p for your contribution, the changes are live 🚀

Awesome 🎉 Thanks for your help getting it ready.

Please do test the positive and negative responses once with the latest tag actions/cache@v3 and actions/cache/restore@v3.

actions/[email protected] does seem to work as expected from my initial testing. However, the v3 tag doesn't seem to have been updated. It still points to 3.2.3 (58c146c) not 3.2.4 (58c146c).
Thus I just get Unexpected input(s) 'fail-on-cache-miss' for that.

All reactions

Sorry, something went wrong.

Uh oh!

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

@cdce8p
cdce8p deleted the fail-on-cache-miss branch January 30, 2023 11:48
@kotewar

kotewar commented Jan 30, 2023

Copy link
Copy Markdown
Contributor

Let me check

All reactions

Sorry, something went wrong.

Uh oh!

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

@kotewar

kotewar commented Jan 30, 2023

Copy link
Copy Markdown
Contributor

My bad, I forgot to tag the version to v3. Please check now.

cdce8p reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

Sorry, something went wrong.

Uh oh!

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

@cdce8p

cdce8p commented Jan 30, 2023

Copy link
Copy Markdown
Contributor Author

My bad, I forgot to tag the version to v3. Please check now.

It works now! Thanks

kotewar reacted with hooray emoji
All reactions
  • 🎉 1 reaction

Sorry, something went wrong.

Uh oh!

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

@Teddy-van-Jerry Teddy-van-Jerry mentioned this pull request Jan 31, 2023
Bump actions/cache from 3.2.3 to 3.2.4 mmcesim/mmcesim#27
Merged
Dakshjain1 pushed a commit to SvavaCapital/cache that referenced this pull request Apr 19, 2024
@cdce8p @Dakshjain1
Add fail-on-cache-miss option (actions#1036)
07d11be
* Add fail-on-cache-miss option

* Small improvements

* Changes after rebase

* Update description

* Only fail if no cache entry is found

* Code review

* Update readme

* Add additional test case

* Bump version + changelog

* Update package-lock.json

* Update Readme
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@bishal-pdMSFT bishal-pdMSFT Awaiting requested review from bishal-pdMSFT
1 more reviewer
@kotewar kotewar kotewar approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

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

Assignees

@kotewar kotewar

Labels

area:advanced-control

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

optional action failure on cache miss

Uh oh!

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

4 participants

@cdce8p @kotewar @bishal-pdMSFT @lvpx
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.