Skip to content
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

Cache key interpolates version spec instead of actual version #280

Closed
2 of 5 tasks
pietern opened this issue Oct 20, 2022 · 4 comments
Closed
2 of 5 tasks

Cache key interpolates version spec instead of actual version #280

pietern opened this issue Oct 20, 2022 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@pietern
Copy link

pietern commented Oct 20, 2022

Description:

The version as specified in go-version is used verbatim in the cache key. If I specify 1.18.x it may first resolve to 1.18.6 and later to 1.18.7. However, if I store a build cache on 1.18.6 it is not usable for 1.18.7.

Action version:

v3

Platform:

  • Ubuntu
  • macOS
  • Windows

Runner type:

  • Hosted
  • Self-hosted

Tools version:

1.18.x

Repro steps:
Run a nightly action with 1.18.x and observe the build times go up once a new patch version of Go is released.

Expected behavior:
I would expect the cache key to change and a new build to upload a new cache entry.

Actual behavior:
The cache key interpolates 1.18.x and the cache isn't used when a new patch version is released.

@pietern pietern added bug Something isn't working needs triage labels Oct 20, 2022
@pietern
Copy link
Author

pietern commented Oct 20, 2022

A possible fix is to move this block a bit further down so that it can use the goVersion variable:

setup-go/src/main.ts

Lines 56 to 60 in c4a742c

if (cache && isCacheFeatureAvailable()) {
const packageManager = 'default';
const cacheDependencyPath = core.getInput('cache-dependency-path');
await restoreCache(versionSpec, packageManager, cacheDependencyPath);
}

@e-korolevskii
Copy link
Contributor

Hi @pietern, we will investigate the issue and get back to you.

@e-korolevskii
Copy link
Contributor

Hello @pietern!

I'm happy to let you know that changes were applied in this PR. You should wait for the new release of the setup-go action to use them.

Now I'm closing the issue but if you have additional questions - feel free to ask here or create a new one!

@pietern
Copy link
Author

pietern commented Feb 1, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants