cache icon indicating copy to clipboard operation
cache copied to clipboard

Added `cache-restored` boolean flag

Open mkatychev opened this issue 3 years ago • 1 comments

Description:

  cache-restored:
    description: 'A boolean value to indicate an exact or partial match was found resulting in a restore'

This flag should be used similarly to steps.cache.outputs.cache-hit to indicate when there is a partial match for a cache.

The aim here is the ability to avoid certain install steps if any part of the cache was restored.

mkatychev avatar Feb 16 '22 18:02 mkatychev

Support! This would be useful

yfyau avatar Apr 22 '22 15:04 yfyau

@mkatychev we are working on providing granular control and looking over all the issues related to it. Then we will come up with a design for having such flags.

anuragc617 avatar Oct 27 '22 04:10 anuragc617

Description:

  cache-restored:
    description: 'A boolean value to indicate an exact or partial match was found resulting in a restore'

This flag should be used similarly to steps.cache.outputs.cache-hit to indicate when there is a partial match for a cache.

The aim here is the ability to avoid certain install steps if any part of the cache was restored.

Jimimaku avatar Nov 22 '22 00:11 Jimimaku

@mkatychev we are working on providing granular control and looking over all the issues related to it. Then we will come up with a design for having such flags.

Jimimaku avatar Nov 22 '22 00:11 Jimimaku

Support! This would be useful

Jimimaku avatar Nov 22 '22 00:11 Jimimaku

I find the description hard to understand. As of the commit:

  cache-hit:
    description: 'A boolean value to indicate an exact match was found for the primary key'
  cache-restored:
    description: 'A boolean value to indicate a primary key match was found resulting in a restore'

I.e. the difference is "primary key match" vs "exact match for the primary key". From reading this the difference is not clear to me.

And from the PR description:

description: 'A boolean value to indicate an exact or partial match was found resulting in a restore'

This could be misinterpreted as "true=exact, false=partial match"

A use case:

key: cache-${{ github.run_id }}
restore-keys: cache-

So maybe cache-restored is better described as

A boolean value to indicate a successful cache restore; either by a match for on key or (partial) match on any restore-keys

So emphasis on "Cache restored" with a short "by any means" with hints on where to look for the reason

Flamefire avatar Dec 13 '22 10:12 Flamefire

We have released a new restore action that outputs the cache-primary-key and the cache-matched-key that we believe solves the problem this PR is trying to solve. Hence closing it.

kotewar avatar Dec 27 '22 15:12 kotewar