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

Support overwriting caches #2265

Merged
merged 11 commits into from Mar 28, 2024
Merged

Conversation

wolfogre
Copy link
Member

@wolfogre wolfogre commented Mar 28, 2024

In the old implementation, it assumes that there will be no duplicate uploads of caches with the same key.

But in fact, some actions like actions/setup-go will do something like:

  1. Download the cache with the generated key.
  2. Add more contents to the cache dir by downloading and building.
  3. Upload the cache dir with the same key to replace the old cache.

It will result in a failure (though it will actually be ignored) with the following log:

/root/go/pkg/mod
/root/.cache/go-build
[command]/bin/tar --posix -cf cache.tgz --exclude cache.tgz -P -C /workspace/gitea/act_runner --files-from manifest.txt -z
::warning::Failed to save: {"error":"already exist"}

To support it, this PR introduces some changes.

  • Uploading caches with same key (and the version which indicates the env) will be allowed.
  • Return the latest completed one when retrieving a cache with a key.
  • The old caches with the same key will be deleted regularly, keep the latest only.

I have tested the code with a custom act_runner. It works well and is compatible with old data.

@wolfogre wolfogre added the kind/bug Something isn't working label Mar 28, 2024
@wolfogre wolfogre requested a review from a team as a code owner March 28, 2024 04:32

This comment was marked as duplicate.

@mergify mergify bot added the needs-work Extra attention is needed label Mar 28, 2024

This comment was marked as off-topic.

This comment was marked as duplicate.

This comment was marked as duplicate.

1 similar comment

This comment was marked as duplicate.

@wolfogre
Copy link
Member Author

wolfogre commented Mar 28, 2024

Weird, I don't think the failed CI is related now.

image

This comment was marked as duplicate.

@ChristopherHX
Copy link
Contributor

Upload the cache dir with the same key to replace the old cache

Yes this is probably true in act, since the run_number, run_id, run_attempt doesn't update automatically.

I'm not yet shure that this is the same Key on GitHub Actions Servers, but they could have silently implemented the override cache feature request.

For act it's fine for me to merge...

FAIL: TestRunEvent/networking

Should we remove that flaky test? I mean it caused a lot of reruns in the past

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

Attention: Patch coverage is 63.79310% with 21 lines in your changes are missing coverage. Please review.

Project coverage is 62.37%. Comparing base (5a80a04) to head (c86b1bb).
Report is 28 commits behind head on master.

Files Patch % Lines
pkg/artifactcache/handler.go 63.79% 9 Missing and 12 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2265      +/-   ##
==========================================
+ Coverage   61.56%   62.37%   +0.81%     
==========================================
  Files          53       56       +3     
  Lines        9002     9127     +125     
==========================================
+ Hits         5542     5693     +151     
+ Misses       3020     2986      -34     
- Partials      440      448       +8     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

This comment was marked as duplicate.

@wolfogre
Copy link
Member Author

wolfogre commented Mar 28, 2024

FAIL: TestRunEvent/networking

Should we remove that flaky test? I mean it caused a lot of reruns in the past

@ChristopherHX Thank you for pointing out the problem. I was lost in the huge logs.

How about #2266?

I have tested the commit in this PR, and it works, but I will revert it since it is unrelated.

@wolfogre
Copy link
Member Author

wolfogre commented Mar 28, 2024

Upload the cache dir with the same key to replace the old cache

Yes this is probably true in act, since the run_number, run_id, run_attempt doesn't update automatically.

I'm not yet shure that this is the same Key on GitHub Actions Servers, but they could have silently implemented the override cache feature request.

@ChristopherHX I am sure GitHub Actions support multiple caches with the same key.

Let me show you the cache manage page of the Gitea repo.

image

This comment was marked as duplicate.

This comment was marked as duplicate.

This comment was marked as duplicate.

@wolfogre wolfogre removed the needs-work Extra attention is needed label Mar 28, 2024
@wolfogre
Copy link
Member Author

It should wait #2266.

@ChristopherHX
Copy link
Contributor

@ChristopherHX I am sure GitHub Actions support multiple caches with the same key

Ah yes that are cache scopes that are not implemented here.

They are unique per repo + ref only default branch scope

@wolfogre
Copy link
Member Author

@ChristopherHX I am sure GitHub Actions support multiple caches with the same key

Ah yes that are cache scopes that are not implemented here.

They are unique per repo + ref only default branch scope

Actually I have already implemented the cache scope, maybe port it later after this PR.

@ChristopherHX
Copy link
Contributor

If we have same scope key and version it still fails on GitHub Actions
image


I'm still cross checking your simplifications to cache restore, because it looks now

[ key ] would resolve to key1 even if an exact key key exists which is older than the key1 entry.

So would the entries look like

  • key updated at yesterday
  • key1 updated today

@ChristopherHX
Copy link
Contributor

So I assume this no longer resolves to the absolute key match

image

And would restore the key with -2 and not the one of the log as explained before

@mergify mergify bot requested a review from a team March 28, 2024 16:30
Copy link
Contributor

@ChristopherHX ChristopherHX left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I cannot reproduce my concerns..., let's merge

@mergify mergify bot merged commit b9382a2 into nektos:master Mar 28, 2024
10 checks passed
@ChristopherHX
Copy link
Contributor

Hmm, I'm blind here is the bug I meant

on:
  push:
jobs:
  testa:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
    
      - uses: actions/cache/save@v4
        with:
          path: .
          key: ${{ runner.os }}-${{ github.run_id }}-3
      - uses: actions/cache/save@v4
        with:
          path: .
          key: ${{ runner.os }}-${{ github.run_id }}-3-1
      - uses: actions/cache/restore@v4
        with:
          path: .
          key: ${{ runner.os }}-${{ github.run_id }}-3

GitHub
image
Act

time="2024-03-28T17:42:11+01:00" level=warning msg="Couldn't get a valid docker connection: no DOCKER_HOST and an invalid container socket ''"
time="2024-03-28T17:42:11+01:00" level=warning msg="unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist"
time="2024-03-28T17:42:11+01:00" level=error msg="pathnot located inside a git repository" error="repository does not exist"
time="2024-03-28T17:42:11+01:00" level=warning msg="unable to get git ref: repository does not exist"
time="2024-03-28T17:42:11+01:00" level=error msg="pathnot located inside a git repository" error="repository does not exist"
time="2024-03-28T17:42:11+01:00" level=warning msg="unable to get git revision: repository does not exist"
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] ⭐ Run Main actions/checkout@v4
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa]   ✅  Success - Main actions/checkout@v4
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] ⭐ Run Main actions/cache/save@v4
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa]   💬  ::debug::Checking zstd --quiet --version
[t.yml/testa]   💬  ::debug::Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
[t.yml/testa]   💬  ::debug::
[t.yml/testa]   💬  ::debug::zstd version: null
[t.yml/testa]   💬  ::debug::implicitDescendants 'false'
[t.yml/testa]   💬  ::debug::followSymbolicLinks 'true'
[t.yml/testa]   💬  ::debug::implicitDescendants 'false'
[t.yml/testa]   💬  ::debug::omitBrokenSymbolicLinks 'true'
[t.yml/testa]   💬  ::debug::Search path 'C:\Users\Christopher\.cache\act\7c29673360ea47d7\hostexecutor'
[t.yml/testa]   💬  ::debug::Matched:
[t.yml/testa]   💬  ::debug::Cache Paths:
[t.yml/testa]   💬  ::debug::["."]
[t.yml/testa]   💬  ::debug::Archive Path: C:\Users\Christopher\.cache\act\7c29673360ea47d7\tmp\dea6f3da-a437-4653-a284-b75baed2c9af\cache.tgz
[t.yml/testa]   💬  ::debug::Checking tar --version
[t.yml/testa]   💬  ::debug::bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd/1.5.4
| [command]C:\Windows\System32\tar.exe --posix -cf cache.tgz --exclude cache.tgz -P -C 7c29673360ea47d7/hostexecutor --files-from manifest.txt -z
[t.yml/testa]   💬  ::debug::File Size: 6560209
[t.yml/testa]   💬  ::debug::Reserving Cache
[t.yml/testa]   💬  ::debug::Resource Url: http://192.168.178.20:61136/_apis/artifactcache/caches
[t.yml/testa]   💬  ::debug::Saving Cache (ID: 16)
[t.yml/testa]   💬  ::debug::Upload cache
[t.yml/testa]   💬  ::debug::Resource Url: http://192.168.178.20:61136/_apis/artifactcache/caches/16
[t.yml/testa]   💬  ::debug::Upload concurrency: 4
[t.yml/testa]   💬  ::debug::Upload chunk size: 33554432
[t.yml/testa]   💬  ::debug::Awaiting all uploads
[t.yml/testa]   💬  ::debug::Uploading chunk of size 6560209 bytes at offset 0 with content range: bytes 0-6560208/*
[t.yml/testa]   💬  ::debug::Commiting cache
| Cache Size: ~6 MB (6560209 B)
[t.yml/testa]   💬  ::debug::Resource Url: http://192.168.178.20:61136/_apis/artifactcache/caches/16
| Cache saved successfully
| Cache saved with key: windows-1-3
[t.yml/testa]   ✅  Success - Main actions/cache/save@v4
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] ⭐ Run Main actions/cache/save@v4
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa]   💬  ::debug::Checking zstd --quiet --version
[t.yml/testa]   💬  ::debug::Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
[t.yml/testa]   💬  ::debug::
[t.yml/testa]   💬  ::debug::zstd version: null
[t.yml/testa]   💬  ::debug::implicitDescendants 'false'
[t.yml/testa]   💬  ::debug::followSymbolicLinks 'true'
[t.yml/testa]   💬  ::debug::implicitDescendants 'false'
[t.yml/testa]   💬  ::debug::omitBrokenSymbolicLinks 'true'
[t.yml/testa]   💬  ::debug::Search path 'C:\Users\Christopher\.cache\act\7c29673360ea47d7\hostexecutor'
[t.yml/testa]   💬  ::debug::Matched:
[t.yml/testa]   💬  ::debug::Cache Paths:
[t.yml/testa]   💬  ::debug::["."]
[t.yml/testa]   💬  ::debug::Archive Path: C:\Users\Christopher\.cache\act\7c29673360ea47d7\tmp\324b102c-603b-4d78-9c43-1a88565870d1\cache.tgz
[t.yml/testa]   💬  ::debug::Checking tar --version
[t.yml/testa]   💬  ::debug::bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd/1.5.4
| [command]C:\Windows\System32\tar.exe --posix -cf cache.tgz --exclude cache.tgz -P -C 7c29673360ea47d7/hostexecutor --files-from manifest.txt -z
[t.yml/testa]   💬  ::debug::File Size: 6560210
[t.yml/testa]   💬  ::debug::Reserving Cache
[t.yml/testa]   💬  ::debug::Resource Url: http://192.168.178.20:61136/_apis/artifactcache/caches
[t.yml/testa]   💬  ::debug::Saving Cache (ID: 17)
[t.yml/testa]   💬  ::debug::Upload cache
[t.yml/testa]   💬  ::debug::Resource Url: http://192.168.178.20:61136/_apis/artifactcache/caches/17
[t.yml/testa]   💬  ::debug::Upload concurrency: 4
[t.yml/testa]   💬  ::debug::Upload chunk size: 33554432
[t.yml/testa]   💬  ::debug::Awaiting all uploads
[t.yml/testa]   💬  ::debug::Uploading chunk of size 6560210 bytes at offset 0 with content range: bytes 0-6560209/*
[t.yml/testa]   💬  ::debug::Commiting cache
| Cache Size: ~6 MB (6560210 B)
[t.yml/testa]   💬  ::debug::Resource Url: http://192.168.178.20:61136/_apis/artifactcache/caches/17
| Cache saved successfully
| Cache saved with key: windows-1-3-1
[t.yml/testa]   ✅  Success - Main actions/cache/save@v4
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] ⭐ Run Main actions/cache/restore@v4
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist
[t.yml/testa]   💬  ::debug::Resolved Keys:
[t.yml/testa]   💬  ::debug::["windows-1-3"]
[t.yml/testa]   💬  ::debug::Checking zstd --quiet --version
[t.yml/testa]   💬  ::debug::Unable to locate executable file: zstd. Please verify either the file path exists or the file can be found within a directory specified by the PATH environment variable. Also verify the file has a valid extension for an executable file.
[t.yml/testa]   💬  ::debug::
[t.yml/testa]   💬  ::debug::zstd version: null
[t.yml/testa]   💬  ::debug::Resource Url: http://192.168.178.20:61136/_apis/artifactcache/cache?keys=windows-1-3&version=d965035e38b50bdd78095b9155f5795112546f525b210cb187f41b84c6bfb4d0
[t.yml/testa]   ⚙  ***
[t.yml/testa]   💬  ::debug::Cache Result:
[t.yml/testa]   💬  ::debug::{"archiveLocation":"***","cacheKey":"windows-1-3-1","result":"hit"}
[t.yml/testa]   💬  ::debug::Archive Path: C:\Users\Christopher\.cache\act\7c29673360ea47d7\tmp\7201c457-73c8-47c1-b4d9-12b212b38c7c\cache.tgz
[t.yml/testa]   💬  ::debug::Use Azure SDK: false
[t.yml/testa]   💬  ::debug::Download concurrency: 8
[t.yml/testa]   💬  ::debug::Request timeout (ms): 30000
[t.yml/testa]   💬  ::debug::Cache segment download timeout mins env var: undefined
[t.yml/testa]   💬  ::debug::Segment download timeout (ms): 600000
[t.yml/testa]   💬  ::debug::Lookup only: false
| Cache Size: ~6 MB (6560210 B)
[t.yml/testa]   💬  ::debug::Checking tar --version
[t.yml/testa]   💬  ::debug::bsdtar 3.6.2 - libarchive 3.6.2 zlib/1.2.5.f-ipp liblzma/5.2.5 bz2lib/1.0.8 libzstd/1.5.4
| [command]C:\Windows\System32\tar.exe -xf 7c29673360ea47d7/tmp/7201c457-73c8-47c1-b4d9-12b212b38c7c/cache.tgz -P -C 7c29673360ea47d7/hostexecutor -z
| Cache restored successfully
| Cache restored from key: windows-1-3-1
[t.yml/testa]   ✅  Success - Main actions/cache/restore@v4
[t.yml/testa]   ⚙  ::set-output:: cache-primary-key=windows-1-3
[t.yml/testa]   ⚙  ::set-output:: cache-matched-key=windows-1-3-1
[t.yml/testa]   ⚙  ::set-output:: cache-hit=false
[t.yml/testa] Cleaning up container for job testa
[t.yml/testa] 🏁  Job succeeded
[t.yml/testa] unable to get git repo (githubInstance: github.com; remoteName: origin, repoPath: ): repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git ref: repository does not exist
[t.yml/testa] pathnot located inside a git repository
[t.yml/testa] unable to get git revision: repository does not exist

@ChristopherHX
Copy link
Contributor

My own understanding is also a bit wrong...

image

on:
  push:
jobs:
  testa:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
    
      - uses: actions/cache/save@v4
        with:
          path: .
          key: ${{ runner.os }}-${{ github.run_id }}-3
      - uses: actions/cache/save@v4
        with:
          path: .
          key: ${{ runner.os }}-${{ github.run_id }}-3-1
      - uses: actions/cache/save@v4
        with:
          path: .
          key: ${{ runner.os }}-${{ github.run_id }}-3-2
      - uses: actions/cache/restore@v4
        with:
          path: .
          key: ---------------------------------------------------------------
          restore-keys: |
            ${{ runner.os }}-${{ github.run_id }}-3
            ${{ runner.os }}-${{ github.run_id }}-3-2

We should alter the orderby statement to always return exact matched keys first, regardless of position in the list

@ChristopherHX
Copy link
Contributor

Created a followup #2267

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

Successfully merging this pull request may close these issues.

None yet

2 participants