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

fix: cache adjust restore order of exact key matches #2267

Merged
merged 6 commits into from Mar 29, 2024

Conversation

ChristopherHX
Copy link
Contributor

@ChristopherHX ChristopherHX commented Mar 28, 2024

Those workflows should pass without errors for the cache server

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
        id: cache
        with:
          path: .
          key: ${{ runner.os }}-${{ github.run_id }}-3
      - name: Assert that we got a cache hit
        run: exit 1
        if: steps.cache.outputs.cache-hit != 'true'
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
        id: cache
        with:
          path: .
          key: -----------------------------------------------------------
          restore-keys:
            ${{ runner.os }}-${{ github.run_id }}-3
      - name: Assert that we got a cache hit
        run: exit 1
        if: steps.cache.outputs.cache-matched-key != format('{0}-{1}-3', runner.os, github.run_id)

Copy link
Contributor

github-actions bot commented Mar 28, 2024

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ EDITORCONFIG editorconfig-checker 2 0 0.02s
✅ REPOSITORY gitleaks yes no 2.28s
✅ REPOSITORY git_diff yes no 0.09s
✅ REPOSITORY grype yes no 7.73s
✅ REPOSITORY secretlint yes no 1.03s
✅ REPOSITORY trivy-sbom yes no 0.61s
✅ REPOSITORY trufflehog yes no 7.04s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

Copy link

codecov bot commented Mar 28, 2024

Codecov Report

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

Project coverage is 62.33%. Comparing base (5a80a04) to head (eb35766).
Report is 31 commits behind head on master.

Files Patch % Lines
pkg/artifactcache/handler.go 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2267      +/-   ##
==========================================
+ Coverage   61.56%   62.33%   +0.77%     
==========================================
  Files          53       56       +3     
  Lines        9002     9137     +135     
==========================================
+ Hits         5542     5696     +154     
+ Misses       3020     2991      -29     
- Partials      440      450      +10     

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

@pull-request-size pull-request-size bot added size/L and removed size/S labels Mar 28, 2024
@ChristopherHX ChristopherHX changed the title wip: adjust restore order fix: cache adjust restore order of exact key matches Mar 28, 2024
@ChristopherHX ChristopherHX marked this pull request as ready for review March 28, 2024 20:04
@ChristopherHX ChristopherHX requested a review from a team as a code owner March 28, 2024 20:04
@mergify mergify bot merged commit f825e42 into master Mar 29, 2024
10 checks passed
@mergify mergify bot deleted the cache-fix-regression branch March 29, 2024 02:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants