From 9fca99644036ceb35e403275c0a8957f18245e69 Mon Sep 17 00:00:00 2001 From: Fernandez Ludovic Date: Mon, 8 Sep 2025 13:06:28 +0200 Subject: [PATCH] chore: generate --- dist/post_run/index.js | 98 ++++++++++++++++++++++++++++++++---------- dist/run/index.js | 98 ++++++++++++++++++++++++++++++++---------- 2 files changed, 150 insertions(+), 46 deletions(-) diff --git a/dist/post_run/index.js b/dist/post_run/index.js index 63d717d..f0310c7 100644 --- a/dist/post_run/index.js +++ b/dist/post_run/index.js @@ -48,6 +48,7 @@ const cacheTwirpClient = __importStar(__nccwpck_require__(6819)); const config_1 = __nccwpck_require__(7606); const tar_1 = __nccwpck_require__(5321); const constants_1 = __nccwpck_require__(8287); +const http_client_1 = __nccwpck_require__(4844); class ValidationError extends Error { constructor(message) { super(message); @@ -84,7 +85,17 @@ function checkKey(key) { * @returns boolean return true if Actions cache service feature is available, otherwise false */ function isFeatureAvailable() { - return !!process.env['ACTIONS_CACHE_URL']; + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + // Check availability based on cache service version + switch (cacheServiceVersion) { + case 'v2': + // For v2, we need ACTIONS_RESULTS_URL + return !!process.env['ACTIONS_RESULTS_URL']; + case 'v1': + default: + // For v1, we only need ACTIONS_CACHE_URL + return !!process.env['ACTIONS_CACHE_URL']; + } } exports.isFeatureAvailable = isFeatureAvailable; /** @@ -169,8 +180,16 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr throw error; } else { - // Supress all non-validation cache related errors because caching should be optional - core.warning(`Failed to restore: ${error.message}`); + // warn on cache restore failure and continue build + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to restore: ${error.message}`); + } + else { + core.warning(`Failed to restore: ${error.message}`); + } } } finally { @@ -223,7 +242,13 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`); return undefined; } - core.info(`Cache hit for: ${request.key}`); + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core.info(`Cache hit for restore-key: ${response.matchedKey}`); + } + else { + core.info(`Cache hit for: ${response.matchedKey}`); + } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { core.info('Lookup only - skipping download'); return response.matchedKey; @@ -248,7 +273,15 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr } else { // Supress all non-validation cache related errors because caching should be optional - core.warning(`Failed to restore: ${error.message}`); + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to restore: ${error.message}`); + } + else { + core.warning(`Failed to restore: ${error.message}`); + } } } finally { @@ -351,7 +384,15 @@ function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { core.info(`Failed to save: ${typedError.message}`); } else { - core.warning(`Failed to save: ${typedError.message}`); + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to save: ${typedError.message}`); + } + else { + core.warning(`Failed to save: ${typedError.message}`); + } } } finally { @@ -447,7 +488,15 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { core.info(`Failed to save: ${typedError.message}`); } else { - core.warning(`Failed to save: ${typedError.message}`); + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to save: ${typedError.message}`); + } + else { + core.warning(`Failed to save: ${typedError.message}`); + } } } finally { @@ -47832,6 +47881,10 @@ class RpcOutputStreamController { cmp: [], }; this._closed = false; + // --- RpcOutputStream async iterator API + // iterator state. + // is undefined when no iterator has been acquired yet. + this._itState = { q: [] }; } // --- RpcOutputStream callback API onNext(callback) { @@ -47931,10 +47984,6 @@ class RpcOutputStreamController { * messages are queued. */ [Symbol.asyncIterator]() { - // init the iterator state, enabling pushIt() - if (!this._itState) { - this._itState = { q: [] }; - } // if we are closed, we are definitely not receiving any more messages. // but we can't let the iterator get stuck. we want to either: // a) finish the new iterator immediately, because we are completed @@ -47967,8 +48016,6 @@ class RpcOutputStreamController { // this either resolves a pending promise, or enqueues the result. pushIt(result) { let state = this._itState; - if (!state) - return; // is the consumer waiting for us? if (state.p) { // yes, consumer is waiting for this promise. @@ -49880,6 +49927,7 @@ const reflection_equals_1 = __nccwpck_require__(4827); const binary_writer_1 = __nccwpck_require__(3957); const binary_reader_1 = __nccwpck_require__(2889); const baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})); +const messageTypeDescriptor = baseDescriptors[message_type_contract_1.MESSAGE_TYPE] = {}; /** * This standard message type provides reflection-based * operations to work with a message. @@ -49890,7 +49938,8 @@ class MessageType { this.typeName = name; this.fields = fields.map(reflection_info_1.normalizeFieldInfo); this.options = options !== null && options !== void 0 ? options : {}; - this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, baseDescriptors), { [message_type_contract_1.MESSAGE_TYPE]: { value: this } })); + messageTypeDescriptor.value = this; + this.messagePrototype = Object.create(null, baseDescriptors); this.refTypeCheck = new reflection_type_check_1.ReflectionTypeCheck(this); this.refJsonReader = new reflection_json_reader_1.ReflectionJsonReader(this); this.refJsonWriter = new reflection_json_writer_1.ReflectionJsonWriter(this); @@ -51407,12 +51456,16 @@ class ReflectionJsonReader { target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]); break; case "enum": + if (jsonValue === null) + continue; let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); if (val === false) continue; target[localName] = val; break; case "scalar": + if (jsonValue === null) + continue; target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); break; } @@ -62822,7 +62875,7 @@ function _resolvePath(name, tmpDir, cb) { cb(null, path.join(parentDir, path.basename(pathToResolve))); }); } else { - fs.realpath(path, cb); + fs.realpath(pathToResolve, cb); } }); } @@ -93835,21 +93888,20 @@ function getAssetURL(versionInfo) { ext = "zip"; break; } - let arch = os_1.default.arch(); - switch (arch) { + let platformArch = "amd64"; + switch (os_1.default.arch()) { case "arm64": - arch = "arm64"; + platformArch = "arm64"; break; case "x64": - arch = "amd64"; + platformArch = "amd64"; break; - case "x32": case "ia32": - arch = "386"; + platformArch = "386"; break; } const noPrefix = versionInfo.TargetVersion.slice(1); - return `https://github.com/golangci/golangci-lint/releases/download/${versionInfo.TargetVersion}/golangci-lint-${noPrefix}-${platform}-${arch}.${ext}`; + return `https://github.com/golangci/golangci-lint/releases/download/${versionInfo.TargetVersion}/golangci-lint-${noPrefix}-${platform}-${platformArch}.${ext}`; } @@ -99204,7 +99256,7 @@ const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, o /***/ ((module) => { "use strict"; -module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.5","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@protobuf-ts/runtime-rpc":"^2.11.1","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","@protobuf-ts/plugin":"^2.9.4","typescript":"^5.2.2"}}'); /***/ }), diff --git a/dist/run/index.js b/dist/run/index.js index d56b35d..37c95b9 100644 --- a/dist/run/index.js +++ b/dist/run/index.js @@ -48,6 +48,7 @@ const cacheTwirpClient = __importStar(__nccwpck_require__(6819)); const config_1 = __nccwpck_require__(7606); const tar_1 = __nccwpck_require__(5321); const constants_1 = __nccwpck_require__(8287); +const http_client_1 = __nccwpck_require__(4844); class ValidationError extends Error { constructor(message) { super(message); @@ -84,7 +85,17 @@ function checkKey(key) { * @returns boolean return true if Actions cache service feature is available, otherwise false */ function isFeatureAvailable() { - return !!process.env['ACTIONS_CACHE_URL']; + const cacheServiceVersion = (0, config_1.getCacheServiceVersion)(); + // Check availability based on cache service version + switch (cacheServiceVersion) { + case 'v2': + // For v2, we need ACTIONS_RESULTS_URL + return !!process.env['ACTIONS_RESULTS_URL']; + case 'v1': + default: + // For v1, we only need ACTIONS_CACHE_URL + return !!process.env['ACTIONS_CACHE_URL']; + } } exports.isFeatureAvailable = isFeatureAvailable; /** @@ -169,8 +180,16 @@ function restoreCacheV1(paths, primaryKey, restoreKeys, options, enableCrossOsAr throw error; } else { - // Supress all non-validation cache related errors because caching should be optional - core.warning(`Failed to restore: ${error.message}`); + // warn on cache restore failure and continue build + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to restore: ${error.message}`); + } + else { + core.warning(`Failed to restore: ${error.message}`); + } } } finally { @@ -223,7 +242,13 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr core.debug(`Cache not found for version ${request.version} of keys: ${keys.join(', ')}`); return undefined; } - core.info(`Cache hit for: ${request.key}`); + const isRestoreKeyMatch = request.key !== response.matchedKey; + if (isRestoreKeyMatch) { + core.info(`Cache hit for restore-key: ${response.matchedKey}`); + } + else { + core.info(`Cache hit for: ${response.matchedKey}`); + } if (options === null || options === void 0 ? void 0 : options.lookupOnly) { core.info('Lookup only - skipping download'); return response.matchedKey; @@ -248,7 +273,15 @@ function restoreCacheV2(paths, primaryKey, restoreKeys, options, enableCrossOsAr } else { // Supress all non-validation cache related errors because caching should be optional - core.warning(`Failed to restore: ${error.message}`); + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to restore: ${error.message}`); + } + else { + core.warning(`Failed to restore: ${error.message}`); + } } } finally { @@ -351,7 +384,15 @@ function saveCacheV1(paths, key, options, enableCrossOsArchive = false) { core.info(`Failed to save: ${typedError.message}`); } else { - core.warning(`Failed to save: ${typedError.message}`); + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to save: ${typedError.message}`); + } + else { + core.warning(`Failed to save: ${typedError.message}`); + } } } finally { @@ -447,7 +488,15 @@ function saveCacheV2(paths, key, options, enableCrossOsArchive = false) { core.info(`Failed to save: ${typedError.message}`); } else { - core.warning(`Failed to save: ${typedError.message}`); + // Log server errors (5xx) as errors, all other errors as warnings + if (typedError instanceof http_client_1.HttpClientError && + typeof typedError.statusCode === 'number' && + typedError.statusCode >= 500) { + core.error(`Failed to save: ${typedError.message}`); + } + else { + core.warning(`Failed to save: ${typedError.message}`); + } } } finally { @@ -47832,6 +47881,10 @@ class RpcOutputStreamController { cmp: [], }; this._closed = false; + // --- RpcOutputStream async iterator API + // iterator state. + // is undefined when no iterator has been acquired yet. + this._itState = { q: [] }; } // --- RpcOutputStream callback API onNext(callback) { @@ -47931,10 +47984,6 @@ class RpcOutputStreamController { * messages are queued. */ [Symbol.asyncIterator]() { - // init the iterator state, enabling pushIt() - if (!this._itState) { - this._itState = { q: [] }; - } // if we are closed, we are definitely not receiving any more messages. // but we can't let the iterator get stuck. we want to either: // a) finish the new iterator immediately, because we are completed @@ -47967,8 +48016,6 @@ class RpcOutputStreamController { // this either resolves a pending promise, or enqueues the result. pushIt(result) { let state = this._itState; - if (!state) - return; // is the consumer waiting for us? if (state.p) { // yes, consumer is waiting for this promise. @@ -49880,6 +49927,7 @@ const reflection_equals_1 = __nccwpck_require__(4827); const binary_writer_1 = __nccwpck_require__(3957); const binary_reader_1 = __nccwpck_require__(2889); const baseDescriptors = Object.getOwnPropertyDescriptors(Object.getPrototypeOf({})); +const messageTypeDescriptor = baseDescriptors[message_type_contract_1.MESSAGE_TYPE] = {}; /** * This standard message type provides reflection-based * operations to work with a message. @@ -49890,7 +49938,8 @@ class MessageType { this.typeName = name; this.fields = fields.map(reflection_info_1.normalizeFieldInfo); this.options = options !== null && options !== void 0 ? options : {}; - this.messagePrototype = Object.create(null, Object.assign(Object.assign({}, baseDescriptors), { [message_type_contract_1.MESSAGE_TYPE]: { value: this } })); + messageTypeDescriptor.value = this; + this.messagePrototype = Object.create(null, baseDescriptors); this.refTypeCheck = new reflection_type_check_1.ReflectionTypeCheck(this); this.refJsonReader = new reflection_json_reader_1.ReflectionJsonReader(this); this.refJsonWriter = new reflection_json_writer_1.ReflectionJsonWriter(this); @@ -51407,12 +51456,16 @@ class ReflectionJsonReader { target[localName] = field.T().internalJsonRead(jsonValue, options, target[localName]); break; case "enum": + if (jsonValue === null) + continue; let val = this.enum(field.T(), jsonValue, field.name, options.ignoreUnknownFields); if (val === false) continue; target[localName] = val; break; case "scalar": + if (jsonValue === null) + continue; target[localName] = this.scalar(jsonValue, field.T, field.L, field.name); break; } @@ -62822,7 +62875,7 @@ function _resolvePath(name, tmpDir, cb) { cb(null, path.join(parentDir, path.basename(pathToResolve))); }); } else { - fs.realpath(path, cb); + fs.realpath(pathToResolve, cb); } }); } @@ -93835,21 +93888,20 @@ function getAssetURL(versionInfo) { ext = "zip"; break; } - let arch = os_1.default.arch(); - switch (arch) { + let platformArch = "amd64"; + switch (os_1.default.arch()) { case "arm64": - arch = "arm64"; + platformArch = "arm64"; break; case "x64": - arch = "amd64"; + platformArch = "amd64"; break; - case "x32": case "ia32": - arch = "386"; + platformArch = "386"; break; } const noPrefix = versionInfo.TargetVersion.slice(1); - return `https://github.com/golangci/golangci-lint/releases/download/${versionInfo.TargetVersion}/golangci-lint-${noPrefix}-${platform}-${arch}.${ext}`; + return `https://github.com/golangci/golangci-lint/releases/download/${versionInfo.TargetVersion}/golangci-lint-${noPrefix}-${platform}-${platformArch}.${ext}`; } @@ -99204,7 +99256,7 @@ const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, o /***/ ((module) => { "use strict"; -module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.3","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","@protobuf-ts/plugin":"^2.9.4","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","typescript":"^5.2.2"}}'); +module.exports = /*#__PURE__*/JSON.parse('{"name":"@actions/cache","version":"4.0.5","preview":true,"description":"Actions cache lib","keywords":["github","actions","cache"],"homepage":"https://github.com/actions/toolkit/tree/main/packages/cache","license":"MIT","main":"lib/cache.js","types":"lib/cache.d.ts","directories":{"lib":"lib","test":"__tests__"},"files":["lib","!.DS_Store"],"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/actions/toolkit.git","directory":"packages/cache"},"scripts":{"audit-moderate":"npm install && npm audit --json --audit-level=moderate > audit.json","test":"echo \\"Error: run tests from root\\" && exit 1","tsc":"tsc"},"bugs":{"url":"https://github.com/actions/toolkit/issues"},"dependencies":{"@actions/core":"^1.11.1","@actions/exec":"^1.0.1","@actions/glob":"^0.1.0","@protobuf-ts/runtime-rpc":"^2.11.1","@actions/http-client":"^2.1.1","@actions/io":"^1.0.1","@azure/abort-controller":"^1.1.0","@azure/ms-rest-js":"^2.6.0","@azure/storage-blob":"^12.13.0","semver":"^6.3.1"},"devDependencies":{"@types/node":"^22.13.9","@types/semver":"^6.0.0","@protobuf-ts/plugin":"^2.9.4","typescript":"^5.2.2"}}'); /***/ }),