3
0
Fork 0
mirror of https://code.forgejo.org/actions/cache.git synced 2026-01-09 05:08:57 +00:00

Add S3 cache download validation and retry logic

- Add empty file validation (0 bytes) and minimum size checks (512 bytes) for tar archives
- Implement download completeness validation (bytes downloaded = expected)
- Add retry logic with exponential backoff for validation failures (3 attempts: 1s/2s/4s delays)
- Create DownloadValidationError class for specific validation failures
- Add comprehensive test coverage for validation scenarios
- Maintain graceful degradation - validation failures log warnings but don't fail workflows
This commit is contained in:
Brenden Matthews 2025-06-20 16:35:40 -04:00
parent 7994cabd39
commit a28af779d2
No known key found for this signature in database
GPG key ID: 65458E93BD621972
12 changed files with 603 additions and 82 deletions

View file

@ -2,6 +2,7 @@ import * as cache from "@actions/cache";
import * as core from "@actions/core";
import { Events, Inputs, Outputs, State } from "./constants";
import * as custom from "./custom/cache";
import {
IStateProvider,
NullStateProvider,
@ -9,7 +10,6 @@ import {
} from "./stateProvider";
import * as utils from "./utils/actionUtils";
import * as custom from "./custom/cache";
const canSaveToS3 = process.env["RUNS_ON_S3_BUCKET_CACHE"] !== undefined;
export async function restoreImpl(