Unverified Commit 4c8d89b2 authored by Daz DeBoer's avatar Daz DeBoer Committed by GitHub
Browse files

Update @actions/cache4.0.0 and patch (#479)

I have updated the version of actions/cache to 4.0.0 and updated the
patch file.
parents 088ea2ca ed3e5e5c
Loading
Loading
Loading
Loading
+63 −53
Changes for sources/package-lock.json: 63 added lines, 53 removed lines.
Original line number Diff line number Diff line
@@ -11,7 +11,7 @@
      "license": "MIT",
      "dependencies": {
        "@actions/artifact": "2.1.11",
        "@actions/cache": "3.3.0",
        "@actions/cache": "4.0.0",
        "@actions/core": "1.11.1",
        "@actions/exec": "1.1.1",
        "@actions/github": "6.0.0",
@@ -199,9 +199,10 @@
      }
    },
    "node_modules/@actions/cache": {
      "version": "3.3.0",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.3.0.tgz",
      "integrity": "sha512-+eCsMTIZUEm+QA9GqjollOhCdvRrZ1JV8d9Rp34zVNizBkYITO8dhKczP5Xps1dFzc5n59p7vYVtZrGt18bb5Q==",
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.0.tgz",
      "integrity": "sha512-WIuxjnZ44lNYtIS4fqSaYvF00hORdy3cSin+jx8xNgBVGWnNIAiCBHjlwusVQlcgExoQC9pHXGrDsZyZr7rCDQ==",
      "license": "MIT",
      "dependencies": {
        "@actions/core": "^1.11.1",
        "@actions/exec": "^1.0.1",
@@ -211,7 +212,9 @@
        "@azure/abort-controller": "^1.1.0",
        "@azure/ms-rest-js": "^2.6.0",
        "@azure/storage-blob": "^12.13.0",
        "semver": "^6.3.1"
        "@protobuf-ts/plugin": "^2.9.4",
        "semver": "^6.3.1",
        "twirp-ts": "^2.5.0"
      }
    },
    "node_modules/@actions/cache/node_modules/@actions/glob": {
@@ -2180,14 +2183,15 @@
      }
    },
    "node_modules/@protobuf-ts/plugin": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.3.tgz",
      "integrity": "sha512-tHYACv+nnIV2eoiMxeZhrgMqGiUktzUzrhfgnROg/rr8TecPLp9v5/yqNibN+bad5k7d57aqlTuQKhFl+J4W/g==",
      "dependencies": {
        "@protobuf-ts/plugin-framework": "^2.9.3",
        "@protobuf-ts/protoc": "^2.9.3",
        "@protobuf-ts/runtime": "^2.9.3",
        "@protobuf-ts/runtime-rpc": "^2.9.3",
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz",
      "integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@protobuf-ts/plugin-framework": "^2.9.4",
        "@protobuf-ts/protoc": "^2.9.4",
        "@protobuf-ts/runtime": "^2.9.4",
        "@protobuf-ts/runtime-rpc": "^2.9.4",
        "typescript": "^3.9"
      },
      "bin": {
@@ -2196,11 +2200,12 @@
      }
    },
    "node_modules/@protobuf-ts/plugin-framework": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.3.tgz",
      "integrity": "sha512-iqdkhAu7fGPvBCVOoAEEFJ1/oaGIBoNIMgSv2WonTNJVHxv5FvvAfWFn6nG/eta34fHRZT38ZXTaYcMUkv8AiQ==",
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz",
      "integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==",
      "license": "(Apache-2.0 AND BSD-3-Clause)",
      "dependencies": {
        "@protobuf-ts/runtime": "^2.9.3",
        "@protobuf-ts/runtime": "^2.9.4",
        "typescript": "^3.9"
      }
    },
@@ -2229,24 +2234,27 @@
      }
    },
    "node_modules/@protobuf-ts/protoc": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.3.tgz",
      "integrity": "sha512-TJ0Ycx/CIBqpB4wpKt6K05kjXj6zv36s/qpdCT/wdJBhpayOVBqLF5NpLp3WIiw1PmIxvqalB6QHKjvnLzGKLA==",
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz",
      "integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ==",
      "license": "Apache-2.0",
      "bin": {
        "protoc": "protoc.js"
      }
    },
    "node_modules/@protobuf-ts/runtime": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.3.tgz",
      "integrity": "sha512-nivzCpg/qYD0RX2OmHOahJALb8ndjGmUhNBcTJ0BbXoqKwCSM6vYA+vegzS3rhuaPgbyC7Ec8idlnizzUfIRuw=="
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz",
      "integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg==",
      "license": "(Apache-2.0 AND BSD-3-Clause)"
    },
    "node_modules/@protobuf-ts/runtime-rpc": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.3.tgz",
      "integrity": "sha512-WelHpctvZeG8yhbb7tnsrLzotq9xjMCXuGuhJ8qMyEdNoBBEodbXseofAYFTebo2/PN2LzyEq3X6vwr5f8jqTA==",
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz",
      "integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==",
      "license": "Apache-2.0",
      "dependencies": {
        "@protobuf-ts/runtime": "^2.9.3"
        "@protobuf-ts/runtime": "^2.9.4"
      }
    },
    "node_modules/@sinclair/typebox": {
@@ -10319,9 +10327,9 @@
      }
    },
    "@actions/cache": {
      "version": "3.3.0",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-3.3.0.tgz",
      "integrity": "sha512-+eCsMTIZUEm+QA9GqjollOhCdvRrZ1JV8d9Rp34zVNizBkYITO8dhKczP5Xps1dFzc5n59p7vYVtZrGt18bb5Q==",
      "version": "4.0.0",
      "resolved": "https://registry.npmjs.org/@actions/cache/-/cache-4.0.0.tgz",
      "integrity": "sha512-WIuxjnZ44lNYtIS4fqSaYvF00hORdy3cSin+jx8xNgBVGWnNIAiCBHjlwusVQlcgExoQC9pHXGrDsZyZr7rCDQ==",
      "requires": {
        "@actions/core": "^1.11.1",
        "@actions/exec": "^1.0.1",
@@ -10331,7 +10339,9 @@
        "@azure/abort-controller": "^1.1.0",
        "@azure/ms-rest-js": "^2.6.0",
        "@azure/storage-blob": "^12.13.0",
        "semver": "^6.3.1"
        "@protobuf-ts/plugin": "^2.9.4",
        "semver": "^6.3.1",
        "twirp-ts": "^2.5.0"
      },
      "dependencies": {
        "@actions/glob": {
@@ -11859,14 +11869,14 @@
      "dev": true
    },
    "@protobuf-ts/plugin": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.3.tgz",
      "integrity": "sha512-tHYACv+nnIV2eoiMxeZhrgMqGiUktzUzrhfgnROg/rr8TecPLp9v5/yqNibN+bad5k7d57aqlTuQKhFl+J4W/g==",
      "requires": {
        "@protobuf-ts/plugin-framework": "^2.9.3",
        "@protobuf-ts/protoc": "^2.9.3",
        "@protobuf-ts/runtime": "^2.9.3",
        "@protobuf-ts/runtime-rpc": "^2.9.3",
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin/-/plugin-2.9.4.tgz",
      "integrity": "sha512-Db5Laq5T3mc6ERZvhIhkj1rn57/p8gbWiCKxQWbZBBl20wMuqKoHbRw4tuD7FyXi+IkwTToaNVXymv5CY3E8Rw==",
      "requires": {
        "@protobuf-ts/plugin-framework": "^2.9.4",
        "@protobuf-ts/protoc": "^2.9.4",
        "@protobuf-ts/runtime": "^2.9.4",
        "@protobuf-ts/runtime-rpc": "^2.9.4",
        "typescript": "^3.9"
      },
      "dependencies": {
@@ -11878,11 +11888,11 @@
      }
    },
    "@protobuf-ts/plugin-framework": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.3.tgz",
      "integrity": "sha512-iqdkhAu7fGPvBCVOoAEEFJ1/oaGIBoNIMgSv2WonTNJVHxv5FvvAfWFn6nG/eta34fHRZT38ZXTaYcMUkv8AiQ==",
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/plugin-framework/-/plugin-framework-2.9.4.tgz",
      "integrity": "sha512-9nuX1kjdMliv+Pes8dQCKyVhjKgNNfwxVHg+tx3fLXSfZZRcUHMc1PMwB9/vTvc6gBKt9QGz5ERqSqZc0++E9A==",
      "requires": {
        "@protobuf-ts/runtime": "^2.9.3",
        "@protobuf-ts/runtime": "^2.9.4",
        "typescript": "^3.9"
      },
      "dependencies": {
@@ -11894,21 +11904,21 @@
      }
    },
    "@protobuf-ts/protoc": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.3.tgz",
      "integrity": "sha512-TJ0Ycx/CIBqpB4wpKt6K05kjXj6zv36s/qpdCT/wdJBhpayOVBqLF5NpLp3WIiw1PmIxvqalB6QHKjvnLzGKLA=="
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/protoc/-/protoc-2.9.4.tgz",
      "integrity": "sha512-hQX+nOhFtrA+YdAXsXEDrLoGJqXHpgv4+BueYF0S9hy/Jq0VRTVlJS1Etmf4qlMt/WdigEes5LOd/LDzui4GIQ=="
    },
    "@protobuf-ts/runtime": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.3.tgz",
      "integrity": "sha512-nivzCpg/qYD0RX2OmHOahJALb8ndjGmUhNBcTJ0BbXoqKwCSM6vYA+vegzS3rhuaPgbyC7Ec8idlnizzUfIRuw=="
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime/-/runtime-2.9.4.tgz",
      "integrity": "sha512-vHRFWtJJB/SiogWDF0ypoKfRIZ41Kq+G9cEFj6Qm1eQaAhJ1LDFvgZ7Ja4tb3iLOQhz0PaoPnnOijF1qmEqTxg=="
    },
    "@protobuf-ts/runtime-rpc": {
      "version": "2.9.3",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.3.tgz",
      "integrity": "sha512-WelHpctvZeG8yhbb7tnsrLzotq9xjMCXuGuhJ8qMyEdNoBBEodbXseofAYFTebo2/PN2LzyEq3X6vwr5f8jqTA==",
      "version": "2.9.4",
      "resolved": "https://registry.npmjs.org/@protobuf-ts/runtime-rpc/-/runtime-rpc-2.9.4.tgz",
      "integrity": "sha512-y9L9JgnZxXFqH5vD4d7j9duWvIJ7AShyBRoNKJGhu9Q27qIbchfzli66H9RvrQNIFk5ER7z1Twe059WZGqERcA==",
      "requires": {
        "@protobuf-ts/runtime": "^2.9.3"
        "@protobuf-ts/runtime": "^2.9.4"
      }
    },
    "@sinclair/typebox": {
+1 −1
Changes for sources/package.json: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@
  "license": "MIT",
  "dependencies": {
    "@actions/artifact": "2.1.11",
    "@actions/cache": "3.3.0",
    "@actions/cache": "4.0.0",
    "@actions/core": "1.11.1",
    "@actions/exec": "1.1.1",
    "@actions/github": "6.0.0",
+81 −12
Changes for sources/patches/@actions+cache+4.0.0.patch: 81 added lines, 12 removed lines.
Original line number Diff line number Diff line
diff --git a/node_modules/@actions/cache/lib/cache.d.ts b/node_modules/@actions/cache/lib/cache.d.ts
index 4658366..b796e58 100644
index ef0928b..e011501 100644
--- a/node_modules/@actions/cache/lib/cache.d.ts
+++ b/node_modules/@actions/cache/lib/cache.d.ts
@@ -21,7 +21,7 @@ export declare function isFeatureAvailable(): boolean;
@@ -21,8 +21,7 @@ export declare function isFeatureAvailable(): boolean;
  * @param enableCrossOsArchive an optional boolean enabled to restore on windows any cache created on any platform
  * @returns string returns the key for the cache hit, otherwise returns undefined
  */
-export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<string | undefined>;
+export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry | undefined>;
 /**
-/**
+export declare function restoreCache(paths: string[], primaryKey: string, restoreKeys?: string[], options?: DownloadOptions, enableCrossOsArchive?: boolean): Promise<CacheEntry | undefined>;/**
  * Saves a list of files with the specified key
  *
@@ -31,4 +31,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
  * @param paths a list of file paths to be cached
@@ -31,4 +30,12 @@ export declare function restoreCache(paths: string[], primaryKey: string, restor
  * @param options cache upload options
  * @returns number returns cacheId if the cache was saved successfully and throws an error if save fails
  */
@@ -25,11 +26,12 @@ index 4658366..b796e58 100644
+    size?: number;
+    constructor(key: string, size?: number);
+}
\ No newline at end of file
diff --git a/node_modules/@actions/cache/lib/cache.js b/node_modules/@actions/cache/lib/cache.js
index 9d636aa..a176bd7 100644
index 45201b6..f3a26d2 100644
--- a/node_modules/@actions/cache/lib/cache.js
+++ b/node_modules/@actions/cache/lib/cache.js
@@ -127,18 +127,21 @@ function restoreCache(paths, primaryKey, restoreKeys, options, enableCrossOsArch
@@ -154,18 +154,20 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr
             core.info(`Cache Size: ~${Math.round(archiveFileSize / (1024 * 1024))} MB (${archiveFileSize} B)`);
             yield (0, tar_1.extractTar)(archivePath, compressionMethod);
             core.info('Cache restored successfully');
@@ -44,7 +46,6 @@ index 9d636aa..a176bd7 100644
-                // Supress all non-validation cache related errors because caching should be optional
-                core.warning(`Failed to restore: ${error.message}`);
-            }
+
+            // PATCHED - Return more inforamtion about restored entry
+            return new CacheEntry(cacheEntry.cacheKey, archiveFileSize);;
         }
@@ -62,10 +63,78 @@ index 9d636aa..a176bd7 100644
         finally {
             // Try to delete the archive to save space
             try {
@@ -206,19 +209,23 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
@@ -232,18 +234,20 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr
             }
             yield (0, tar_1.extractTar)(archivePath, compressionMethod);
             core.info('Cache restored successfully');
-            return response.matchedKey;
-        }
-        catch (error) {
-            const typedError = error;
-            if (typedError.name === ValidationError.name) {
-                throw error;
-            }
-            else {
-                // Supress all non-validation cache related errors because caching should be optional
-                core.warning(`Failed to restore: ${error.message}`);
-            }
+            // PATCHED - Return more inforamtion about restored entry
+            return new CacheEntry(response.matchedKey, archiveFileSize);;
         }
+            // PATCHED - propagate errors
+            // catch (error) {
+            //     const typedError = error;
+            //     if (typedError.name === ValidationError.name) {
+            //         throw error;
+            //     }
+            //     else {
+            //         // Supress all non-validation cache related errors because caching should be optional
+            //         core.warning(`Failed to restore: ${error.message}`);
+            //     }
+            // }
         finally {
             try {
                 if (archivePath) {
@@ -334,19 +338,23 @@ function saveCacheV1(paths, key, options, enableCrossOsArchive = false) {
             }
             core.debug(`Saving Cache (ID: ${cacheId})`);
             yield cacheHttpClient.saveCache(cacheId, archivePath, options);
             yield cacheHttpClient.saveCache(cacheId, archivePath, '', options);
+
+            // PATCHED - Return more inforamtion about saved entry
+            return new CacheEntry(key, archiveFileSize);
         }
-        catch (error) {
-            const typedError = error;
-            if (typedError.name === ValidationError.name) {
-                throw error;
-            }
-            else if (typedError.name === ReserveCacheError.name) {
-                core.info(`Failed to save: ${typedError.message}`);
-            }
-            else {
-                core.warning(`Failed to save: ${typedError.message}`);
-            }
-        }
+            // PATCHED - propagate errors
+            // catch (error) {
+            //     const typedError = error;
+            //     if (typedError.name === ValidationError.name) {
+            //         throw error;
+            //     }
+            //     else if (typedError.name === ReserveCacheError.name) {
+            //         core.info(`Failed to save: ${typedError.message}`);
+            //     }
+            //     else {
+            //         core.warning(`Failed to save: ${typedError.message}`);
+            //     }
+            // }
         finally {
             // Try to delete the archive to save space
             try {
@@ -422,19 +430,23 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
                 throw new Error(`Unable to finalize cache with key ${key}, another job may be finalizing this cache.`);
             }
             cacheId = parseInt(finalizeResponse.entryId);
+
+            // PATCHED - Return more inforamtion about saved entry
+            return new CacheEntry(key, archiveFileSize);
@@ -98,10 +167,10 @@ index 9d636aa..a176bd7 100644
         finally {
             // Try to delete the archive to save space
             try {
@@ -232,4 +239,11 @@ function saveCache(paths, key, options, enableCrossOsArchive = false) {
@@ -447,4 +459,11 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) {
         return cacheId;
     });
 }
 exports.saveCache = saveCache;
+class CacheEntry {
+    constructor(key, size) {
+        this.key = key;