From 559c3e249c5c0601de508bc8ae7acf8e792185d3 Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Wed, 29 May 2024 15:18:32 -0300 Subject: [PATCH 1/4] Update detsys-ts --- dist/index.js | 236 +++++++++++++++++++++++++++------------------ package.json | 2 +- pnpm-lock.yaml | 257 +++++++++++++++++++++++++------------------------ 3 files changed, 273 insertions(+), 222 deletions(-) diff --git a/dist/index.js b/dist/index.js index 98b15f3..e54fdc2 100644 --- a/dist/index.js +++ b/dist/index.js @@ -39513,7 +39513,7 @@ module.exports = { parallel : __nccwpck_require__(644), serial : __nccwpck_require__(4501), - serialOrdered : __nccwpck_require__(3958) + serialOrdered : __nccwpck_require__(2362) }; @@ -39844,7 +39844,7 @@ function parallel(list, iterator, callback) /***/ 4501: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { -var serialOrdered = __nccwpck_require__(3958); +var serialOrdered = __nccwpck_require__(2362); // Public API module.exports = serial; @@ -39865,7 +39865,7 @@ function serial(list, iterator, callback) /***/ }), -/***/ 3958: +/***/ 2362: /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => { var iterate = __nccwpck_require__(5748) @@ -47866,7 +47866,7 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, /***/ }), -/***/ 1538: +/***/ 4438: /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => { ;(function (sax) { // wrapper for non-node envs @@ -47942,6 +47942,12 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, parser.ns = Object.create(rootNS) } + // disallow unquoted attribute values if not otherwise configured + // and strict mode is true + if (parser.opt.unquotedAttributeValues === undefined) { + parser.opt.unquotedAttributeValues = !strict; + } + // mostly just for error reporting parser.trackPosition = parser.opt.position !== false if (parser.trackPosition) { @@ -48961,15 +48967,22 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, continue case S.SGML_DECL: - if ((parser.sgmlDecl + c).toUpperCase() === CDATA) { + if (parser.sgmlDecl + c === '--') { + parser.state = S.COMMENT + parser.comment = '' + parser.sgmlDecl = '' + continue; + } + + if (parser.doctype && parser.doctype !== true && parser.sgmlDecl) { + parser.state = S.DOCTYPE_DTD + parser.doctype += ' new Promise((resolve, continue case S.DOCTYPE_DTD: - parser.doctype += c if (c === ']') { + parser.doctype += c parser.state = S.DOCTYPE + } else if (c === '<') { + parser.state = S.OPEN_WAKA + parser.startTagPosition = parser.position } else if (isQuote(c)) { + parser.doctype += c parser.state = S.DOCTYPE_DTD_QUOTED parser.q = c + } else { + parser.doctype += c } continue @@ -49069,6 +49088,8 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, // which is a comment of " blah -- bloo " parser.comment += '--' + c parser.state = S.COMMENT + } else if (parser.doctype && parser.doctype !== true) { + parser.state = S.DOCTYPE_DTD } else { parser.state = S.TEXT } @@ -49236,7 +49257,9 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, parser.q = c parser.state = S.ATTRIB_VALUE_QUOTED } else { - strictFail(parser, 'Unquoted attribute value') + if (!parser.opt.unquotedAttributeValues) { + error(parser, 'Unquoted attribute value') + } parser.state = S.ATTRIB_VALUE_UNQUOTED parser.attribValue = c } @@ -49354,13 +49377,13 @@ module.exports = (options = {}, connect = tls.connect) => new Promise((resolve, } if (c === ';') { - if (parser.opt.unparsedEntities) { - var parsedEntity = parseEntity(parser) + var parsedEntity = parseEntity(parser) + if (parser.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) { parser.entity = '' parser.state = returnState parser.write(parsedEntity) } else { - parser[buffer] += parseEntity(parser) + parser[buffer] += parsedEntity parser.entity = '' parser.state = returnState } @@ -77136,7 +77159,7 @@ module.exports.implForWrapper = function (wrapper) { extend = function(child, parent) { for (var key in parent) { if (hasProp.call(parent, key)) child[key] = parent[key]; } function ctor() { this.constructor = child; } ctor.prototype = parent.prototype; child.prototype = new ctor(); child.__super__ = parent.prototype; return child; }, hasProp = {}.hasOwnProperty; - sax = __nccwpck_require__(1538); + sax = __nccwpck_require__(4438); events = __nccwpck_require__(2361); @@ -93710,7 +93733,7 @@ const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(impo const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@ed02129aed8e4d6402d920152652877189bece70_3whmnlhrx56zhgtsjnkrhnutfu/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@5fcb0532d85556ebc2de286e483885976531339d_uqngfub4ls4loys67iy653x57e/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -94018,6 +94041,7 @@ function hashEnvironmentVariables(prefix, variables) { var inputs_exports = {}; __export(inputs_exports, { getArrayOfStrings: () => getArrayOfStrings, + getArrayOfStringsOrNull: () => getArrayOfStringsOrNull, getBool: () => getBool, getMultilineStringOrNull: () => getMultilineStringOrNull, getNumberOrNull: () => getNumberOrNull, @@ -94034,6 +94058,14 @@ var getArrayOfStrings = (name, separator) => { const original = getString(name); return handleString(original, separator); }; +var getArrayOfStringsOrNull = (name, separator) => { + const original = getStringOrNull(name); + if (original === null) { + return null; + } else { + return handleString(original, separator); + } +}; var handleString = (input, separator) => { const sepChar = separator === "comma" ? "," : /\s+/; const trimmed = input.trim(); @@ -94165,6 +94197,19 @@ function noisilyGetInput(suffix, legacyPrefix) { + +// src/errors.ts +function stringifyError(e) { + if (e instanceof Error) { + return e.message; + } else if (typeof e === "string") { + return e; + } else { + return JSON.stringify(e); + } +} + +// src/index.ts var DEFAULT_IDS_HOST = "https://install.determinate.systems"; var IDS_HOST = process.env["IDS_HOST"] ?? DEFAULT_IDS_HOST; var EVENT_EXCEPTION = "exception"; @@ -94172,6 +94217,7 @@ var EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit"; var EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss"; var EVENT_ARTIFACT_CACHE_PERSIST = "artifact_cache_persist"; var EVENT_PREFLIGHT_REQUIRE_NIX_DENIED = "preflight-require-nix-denied"; +var FACT_ARTIFACT_FETCHED_FROM_CACHE = "artifact_fetched_from_cache"; var FACT_ENDED_WITH_EXCEPTION = "ended_with_exception"; var FACT_FINAL_EXCEPTION = "final_exception"; var FACT_OS = "$os"; @@ -94186,6 +94232,7 @@ var FACT_NIX_STORE_CHECK_ERROR = "nix_store_check_error"; var STATE_KEY_EXECUTION_PHASE = "detsys_action_execution_phase"; var STATE_KEY_NIX_NOT_FOUND = "detsys_action_nix_not_found"; var STATE_NOT_FOUND = "not-found"; +var DIAGNOSTIC_ENDPOINT_TIMEOUT_MS = 3e4; var DetSysAction = class { determineExecutionPhase() { const currentPhase = core.getState(STATE_KEY_EXECUTION_PHASE); @@ -94251,7 +94298,7 @@ var DetSysAction = class { } }).catch((e) => { core.debug( - `Failure getting platform details: ${stringifyError(e)}` + `Failure getting platform details: ${stringifyError2(e)}` ); }); } @@ -94284,16 +94331,6 @@ var DetSysAction = class { stapleFile(name, location) { this.exceptionAttachments.set(name, location); } - setExecutionPhase() { - const phase = core.getState(STATE_KEY_EXECUTION_PHASE); - if (phase === "") { - core.saveState(STATE_KEY_EXECUTION_PHASE, "post"); - this.executionPhase = "main"; - } else { - this.executionPhase = "post"; - } - this.facts.execution_phase = this.executionPhase; - } /** * Execute the Action as defined. */ @@ -94303,7 +94340,55 @@ var DetSysAction = class { process.exitCode = 1; }); } - // Whether the + getTemporaryName() { + const tmpDir = process.env["RUNNER_TEMP"] || (0,external_node_os_.tmpdir)(); + return external_node_path_namespaceObject.join(tmpDir, `${this.actionOptions.name}-${(0,external_node_crypto_namespaceObject.randomUUID)()}`); + } + addFact(key, value) { + this.facts[key] = value; + } + getDiagnosticsUrl() { + return this.actionOptions.diagnosticsUrl; + } + getUniqueId() { + return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)(); + } + getCorrelationHashes() { + return this.identity; + } + recordEvent(eventName, context = {}) { + this.events.push({ + event_name: `${this.actionOptions.eventPrefix}${eventName}`, + context, + correlation: this.identity, + facts: this.facts, + timestamp: /* @__PURE__ */ new Date(), + uuid: (0,external_node_crypto_namespaceObject.randomUUID)() + }); + } + /** + * Unpacks the closure returned by `fetchArtifact()`, imports the + * contents into the Nix store, and returns the path of the executable at + * `/nix/store/STORE_PATH/bin/${bin}`. + */ + async unpackClosure(bin) { + const artifact = await this.fetchArtifact(); + const { stdout } = await (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.exec)( + `cat "${artifact}" | xz -d | nix-store --import` + ); + const paths = stdout.split(external_node_os_.EOL); + const lastPath = paths.at(-2); + return `${lastPath}/bin/${bin}`; + } + /** + * Fetches the executable at the URL determined by the `source-*` inputs and + * other facts, `chmod`s it, and returns the path to the executable on disk. + */ + async fetchExecutable() { + const binaryPath = await this.fetchArtifact(); + await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP); + return binaryPath; + } get isMain() { return this.executionPhase === "main"; } @@ -94330,7 +94415,7 @@ var DetSysAction = class { this.addFact(FACT_ENDED_WITH_EXCEPTION, false); } catch (e) { this.addFact(FACT_ENDED_WITH_EXCEPTION, true); - const reportable = stringifyError(e); + const reportable = stringifyError2(e); this.addFact(FACT_FINAL_EXCEPTION, reportable); if (this.isPost) { core.warning(reportable); @@ -94350,7 +94435,7 @@ var DetSysAction = class { } catch (innerError) { exceptionContext.set( `staple_failure_${attachmentLabel}`, - stringifyError(innerError) + stringifyError2(innerError) ); } } @@ -94359,52 +94444,25 @@ var DetSysAction = class { await this.complete(); } } - addFact(key, value) { - this.facts[key] = value; - } - getDiagnosticsUrl() { - return this.actionOptions.diagnosticsUrl; - } - getUniqueId() { - return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)(); - } - getCorrelationHashes() { - return this.identity; - } - recordEvent(eventName, context = {}) { - this.events.push({ - event_name: `${this.actionOptions.eventPrefix}${eventName}`, - context, - correlation: this.identity, - facts: this.facts, - timestamp: /* @__PURE__ */ new Date(), - uuid: (0,external_node_crypto_namespaceObject.randomUUID)() - }); - } /** - * Fetches a file in `.xz` format, imports its contents into the Nix store, - * and returns the path of the executable at `/nix/store/STORE_PATH/bin/${bin}`. - */ - async unpackClosure(bin) { - const artifact = this.fetchArtifact(); - const { stdout } = await (0,external_node_util_.promisify)(external_node_child_process_namespaceObject.exec)( - `cat "${artifact}" | xz -d | nix-store --import` - ); - const paths = stdout.split(external_node_os_.EOL); - const lastPath = paths.at(-2); - return `${lastPath}/bin/${bin}`; - } - /** - * Fetch an artifact, such as a tarball, from the URL determined by the `source-*` - * inputs and other factors. + * Fetch an artifact, such as a tarball, from the location determined by the + * `source-*` inputs. If `source-binary` is specified, this will return a path + * to a binary on disk; otherwise, the artifact will be downloaded from the + * URL determined by the other `source-*` inputs (`source-url`, `source-pr`, + * etc.). */ async fetchArtifact() { + const sourceBinary = getStringOrNull("source-binary"); + if (sourceBinary !== null && sourceBinary !== "") { + core.debug(`Using the provided source binary at ${sourceBinary}`); + return sourceBinary; + } core.startGroup( `Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}` ); try { - core.info(`Fetching from ${this.getUrl()}`); - const correlatedUrl = this.getUrl(); + core.info(`Fetching from ${this.getSourceUrl()}`); + const correlatedUrl = this.getSourceUrl(); correlatedUrl.searchParams.set("ci", "github"); correlatedUrl.searchParams.set( "correlation", @@ -94415,16 +94473,16 @@ var DetSysAction = class { const v = versionCheckup.headers.etag; this.addFact(FACT_SOURCE_URL_ETAG, v); core.debug( - `Checking the tool cache for ${this.getUrl()} at ${v}` + `Checking the tool cache for ${this.getSourceUrl()} at ${v}` ); const cached = await this.getCachedVersion(v); if (cached) { - this.facts["artifact_fetched_from_cache"] = true; + this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = true; core.debug(`Tool cache hit.`); return cached; } } - this.facts["artifact_fetched_from_cache"] = false; + this.facts[FACT_ARTIFACT_FETCHED_FROM_CACHE] = false; core.debug( `No match from the cache, re-fetching from the redirect: ${versionCheckup.url}` ); @@ -94442,7 +94500,7 @@ var DetSysAction = class { try { await this.saveCachedVersion(v, destFile); } catch (e) { - core.debug(`Error caching the artifact: ${stringifyError(e)}`); + core.debug(`Error caching the artifact: ${stringifyError2(e)}`); } } return destFile; @@ -94450,15 +94508,6 @@ var DetSysAction = class { core.endGroup(); } } - /** - * Fetches the executable at the URL determined by the `source-*` inputs and - * other facts, `chmod`s it, and returns the path to the executable on disk. - */ - async fetchExecutable() { - const binaryPath = await this.fetchArtifact(); - await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP); - return binaryPath; - } /** * A helper function for failing on error only if strict mode is enabled. * This is intended only for CI environments testing Actions themselves. @@ -94472,7 +94521,7 @@ var DetSysAction = class { this.recordEvent(`complete_${this.executionPhase}`); await this.submitEvents(); } - getUrl() { + getSourceUrl() { const p = this.sourceParameters; if (p.url) { this.addFact(FACT_SOURCE_URL, p.url); @@ -94630,7 +94679,7 @@ var DetSysAction = class { } this.addFact(FACT_NIX_STORE_VERSION, JSON.stringify(parsed.version)); } catch (e) { - this.addFact(FACT_NIX_STORE_CHECK_ERROR, stringifyError(e)); + this.addFact(FACT_NIX_STORE_CHECK_ERROR, stringifyError2(e)); } } async submitEvents() { @@ -94648,21 +94697,20 @@ var DetSysAction = class { }; try { await this.client.post(this.actionOptions.diagnosticsUrl, { - json: batch + json: batch, + timeout: { + request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS + } }); } catch (e) { core.debug( - `Error submitting diagnostics event: ${stringifyError(e)}` + `Error submitting diagnostics event: ${stringifyError2(e)}` ); } this.events = []; } - getTemporaryName() { - const _tmpdir = process.env["RUNNER_TEMP"] || (0,external_node_os_.tmpdir)(); - return external_node_path_namespaceObject.join(_tmpdir, `${this.actionOptions.name}-${(0,external_node_crypto_namespaceObject.randomUUID)()}`); - } }; -function stringifyError(error2) { +function stringifyError2(error2) { return error2 instanceof Error || typeof error2 == "string" ? error2.toString() : JSON.stringify(error2); } function makeOptionsConfident(actionOptions) { @@ -94700,7 +94748,7 @@ function determineDiagnosticsUrl(idsProjectName, urlOption) { return mungeDiagnosticEndpoint(new URL(providedDiagnosticEndpoint)); } catch (e) { core.info( - `User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError(e)}` + `User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}` ); } } @@ -94712,7 +94760,7 @@ function determineDiagnosticsUrl(idsProjectName, urlOption) { return diagnosticUrl; } catch (e) { core.info( - `Generated diagnostic endpoint ignored: not a valid URL: ${stringifyError(e)}` + `Generated diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}` ); } return void 0; @@ -94734,7 +94782,7 @@ function mungeDiagnosticEndpoint(inputUrl) { return inputUrl; } catch (e) { core.info( - `Default or overridden IDS host isn't a valid URL: ${stringifyError(e)}` + `Default or overridden IDS host isn't a valid URL: ${stringifyError2(e)}` ); } return inputUrl; diff --git a/package.json b/package.json index b88edca..0befb27 100644 --- a/package.json +++ b/package.json @@ -32,7 +32,7 @@ }, "devDependencies": { "@trivago/prettier-plugin-sort-imports": "^4.3.0", - "@typescript-eslint/eslint-plugin": "^7.10.0", + "@typescript-eslint/eslint-plugin": "^7.11.0", "@vercel/ncc": "^0.38.1", "eslint": "^8.57.0", "eslint-import-resolver-typescript": "^3.6.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 1dbf8dd..c0fb508 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,15 +13,15 @@ dependencies: version: 1.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/ed02129aed8e4d6402d920152652877189bece70 + version: github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d devDependencies: '@trivago/prettier-plugin-sort-imports': specifier: ^4.3.0 version: 4.3.0(prettier@3.2.5) '@typescript-eslint/eslint-plugin': - specifier: ^7.10.0 - version: 7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5) + specifier: ^7.11.0 + version: 7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5) '@vercel/ncc': specifier: ^0.38.1 version: 0.38.1 @@ -30,13 +30,13 @@ devDependencies: version: 8.57.0 eslint-import-resolver-typescript: specifier: ^3.6.1 - version: 3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + version: 3.6.1(@typescript-eslint/parser@7.11.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) eslint-plugin-github: specifier: ^4.10.2 version: 4.10.2(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-import: specifier: ^2.29.1 - version: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + version: 2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-prettier: specifier: ^5.1.3 version: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) @@ -219,11 +219,11 @@ packages: - encoding dev: false - /@babel/code-frame@7.24.2: - resolution: {integrity: sha512-y5+tLQyV8pg3fsiln67BVLD1P13Eg4lh5RW9mF0zUuvLrv9uIQ4MCL+CRT+FTsBlBjcIan6PGsLcBN0m3ClUyQ==} + /@babel/code-frame@7.24.6: + resolution: {integrity: sha512-ZJhac6FkEd1yhG2AHOmfcXG4ceoLltoCVJjN5XsWN9BifBQr+cHJbWi0h68HZuSORq+3WtJ2z0hwF2NG1b5kcA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.24.5 + '@babel/highlight': 7.24.6 picocolors: 1.0.1 dev: true @@ -236,99 +236,99 @@ packages: source-map: 0.5.7 dev: true - /@babel/generator@7.24.5: - resolution: {integrity: sha512-x32i4hEXvr+iI0NEoEfDKzlemF8AmtOP8CcrRaEcpzysWuoEb1KknpcvMsHKPONoKZiDuItklgWhB18xEhr9PA==} + /@babel/generator@7.24.6: + resolution: {integrity: sha512-S7m4eNa6YAPJRHmKsLHIDJhNAGNKoWNiWefz1MBbpnt8g9lvMDl1hir4P9bo/57bQEmuwEhnRU/AMWsD0G/Fbg==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 '@jridgewell/gen-mapping': 0.3.5 '@jridgewell/trace-mapping': 0.3.25 jsesc: 2.5.2 dev: true - /@babel/helper-environment-visitor@7.22.20: - resolution: {integrity: sha512-zfedSIzFhat/gFhWfHtgWvlec0nqB9YEIVrpuwjruLlXfUSnA8cJB0miHKwqDnQ7d32aKo2xt88/xZptwxbfhA==} + /@babel/helper-environment-visitor@7.24.6: + resolution: {integrity: sha512-Y50Cg3k0LKLMjxdPjIl40SdJgMB85iXn27Vk/qbHZCFx/o5XO3PSnpi675h1KEmmDb6OFArfd5SCQEQ5Q4H88g==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-function-name@7.23.0: - resolution: {integrity: sha512-OErEqsrxjZTJciZ4Oo+eoZqeW9UIiOcuYKRJA4ZAgV9myA+pOXhhmpfNCKjEH/auVfEYVFJ6y1Tc4r0eIApqiw==} + /@babel/helper-function-name@7.24.6: + resolution: {integrity: sha512-xpeLqeeRkbxhnYimfr2PC+iA0Q7ljX/d1eZ9/inYbmfG2jpl8Lu3DyXvpOAnrS5kxkfOWJjioIMQsaMBXFI05w==} engines: {node: '>=6.9.0'} dependencies: - '@babel/template': 7.24.0 - '@babel/types': 7.24.5 + '@babel/template': 7.24.6 + '@babel/types': 7.24.6 dev: true - /@babel/helper-hoist-variables@7.22.5: - resolution: {integrity: sha512-wGjk9QZVzvknA6yKIUURb8zY3grXCcOZt+/7Wcy8O2uctxhplmUPkOdlgoNhmdVee2c92JXbf1xpMtVNbfoxRw==} + /@babel/helper-hoist-variables@7.24.6: + resolution: {integrity: sha512-SF/EMrC3OD7dSta1bLJIlrsVxwtd0UpjRJqLno6125epQMJ/kyFmpTT4pbvPbdQHzCHg+biQ7Syo8lnDtbR+uA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 dev: true - /@babel/helper-split-export-declaration@7.24.5: - resolution: {integrity: sha512-5CHncttXohrHk8GWOFCcCl4oRD9fKosWlIRgWm4ql9VYioKm52Mk2xsmoohvm7f3JoiLSM5ZgJuRaf5QZZYd3Q==} + /@babel/helper-split-export-declaration@7.24.6: + resolution: {integrity: sha512-CvLSkwXGWnYlF9+J3iZUvwgAxKiYzK3BWuo+mLzD/MDGOZDj7Gq8+hqaOkMxmJwmlv0iu86uH5fdADd9Hxkymw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/types': 7.24.5 + '@babel/types': 7.24.6 dev: true - /@babel/helper-string-parser@7.24.1: - resolution: {integrity: sha512-2ofRCjnnA9y+wk8b9IAREroeUP02KHp431N2mhKniy2yKIDKpbrHv9eXwm8cBeWQYcJmzv5qKCu65P47eCF7CQ==} + /@babel/helper-string-parser@7.24.6: + resolution: {integrity: sha512-WdJjwMEkmBicq5T9fm/cHND3+UlFa2Yj8ALLgmoSQAJZysYbBjw+azChSGPN4DSPLXOcooGRvDwZWMcF/mLO2Q==} engines: {node: '>=6.9.0'} dev: true - /@babel/helper-validator-identifier@7.24.5: - resolution: {integrity: sha512-3q93SSKX2TWCG30M2G2kwaKeTYgEUp5Snjuj8qm729SObL6nbtUldAi37qbxkD5gg3xnBio+f9nqpSepGZMvxA==} + /@babel/helper-validator-identifier@7.24.6: + resolution: {integrity: sha512-4yA7s865JHaqUdRbnaxarZREuPTHrjpDT+pXoAZ1yhyo6uFnIEpS8VMu16siFOHDpZNKYv5BObhsB//ycbICyw==} engines: {node: '>=6.9.0'} dev: true - /@babel/highlight@7.24.5: - resolution: {integrity: sha512-8lLmua6AVh/8SLJRRVD6V8p73Hir9w5mJrhE+IPpILG31KKlI9iz5zmBYKcWPS59qSfgP9RaSBQSHHE81WKuEw==} + /@babel/highlight@7.24.6: + resolution: {integrity: sha512-2YnuOp4HAk2BsBrJJvYCbItHx0zWscI1C3zgWkz+wDyD9I7GIVrfnLyrR4Y1VR+7p+chAEcrgRQYZAGIKMV7vQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.24.5 + '@babel/helper-validator-identifier': 7.24.6 chalk: 2.4.2 js-tokens: 4.0.0 picocolors: 1.0.1 dev: true - /@babel/parser@7.24.5: - resolution: {integrity: sha512-EOv5IK8arwh3LI47dz1b0tKUb/1uhHAnHJOrjgtQMIpu1uXd9mlFrJg9IUgGUgZ41Ch0K8REPTYpO7B76b4vJg==} + /@babel/parser@7.24.6: + resolution: {integrity: sha512-eNZXdfU35nJC2h24RznROuOpO94h6x8sg9ju0tT9biNtLZ2vuP8SduLqqV+/8+cebSLV9SJEAN5Z3zQbJG/M+Q==} engines: {node: '>=6.0.0'} hasBin: true dependencies: '@babel/types': 7.17.0 dev: true - /@babel/runtime@7.24.5: - resolution: {integrity: sha512-Nms86NXrsaeU9vbBJKni6gXiEXZ4CVpYVzEjDH9Sb8vmZ3UljyA1GSOJl/6LGPO8EHLuSF9H+IxNXHPX8QHJ4g==} + /@babel/runtime@7.24.6: + resolution: {integrity: sha512-Ja18XcETdEl5mzzACGd+DKgaGJzPTCow7EglgwTmHdwokzDFYh/MHua6lU6DV/hjF2IaOJ4oX2nqnjG7RElKOw==} engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.1 dev: true - /@babel/template@7.24.0: - resolution: {integrity: sha512-Bkf2q8lMB0AFpX0NFEqSbx1OkTHf0f+0j82mkw+ZpzBnkk7e9Ql0891vlfgi+kHwOk8tQjiQHpqh4LaSa0fKEA==} + /@babel/template@7.24.6: + resolution: {integrity: sha512-3vgazJlLwNXi9jhrR1ef8qiB65L1RK90+lEQwv4OxveHnqC3BfmnHdgySwRLzf6akhlOYenT+b7AfWq+a//AHw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.24.2 - '@babel/parser': 7.24.5 - '@babel/types': 7.24.5 + '@babel/code-frame': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 dev: true /@babel/traverse@7.23.2: resolution: {integrity: sha512-azpe59SQ48qG6nu2CzcMLbxUudtN+dOM9kDbUqGq3HXUJRlo7i8fvPoxQUzYgLZ4cMVmuZgm8vvBpNeRhd6XSw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.24.2 - '@babel/generator': 7.24.5 - '@babel/helper-environment-visitor': 7.22.20 - '@babel/helper-function-name': 7.23.0 - '@babel/helper-hoist-variables': 7.22.5 - '@babel/helper-split-export-declaration': 7.24.5 - '@babel/parser': 7.24.5 - '@babel/types': 7.24.5 + '@babel/code-frame': 7.24.6 + '@babel/generator': 7.24.6 + '@babel/helper-environment-visitor': 7.24.6 + '@babel/helper-function-name': 7.24.6 + '@babel/helper-hoist-variables': 7.24.6 + '@babel/helper-split-export-declaration': 7.24.6 + '@babel/parser': 7.24.6 + '@babel/types': 7.24.6 debug: 4.3.4 globals: 11.12.0 transitivePeerDependencies: @@ -339,16 +339,16 @@ packages: resolution: {integrity: sha512-TmKSNO4D5rzhL5bjWFcVHHLETzfQ/AmbKpKPOSjlP0WoHZ6L911fgoOKY4Alp/emzG4cHJdyN49zpgkbXFEHHw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-validator-identifier': 7.24.5 + '@babel/helper-validator-identifier': 7.24.6 to-fast-properties: 2.0.0 dev: true - /@babel/types@7.24.5: - resolution: {integrity: sha512-6mQNsaLeXTw0nxYUYu+NSa4Hx4BlF1x1x8/PMFbiR+GBSr+2DkECc69b8hgy2frEodNcvPffeH8YfWd3LI6jhQ==} + /@babel/types@7.24.6: + resolution: {integrity: sha512-WaMsgi6Q8zMgMth93GvWPXkhAIEobfsIkLTacoVZoK1J0CevIPGYY2Vo5YvJGqyHqXM6P4ppOYGsIRU8MM9pFQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/helper-string-parser': 7.24.1 - '@babel/helper-validator-identifier': 7.24.5 + '@babel/helper-string-parser': 7.24.6 + '@babel/helper-validator-identifier': 7.24.6 to-fast-properties: 2.0.0 dev: true @@ -1077,7 +1077,7 @@ packages: optional: true dependencies: '@babel/generator': 7.17.7 - '@babel/parser': 7.24.5 + '@babel/parser': 7.24.6 '@babel/traverse': 7.23.2 '@babel/types': 7.17.0 javascript-natural-sort: 0.7.1 @@ -1102,12 +1102,12 @@ packages: /@types/node-fetch@2.6.11: resolution: {integrity: sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==} dependencies: - '@types/node': 20.12.12 + '@types/node': 20.12.13 form-data: 4.0.0 dev: false - /@types/node@20.12.12: - resolution: {integrity: sha512-eWLDGF/FOSPtAvEqeRAQ4C8LSA7M1I7i0ky1I8U7kD1J5ITyW3AsRhQrKVoWf5pFKZ2kILsEGJhsI9r93PYnOw==} + /@types/node@20.12.13: + resolution: {integrity: sha512-gBGeanV41c1L171rR7wjbMiEpEI/l5XFQdLLfhr/REwpgDy/4U8y89+i8kRiLzDyZdOkXh+cRaTetUnCYutoXA==} dependencies: undici-types: 5.26.5 dev: false @@ -1115,11 +1115,11 @@ packages: /@types/tunnel@0.0.3: resolution: {integrity: sha512-sOUTGn6h1SfQ+gbgqC364jLFBw2lnFqkgF3q0WovEHRLMrVD1sd5aufqi/aJObLekJO+Aq5z646U4Oxy6shXMA==} dependencies: - '@types/node': 20.12.12 + '@types/node': 20.12.13 dev: false - /@typescript-eslint/eslint-plugin@7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-PzCr+a/KAef5ZawX7nbyNwBDtM1HdLIT53aSA2DDlxmxMngZ43O8SIePOeX8H5S+FHXeI6t97mTt/dDdzY4Fyw==} + /@typescript-eslint/eslint-plugin@7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-P+qEahbgeHW4JQ/87FuItjBj8O3MYv5gELDzr8QaQ7fsll1gSMTYb6j87MYyxwf3DtD7uGFB9ShwgmCJB5KmaQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: '@typescript-eslint/parser': ^7.0.0 @@ -1130,11 +1130,11 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/scope-manager': 7.10.0 - '@typescript-eslint/type-utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.10.0 + '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.11.0 + '@typescript-eslint/type-utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.11.0 eslint: 8.57.0 graphemer: 1.4.0 ignore: 5.3.1 @@ -1145,8 +1145,8 @@ packages: - supports-color dev: true - /@typescript-eslint/parser@7.10.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-2EjZMA0LUW5V5tGQiaa2Gys+nKdfrn2xiTIBLR4fxmPmVSvgPcKNW+AE/ln9k0A4zDUti0J/GZXMDupQoI+e1w==} + /@typescript-eslint/parser@7.11.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-yimw99teuaXVWsBcPO1Ais02kwJ1jmNA1KxE7ng0aT7ndr1pT1wqj0OJnsYVGKKlc4QJai86l/025L6z8CljOg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1155,10 +1155,10 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/scope-manager': 7.10.0 - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) - '@typescript-eslint/visitor-keys': 7.10.0 + '@typescript-eslint/scope-manager': 7.11.0 + '@typescript-eslint/types': 7.11.0 + '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5) + '@typescript-eslint/visitor-keys': 7.11.0 debug: 4.3.4 eslint: 8.57.0 typescript: 5.4.5 @@ -1166,16 +1166,16 @@ packages: - supports-color dev: true - /@typescript-eslint/scope-manager@7.10.0: - resolution: {integrity: sha512-7L01/K8W/VGl7noe2mgH0K7BE29Sq6KAbVmxurj8GGaPDZXPr8EEQ2seOeAS+mEV9DnzxBQB6ax6qQQ5C6P4xg==} + /@typescript-eslint/scope-manager@7.11.0: + resolution: {integrity: sha512-27tGdVEiutD4POirLZX4YzT180vevUURJl4wJGmm6TrQoiYwuxTIY98PBp6L2oN+JQxzE0URvYlzJaBHIekXAw==} engines: {node: ^18.18.0 || >=20.0.0} dependencies: - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/visitor-keys': 7.10.0 + '@typescript-eslint/types': 7.11.0 + '@typescript-eslint/visitor-keys': 7.11.0 dev: true - /@typescript-eslint/type-utils@7.10.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-D7tS4WDkJWrVkuzgm90qYw9RdgBcrWmbbRkrLA4d7Pg3w0ttVGDsvYGV19SH8gPR5L7OtcN5J1hTtyenO9xE9g==} + /@typescript-eslint/type-utils@7.11.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-WmppUEgYy+y1NTseNMJ6mCFxt03/7jTOy08bcg7bxJJdsM4nuhnchyBbE8vryveaJUf62noH7LodPSo5Z0WUCg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 @@ -1184,8 +1184,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) - '@typescript-eslint/utils': 7.10.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4 eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) @@ -1194,13 +1194,13 @@ packages: - supports-color dev: true - /@typescript-eslint/types@7.10.0: - resolution: {integrity: sha512-7fNj+Ya35aNyhuqrA1E/VayQX9Elwr8NKZ4WueClR3KwJ7Xx9jcCdOrLW04h51de/+gNbyFMs+IDxh5xIwfbNg==} + /@typescript-eslint/types@7.11.0: + resolution: {integrity: sha512-MPEsDRZTyCiXkD4vd3zywDCifi7tatc4K37KqTprCvaXptP7Xlpdw0NR2hRJTetG5TxbWDB79Ys4kLmHliEo/w==} engines: {node: ^18.18.0 || >=20.0.0} dev: true - /@typescript-eslint/typescript-estree@7.10.0(typescript@5.4.5): - resolution: {integrity: sha512-LXFnQJjL9XIcxeVfqmNj60YhatpRLt6UhdlFwAkjNc6jSUlK8zQOl1oktAP8PlWFzPQC1jny/8Bai3/HPuvN5g==} + /@typescript-eslint/typescript-estree@7.11.0(typescript@5.4.5): + resolution: {integrity: sha512-cxkhZ2C/iyi3/6U9EPc5y+a6csqHItndvN/CzbNXTNrsC3/ASoYQZEt9uMaEp+xFNjasqQyszp5TumAVKKvJeQ==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: typescript: '*' @@ -1208,8 +1208,8 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/visitor-keys': 7.10.0 + '@typescript-eslint/types': 7.11.0 + '@typescript-eslint/visitor-keys': 7.11.0 debug: 4.3.4 globby: 11.1.0 is-glob: 4.0.3 @@ -1221,27 +1221,27 @@ packages: - supports-color dev: true - /@typescript-eslint/utils@7.10.0(eslint@8.57.0)(typescript@5.4.5): - resolution: {integrity: sha512-olzif1Fuo8R8m/qKkzJqT7qwy16CzPRWBvERS0uvyc+DHd8AKbO4Jb7kpAvVzMmZm8TrHnI7hvjN4I05zow+tg==} + /@typescript-eslint/utils@7.11.0(eslint@8.57.0)(typescript@5.4.5): + resolution: {integrity: sha512-xlAWwPleNRHwF37AhrZurOxA1wyXowW4PqVXZVUNCLjB48CqdPJoJWkrpH2nij9Q3Lb7rtWindtoXwxjxlKKCA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: eslint: ^8.56.0 dependencies: '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@typescript-eslint/scope-manager': 7.10.0 - '@typescript-eslint/types': 7.10.0 - '@typescript-eslint/typescript-estree': 7.10.0(typescript@5.4.5) + '@typescript-eslint/scope-manager': 7.11.0 + '@typescript-eslint/types': 7.11.0 + '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript dev: true - /@typescript-eslint/visitor-keys@7.10.0: - resolution: {integrity: sha512-9ntIVgsi6gg6FIq9xjEO4VQJvwOqA3jaBFQJ/6TK5AvEup2+cECI6Fh7QiBxmfMHXU0V0J4RyPeOU1VDNzl9cg==} + /@typescript-eslint/visitor-keys@7.11.0: + resolution: {integrity: sha512-7syYk4MzjxTEk0g/w3iqtgxnFQspDJfn6QKD36xMuuhTzjcxY7F8EmBLnALjVyaOF1/bVocu3bS/2/F7rXrveQ==} engines: {node: ^18.18.0 || >=20.0.0} dependencies: - '@typescript-eslint/types': 7.10.0 + '@typescript-eslint/types': 7.11.0 eslint-visitor-keys: 3.4.3 dev: true @@ -1517,8 +1517,8 @@ packages: engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} hasBin: true dependencies: - caniuse-lite: 1.0.30001621 - electron-to-chromium: 1.4.777 + caniuse-lite: 1.0.30001625 + electron-to-chromium: 1.4.784 node-releases: 2.0.14 update-browserslist-db: 1.0.16(browserslist@4.23.0) dev: true @@ -1572,8 +1572,8 @@ packages: engines: {node: '>=6'} dev: true - /caniuse-lite@1.0.30001621: - resolution: {integrity: sha512-+NLXZiviFFKX0fk8Piwv3PfLPGtRqJeq2TiNoUff/qB5KJgwecJTvCXDpmlyP/eCI/GUEmp/h/y5j0yckiiZrA==} + /caniuse-lite@1.0.30001625: + resolution: {integrity: sha512-4KE9N2gcRH+HQhpeiRZXd+1niLB/XNLAhSy4z7fI8EzcbcPoAqjNInxVHTiTwWfTIV4w096XG8OtCOCQQKPv3w==} dev: true /chai@4.4.1: @@ -1811,8 +1811,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.777: - resolution: {integrity: sha512-n02NCwLJ3wexLfK/yQeqfywCblZqLcXphzmid5e8yVPdtEcida7li0A5WQKghHNG0FeOMCzeFOzEbtAh5riXFw==} + /electron-to-chromium@1.4.784: + resolution: {integrity: sha512-9CZwh+sDrhDAeOEFh8s3PqwduzTyYIeYwZolc1b9ENAUt3ePu7R1sJSCWr/820ISssRxCJUyHI9Wb7j+0Uo1AA==} dev: true /emoji-regex@8.0.0: @@ -2042,7 +2042,7 @@ packages: - supports-color dev: true - /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): + /eslint-import-resolver-typescript@3.6.1(@typescript-eslint/parser@7.11.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0): resolution: {integrity: sha512-xgdptdoi5W3niYeuQxKmzVDTATvLYqhpwmykwsh7f6HIOStGWEIL9iqZgQDF9u9OEzrRwR8no5q2VT+bjAujTg==} engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: @@ -2052,8 +2052,8 @@ packages: debug: 4.3.4 enhanced-resolve: 5.16.1 eslint: 8.57.0 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) fast-glob: 3.3.2 get-tsconfig: 4.7.5 is-core-module: 2.13.1 @@ -2065,7 +2065,7 @@ packages: - supports-color dev: true - /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-module-utils@2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: {integrity: sha512-rXDXR3h7cs7dy9RNpUlQf80nX31XWJEyGq1tRMo+6GsO5VmTe4UTwtmonAD4ZkAsrfMVDA2wlGJ3790Ys+D49Q==} engines: {node: '>=4'} peerDependencies: @@ -2086,11 +2086,11 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5) debug: 3.2.7 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.10.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) + eslint-import-resolver-typescript: 3.6.1(@typescript-eslint/parser@7.11.0)(eslint-plugin-import@2.29.1)(eslint@8.57.0) transitivePeerDependencies: - supports-color dev: true @@ -2134,8 +2134,8 @@ packages: eslint: ^8.0.1 dependencies: '@github/browserslist-config': 1.0.0 - '@typescript-eslint/eslint-plugin': 7.10.0(@typescript-eslint/parser@7.10.0)(eslint@8.57.0)(typescript@5.4.5) - '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/eslint-plugin': 7.11.0(@typescript-eslint/parser@7.11.0)(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5) aria-query: 5.3.0 eslint: 8.57.0 eslint-config-prettier: 9.1.0(eslint@8.57.0) @@ -2143,7 +2143,7 @@ packages: eslint-plugin-eslint-comments: 3.2.0(eslint@8.57.0) eslint-plugin-filenames: 1.3.2(eslint@8.57.0) eslint-plugin-i18n-text: 1.0.1(eslint@8.57.0) - eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-plugin-import: 2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) eslint-plugin-jsx-a11y: 6.8.0(eslint@8.57.0) eslint-plugin-no-only-tests: 3.1.0 eslint-plugin-prettier: 5.1.3(eslint-config-prettier@9.1.0)(eslint@8.57.0)(prettier@3.2.5) @@ -2167,7 +2167,7 @@ packages: eslint: 8.57.0 dev: true - /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): + /eslint-plugin-import@2.29.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0): resolution: {integrity: sha512-BbPC0cuExzhiMo4Ff1BTVwHpjjv28C5R+btTOGaCRC7UEz801up0JadwkeSk5Ued6TG34uaczuVuH6qyy5YUxw==} engines: {node: '>=4'} peerDependencies: @@ -2177,7 +2177,7 @@ packages: '@typescript-eslint/parser': optional: true dependencies: - '@typescript-eslint/parser': 7.10.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.11.0(eslint@8.57.0)(typescript@5.4.5) array-includes: 3.1.8 array.prototype.findlastindex: 1.2.5 array.prototype.flat: 1.3.2 @@ -2186,7 +2186,7 @@ packages: doctrine: 2.1.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.10.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) + eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) hasown: 2.0.2 is-core-module: 2.13.1 is-glob: 4.0.3 @@ -2208,7 +2208,7 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 dependencies: - '@babel/runtime': 7.24.5 + '@babel/runtime': 7.24.6 aria-query: 5.3.0 array-includes: 3.1.8 array.prototype.flatmap: 1.3.2 @@ -2593,20 +2593,21 @@ packages: is-glob: 4.0.3 dev: true - /glob@10.3.16: - resolution: {integrity: sha512-JDKXl1DiuuHJ6fVS2FXjownaavciiHNUU4mOvV/B793RLh05vZL1rcPnCSaOgv1hDT6RDlY7AB7ZUvFYAtPgAw==} + /glob@10.4.1: + resolution: {integrity: sha512-2jelhlq3E4ho74ZyVLN03oKdAZVUa6UDZzFLVH1H7dnoax+y9qyaq8zBkfDIggjniU19z0wU18y16jMB2eyVIw==} engines: {node: '>=16 || 14 >=14.18'} hasBin: true dependencies: foreground-child: 3.1.1 jackspeak: 3.1.2 minimatch: 9.0.4 - minipass: 7.1.1 + minipass: 7.1.2 path-scurry: 1.11.1 dev: true /glob@7.2.3: resolution: {integrity: sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==} + deprecated: Glob versions prior to v9 are no longer supported dependencies: fs.realpath: 1.0.0 inflight: 1.0.6 @@ -2765,6 +2766,7 @@ packages: /inflight@1.0.6: resolution: {integrity: sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==} + deprecated: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful. dependencies: once: 1.4.0 wrappy: 1.0.2 @@ -3229,8 +3231,8 @@ packages: resolution: {integrity: sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==} dev: true - /minipass@7.1.1: - resolution: {integrity: sha512-UZ7eQ+h8ywIRAW1hIEl2AqdwzJucU/Kp59+8kkZeSvafXhZjul247BvIJjEVFVeON6d7lM46XX1HXCduKAS8VA==} + /minipass@7.1.2: + resolution: {integrity: sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==} engines: {node: '>=16 || 14 >=14.17'} dev: true @@ -3464,7 +3466,7 @@ packages: engines: {node: '>=16 || 14 >=14.18'} dependencies: lru-cache: 10.2.2 - minipass: 7.1.1 + minipass: 7.1.2 dev: true /path-type@4.0.0: @@ -3657,6 +3659,7 @@ packages: /rimraf@3.0.2: resolution: {integrity: sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==} + deprecated: Rimraf versions prior to v4 are no longer supported hasBin: true dependencies: glob: 7.2.3 @@ -3713,8 +3716,8 @@ packages: is-regex: 1.1.4 dev: true - /sax@1.3.0: - resolution: {integrity: sha512-0s+oAmw9zLl1V1cS9BtZN7JAd0cW5e0QH4W3LWEK6a4LaLEA2OTpGYWDY+6XasBLtz6wkm3u1xRw95mRuJ59WA==} + /sax@1.4.1: + resolution: {integrity: sha512-+aWOz7yVScEGoKNd4PA10LZ8sk0A/z5+nXQG5giUO5rprX9jgYsTdov9qCchZiPIZezbZH+jRut8nPodFAX4Jg==} dev: false /semver@6.3.1: @@ -3906,7 +3909,7 @@ packages: dependencies: '@jridgewell/gen-mapping': 0.3.5 commander: 4.1.1 - glob: 10.3.16 + glob: 10.4.1 lines-and-columns: 1.2.4 mz: 2.7.0 pirates: 4.0.6 @@ -4208,7 +4211,7 @@ packages: debug: 4.3.4 pathe: 1.1.2 picocolors: 1.0.1 - vite: 5.2.11 + vite: 5.2.12 transitivePeerDependencies: - '@types/node' - less @@ -4220,8 +4223,8 @@ packages: - terser dev: true - /vite@5.2.11: - resolution: {integrity: sha512-HndV31LWW05i1BLPMUCE1B9E9GFbOu1MbenhS58FuK6owSO5qHm7GiCotrNY1YE5rMeQSFBGmT5ZaLEjFizgiQ==} + /vite@5.2.12: + resolution: {integrity: sha512-/gC8GxzxMK5ntBwb48pR32GGhENnjtY30G4A0jemunsBkiEZFw60s8InGpN8gkhHEkjnRK1aSAxeQgwvFhUHAA==} engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: @@ -4297,7 +4300,7 @@ packages: strip-literal: 2.1.0 tinybench: 2.8.0 tinypool: 0.8.4 - vite: 5.2.11 + vite: 5.2.12 vite-node: 1.6.0 why-is-node-running: 2.2.2 transitivePeerDependencies: @@ -4430,7 +4433,7 @@ packages: resolution: {integrity: sha512-drPFnkQJik/O+uPKpqSgr22mpuFHqKdbS835iAQrUC73L2F5WkboIRd63ai/2Yg6I1jzifPFKH2NTK+cfglkIA==} engines: {node: '>=4.0.0'} dependencies: - sax: 1.3.0 + sax: 1.4.1 xmlbuilder: 11.0.1 dev: false @@ -4455,8 +4458,8 @@ packages: engines: {node: '>=12.20'} dev: true - github.com/DeterminateSystems/detsys-ts/ed02129aed8e4d6402d920152652877189bece70: - resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/ed02129aed8e4d6402d920152652877189bece70} + github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d: + resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/5fcb0532d85556ebc2de286e483885976531339d} name: detsys-ts version: 1.0.0 dependencies: From d98ea6576bf1c5563517608befa46f91911c0ffb Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 31 May 2024 11:34:46 -0400 Subject: [PATCH 2/4] Update detsys-ts for srv --- dist/index.js | 341 ++++++++++++++++++++++++++++++++++--------------- pnpm-lock.yaml | 38 +++--- 2 files changed, 258 insertions(+), 121 deletions(-) diff --git a/dist/index.js b/dist/index.js index e54fdc2..36238cd 100644 --- a/dist/index.js +++ b/dist/index.js @@ -86333,6 +86333,8 @@ var external_node_util_ = __nccwpck_require__(7261); var external_os_ = __nccwpck_require__(2037); ;// CONCATENATED MODULE: external "node:crypto" const external_node_crypto_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:crypto"); +;// CONCATENATED MODULE: external "node:dns/promises" +const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:dns/promises"); // EXTERNAL MODULE: ./node_modules/.pnpm/@actions+cache@3.2.4/node_modules/@actions/cache/lib/cache.js var cache = __nccwpck_require__(6878); ;// CONCATENATED MODULE: ./node_modules/.pnpm/@sindresorhus+is@6.3.1/node_modules/@sindresorhus/is/dist/index.js @@ -93726,14 +93728,14 @@ const got = source_create(defaults); ;// CONCATENATED MODULE: external "node:child_process" const external_node_child_process_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:child_process"); ;// CONCATENATED MODULE: external "node:fs/promises" -const promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises"); +const external_node_fs_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:fs/promises"); ;// CONCATENATED MODULE: external "node:path" const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:path"); ;// CONCATENATED MODULE: external "node:stream/promises" const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@5fcb0532d85556ebc2de286e483885976531339d_uqngfub4ls4loys67iy653x57e/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@9d66d2c89c150f796165fdcc20b3be538807c0f4_46ybmzqhaua4eiwu3nj2qm63te/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -93819,9 +93821,9 @@ async function readAsyncOsReleaseFile(fileList, options) { ${fileData}`); } break; - } catch (error2) { + } catch (error3) { if (options.debug) { - console.error(error2); + console.error(error3); } } } @@ -93843,9 +93845,9 @@ function readSyncOsreleaseFile(releaseFileList, options) { ${fileData}`); } break; - } catch (error2) { + } catch (error3) { if (options.debug) { - console.error(error2); + console.error(error3); } } } @@ -94037,6 +94039,192 @@ function hashEnvironmentVariables(prefix, variables) { return `${prefix}-${hash.digest("hex")}`; } +// src/errors.ts +function stringifyError(e) { + if (e instanceof Error) { + return e.message; + } else if (typeof e === "string") { + return e; + } else { + return JSON.stringify(e); + } +} + +// src/ids-host.ts + + +var DEFAULT_LOOKUP = "_detsys_ids._tcp.install.determinate.systems."; +var ALLOWED_SUFFIXES = [ + ".install.determinate.systems", + ".install.detsys.dev" +]; +var DEFAULT_IDS_HOST = "https://install.determinate.systems"; +var LOOKUP = process.env["IDS_LOOKUP"] ?? DEFAULT_LOOKUP; +var IdsHost = class { + constructor(idsProjectName, diagnosticsSuffix, runtimeDiagnosticsUrl) { + this.idsProjectName = idsProjectName; + this.diagnosticsSuffix = diagnosticsSuffix; + this.runtimeDiagnosticsUrl = runtimeDiagnosticsUrl; + } + markCurrentHostBroken() { + this.prioritizedURLs?.shift(); + } + setPrioritizedUrls(urls) { + this.prioritizedURLs = urls; + } + async getRootUrl() { + const idsHost = process.env["IDS_HOST"]; + if (idsHost !== void 0) { + try { + return new URL(idsHost); + } catch (err) { + core.error( + `IDS_HOST environment variable is not a valid URL. Ignoring. ${stringifyError(err)}` + ); + } + } + let url = void 0; + try { + const urls = await this.getUrlsByPreference(); + url = urls[0]; + } catch (err) { + core.error( + `Error collecting IDS URLs by preference: ${stringifyError(err)}` + ); + } + if (url === void 0) { + url = new URL(DEFAULT_IDS_HOST); + } + return new URL(url); + } + async getDiagnosticsUrl() { + if (this.runtimeDiagnosticsUrl === "") { + return void 0; + } + if (this.runtimeDiagnosticsUrl !== "-" && this.runtimeDiagnosticsUrl !== void 0) { + try { + return new URL(this.runtimeDiagnosticsUrl); + } catch (err) { + core.info( + `User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError(err)}` + ); + } + } + try { + const diagnosticUrl = await this.getRootUrl(); + diagnosticUrl.pathname += this.idsProjectName; + diagnosticUrl.pathname += "/"; + diagnosticUrl.pathname += this.diagnosticsSuffix || "diagnostics"; + return diagnosticUrl; + } catch (err) { + core.info( + `Generated diagnostic endpoint ignored, and diagnostics are disabled: not a valid URL: ${stringifyError(err)}` + ); + return void 0; + } + } + async getUrlsByPreference() { + if (this.prioritizedURLs === void 0) { + this.prioritizedURLs = orderRecordsByPriorityWeight( + await discoverServiceRecords() + ).flatMap((record) => recordToUrl(record) || []); + } + return this.prioritizedURLs; + } +}; +function recordToUrl(record) { + const urlStr = `https://${record.name}:${record.port}`; + try { + return new URL(urlStr); + } catch (err) { + core.debug( + `Record ${JSON.stringify(record)} produced an invalid URL: ${urlStr} (${err})` + ); + return void 0; + } +} +async function discoverServiceRecords() { + return await discoverServicesStub((0,promises_namespaceObject.resolveSrv)(LOOKUP), 1e3); +} +async function discoverServicesStub(lookup, timeout) { + const defaultFallback = new Promise( + (resolve, _reject) => { + setTimeout(resolve, timeout, []); + } + ); + let records; + try { + records = await Promise.race([lookup, defaultFallback]); + } catch (reason) { + core.debug(`Error resolving SRV records: ${stringifyError(reason)}`); + records = []; + } + const acceptableRecords = records.filter((record) => { + for (const suffix of ALLOWED_SUFFIXES) { + if (record.name.endsWith(suffix)) { + return true; + } + } + core.debug( + `Unacceptable domain due to an invalid suffix: ${record.name}` + ); + return false; + }); + if (acceptableRecords.length === 0) { + core.debug(`No records found for ${LOOKUP}`); + } else { + core.debug( + `Resolved ${LOOKUP} to ${JSON.stringify(acceptableRecords)}` + ); + } + return acceptableRecords; +} +function orderRecordsByPriorityWeight(records) { + const byPriorityWeight = /* @__PURE__ */ new Map(); + for (const record of records) { + const existing = byPriorityWeight.get(record.priority); + if (existing) { + existing.push(record); + } else { + byPriorityWeight.set(record.priority, [record]); + } + } + const prioritizedRecords = []; + const keys = Array.from(byPriorityWeight.keys()).sort( + (a, b) => a - b + ); + for (const priority of keys) { + const recordsByPrio = byPriorityWeight.get(priority); + if (recordsByPrio === void 0) { + continue; + } + prioritizedRecords.push(...weightedRandom(recordsByPrio)); + } + return prioritizedRecords; +} +function weightedRandom(records) { + const scratchRecords = records.slice(); + const result = []; + while (scratchRecords.length > 0) { + const weights = []; + { + for (let i = 0; i < scratchRecords.length; i++) { + weights.push( + scratchRecords[i].weight + (i > 0 ? scratchRecords[i - 1].weight : 0) + ); + } + } + const point = Math.random() * weights[weights.length - 1]; + for (let selectedIndex = 0; selectedIndex < weights.length; selectedIndex++) { + if (weights[selectedIndex] > point) { + result.push(scratchRecords.splice(selectedIndex, 1)[0]); + break; + } + } + } + return result; +} + // src/inputs.ts var inputs_exports = {}; __export(inputs_exports, { @@ -94197,21 +94385,6 @@ function noisilyGetInput(suffix, legacyPrefix) { - -// src/errors.ts -function stringifyError(e) { - if (e instanceof Error) { - return e.message; - } else if (typeof e === "string") { - return e; - } else { - return JSON.stringify(e); - } -} - -// src/index.ts -var DEFAULT_IDS_HOST = "https://install.determinate.systems"; -var IDS_HOST = process.env["IDS_HOST"] ?? DEFAULT_IDS_HOST; var EVENT_EXCEPTION = "exception"; var EVENT_ARTIFACT_CACHE_HIT = "artifact_cache_hit"; var EVENT_ARTIFACT_CACHE_MISS = "artifact_cache_miss"; @@ -94245,6 +94418,13 @@ var DetSysAction = class { } constructor(actionOptions) { this.actionOptions = makeOptionsConfident(actionOptions); + this.idsHost = new IdsHost( + this.actionOptions.idsProjectName, + actionOptions.diagnosticsSuffix, + // Note: we don't use actionsCore.getInput('diagnostic-endpoint') on purpose: + // getInput silently converts absent data to an empty string. + process.env["INPUT_DIAGNOSTIC-ENDPOINT"] + ); this.exceptionAttachments = /* @__PURE__ */ new Map(); this.nixStoreTrust = "unknown"; this.strictMode = getBool("_internal-strict-mode"); @@ -94256,9 +94436,9 @@ var DetSysAction = class { }, hooks: { beforeRetry: [ - (error2, retryCount) => { + (error3, retryCount) => { core.info( - `Retrying after error ${error2.code}, retry #: ${retryCount}` + `Retrying after error ${error3.code}, retry #: ${retryCount}` ); } ] @@ -94335,8 +94515,8 @@ var DetSysAction = class { * Execute the Action as defined. */ execute() { - this.executeAsync().catch((error2) => { - console.log(error2); + this.executeAsync().catch((error3) => { + console.log(error3); process.exitCode = 1; }); } @@ -94347,8 +94527,8 @@ var DetSysAction = class { addFact(key, value) { this.facts[key] = value; } - getDiagnosticsUrl() { - return this.actionOptions.diagnosticsUrl; + async getDiagnosticsUrl() { + return await this.idsHost.getDiagnosticsUrl(); } getUniqueId() { return this.identity.run_differentiator || process.env.RUNNER_TRACKING_ID || (0,external_node_crypto_namespaceObject.randomUUID)(); @@ -94386,7 +94566,7 @@ var DetSysAction = class { */ async fetchExecutable() { const binaryPath = await this.fetchArtifact(); - await (0,promises_namespaceObject.chmod)(binaryPath, promises_namespaceObject.constants.S_IXUSR | promises_namespaceObject.constants.S_IXGRP); + await (0,external_node_fs_promises_namespaceObject.chmod)(binaryPath, external_node_fs_promises_namespaceObject.constants.S_IXUSR | external_node_fs_promises_namespaceObject.constants.S_IXGRP); return binaryPath; } get isMain() { @@ -94461,8 +94641,8 @@ var DetSysAction = class { `Downloading ${this.actionOptions.name} for ${this.architectureFetchSuffix}` ); try { - core.info(`Fetching from ${this.getSourceUrl()}`); - const correlatedUrl = this.getSourceUrl(); + core.info(`Fetching from ${await this.getSourceUrl()}`); + const correlatedUrl = await this.getSourceUrl(); correlatedUrl.searchParams.set("ci", "github"); correlatedUrl.searchParams.set( "correlation", @@ -94473,7 +94653,7 @@ var DetSysAction = class { const v = versionCheckup.headers.etag; this.addFact(FACT_SOURCE_URL_ETAG, v); core.debug( - `Checking the tool cache for ${this.getSourceUrl()} at ${v}` + `Checking the tool cache for ${await this.getSourceUrl()} at ${v}` ); const cached = await this.getCachedVersion(v); if (cached) { @@ -94521,13 +94701,13 @@ var DetSysAction = class { this.recordEvent(`complete_${this.executionPhase}`); await this.submitEvents(); } - getSourceUrl() { + async getSourceUrl() { const p = this.sourceParameters; if (p.url) { this.addFact(FACT_SOURCE_URL, p.url); return new URL(p.url); } - const fetchUrl = new URL(IDS_HOST); + const fetchUrl = await this.idsHost.getRootUrl(); fetchUrl.pathname += this.actionOptions.idsProjectName; if (p.tag) { fetchUrl.pathname += `/tag/${p.tag}`; @@ -94552,7 +94732,7 @@ var DetSysAction = class { const startCwd = process.cwd(); try { const tempDir = this.getTemporaryName(); - await (0,promises_namespaceObject.mkdir)(tempDir); + await (0,external_node_fs_promises_namespaceObject.mkdir)(tempDir); process.chdir(tempDir); process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; delete process.env.GITHUB_WORKSPACE; @@ -94578,9 +94758,9 @@ var DetSysAction = class { const startCwd = process.cwd(); try { const tempDir = this.getTemporaryName(); - await (0,promises_namespaceObject.mkdir)(tempDir); + await (0,external_node_fs_promises_namespaceObject.mkdir)(tempDir); process.chdir(tempDir); - await (0,promises_namespaceObject.copyFile)(toolPath, `${tempDir}/${this.actionOptions.name}`); + await (0,external_node_fs_promises_namespaceObject.copyFile)(toolPath, `${tempDir}/${this.actionOptions.name}`); process.env.GITHUB_WORKSPACE_BACKUP = process.env.GITHUB_WORKSPACE; delete process.env.GITHUB_WORKSPACE; await cache.saveCache( @@ -94602,7 +94782,7 @@ var DetSysAction = class { for (const location of pathParts) { const candidateNix = external_node_path_namespaceObject.join(location, "nix"); try { - await promises_namespaceObject.access(candidateNix, promises_namespaceObject.constants.X_OK); + await external_node_fs_promises_namespaceObject.access(candidateNix, external_node_fs_promises_namespaceObject.constants.X_OK); core.debug(`Found Nix at ${candidateNix}`); nixLocation = candidateNix; break; @@ -94683,7 +94863,8 @@ var DetSysAction = class { } } async submitEvents() { - if (this.actionOptions.diagnosticsUrl === void 0) { + const diagnosticsUrl = await this.idsHost.getDiagnosticsUrl(); + if (diagnosticsUrl === void 0) { core.debug( "Diagnostics are disabled. Not sending the following events:" ); @@ -94696,7 +94877,7 @@ var DetSysAction = class { events: this.events }; try { - await this.client.post(this.actionOptions.diagnosticsUrl, { + await this.client.post(diagnosticsUrl, { json: batch, timeout: { request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS @@ -94706,12 +94887,28 @@ var DetSysAction = class { core.debug( `Error submitting diagnostics event: ${stringifyError2(e)}` ); + this.idsHost.markCurrentHostBroken(); + const secondaryDiagnosticsUrl = await this.idsHost.getDiagnosticsUrl(); + if (secondaryDiagnosticsUrl !== void 0) { + try { + await this.client.post(secondaryDiagnosticsUrl, { + json: batch, + timeout: { + request: DIAGNOSTIC_ENDPOINT_TIMEOUT_MS + } + }); + } catch (err) { + core.debug( + `Error submitting diagnostics event to secondary host (${secondaryDiagnosticsUrl}): ${stringifyError2(err)}` + ); + } + } } this.events = []; } }; -function stringifyError2(error2) { - return error2 instanceof Error || typeof error2 == "string" ? error2.toString() : JSON.stringify(error2); +function stringifyError2(error3) { + return error3 instanceof Error || typeof error3 == "string" ? error3.toString() : JSON.stringify(error3); } function makeOptionsConfident(actionOptions) { const idsProjectName = actionOptions.idsProjectName ?? actionOptions.name; @@ -94721,72 +94918,12 @@ function makeOptionsConfident(actionOptions) { eventPrefix: actionOptions.eventPrefix || "action:", fetchStyle: actionOptions.fetchStyle, legacySourcePrefix: actionOptions.legacySourcePrefix, - requireNix: actionOptions.requireNix, - diagnosticsUrl: determineDiagnosticsUrl( - idsProjectName, - actionOptions.diagnosticsUrl - ) + requireNix: actionOptions.requireNix }; core.debug("idslib options:"); core.debug(JSON.stringify(finalOpts, void 0, 2)); return finalOpts; } -function determineDiagnosticsUrl(idsProjectName, urlOption) { - if (urlOption === null) { - return void 0; - } - if (urlOption !== void 0) { - return urlOption; - } - { - const providedDiagnosticEndpoint = process.env["INPUT_DIAGNOSTIC-ENDPOINT"]; - if (providedDiagnosticEndpoint === "") { - return void 0; - } - if (providedDiagnosticEndpoint !== void 0) { - try { - return mungeDiagnosticEndpoint(new URL(providedDiagnosticEndpoint)); - } catch (e) { - core.info( - `User-provided diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}` - ); - } - } - } - try { - const diagnosticUrl = new URL(IDS_HOST); - diagnosticUrl.pathname += idsProjectName; - diagnosticUrl.pathname += "/diagnostics"; - return diagnosticUrl; - } catch (e) { - core.info( - `Generated diagnostic endpoint ignored: not a valid URL: ${stringifyError2(e)}` - ); - } - return void 0; -} -function mungeDiagnosticEndpoint(inputUrl) { - if (DEFAULT_IDS_HOST === IDS_HOST) { - return inputUrl; - } - try { - const defaultIdsHost = new URL(DEFAULT_IDS_HOST); - const currentIdsHost = new URL(IDS_HOST); - if (inputUrl.origin !== defaultIdsHost.origin) { - return inputUrl; - } - inputUrl.protocol = currentIdsHost.protocol; - inputUrl.host = currentIdsHost.host; - inputUrl.username = currentIdsHost.username; - inputUrl.password = currentIdsHost.password; - return inputUrl; - } catch (e) { - core.info( - `Default or overridden IDS host isn't a valid URL: ${stringifyError2(e)}` - ); - } - return inputUrl; -} /*! * linux-release-info diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index c0fb508..6c3c473 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ dependencies: version: 1.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d + version: github.com/DeterminateSystems/detsys-ts/9d66d2c89c150f796165fdcc20b3be538807c0f4 devDependencies: '@trivago/prettier-plugin-sort-imports': @@ -329,7 +329,7 @@ packages: '@babel/helper-split-export-declaration': 7.24.6 '@babel/parser': 7.24.6 '@babel/types': 7.24.6 - debug: 4.3.4 + debug: 4.3.5 globals: 11.12.0 transitivePeerDependencies: - supports-color @@ -786,7 +786,7 @@ packages: engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: ajv: 6.12.6 - debug: 4.3.4 + debug: 4.3.5 espree: 9.6.1 globals: 13.24.0 ignore: 5.3.1 @@ -817,7 +817,7 @@ packages: engines: {node: '>=10.10.0'} dependencies: '@humanwhocodes/object-schema': 2.0.3 - debug: 4.3.4 + debug: 4.3.5 minimatch: 3.1.2 transitivePeerDependencies: - supports-color @@ -1159,7 +1159,7 @@ packages: '@typescript-eslint/types': 7.11.0 '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.11.0 - debug: 4.3.4 + debug: 4.3.5 eslint: 8.57.0 typescript: 5.4.5 transitivePeerDependencies: @@ -1186,7 +1186,7 @@ packages: dependencies: '@typescript-eslint/typescript-estree': 7.11.0(typescript@5.4.5) '@typescript-eslint/utils': 7.11.0(eslint@8.57.0)(typescript@5.4.5) - debug: 4.3.4 + debug: 4.3.5 eslint: 8.57.0 ts-api-utils: 1.3.0(typescript@5.4.5) typescript: 5.4.5 @@ -1210,7 +1210,7 @@ packages: dependencies: '@typescript-eslint/types': 7.11.0 '@typescript-eslint/visitor-keys': 7.11.0 - debug: 4.3.4 + debug: 4.3.5 globby: 11.1.0 is-glob: 4.0.3 minimatch: 9.0.4 @@ -1518,7 +1518,7 @@ packages: hasBin: true dependencies: caniuse-lite: 1.0.30001625 - electron-to-chromium: 1.4.784 + electron-to-chromium: 1.4.787 node-releases: 2.0.14 update-browserslist-db: 1.0.16(browserslist@4.23.0) dev: true @@ -1718,8 +1718,8 @@ packages: ms: 2.1.3 dev: true - /debug@4.3.4: - resolution: {integrity: sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==} + /debug@4.3.5: + resolution: {integrity: sha512-pt0bNEmneDIvdL1Xsd9oDQ/wrQRkXDT4AUWlNZNPKvW5x/jyO9VFXkJUP07vQ2upmw5PlaITaPKc31jK13V+jg==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -1811,8 +1811,8 @@ packages: resolution: {integrity: sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==} dev: true - /electron-to-chromium@1.4.784: - resolution: {integrity: sha512-9CZwh+sDrhDAeOEFh8s3PqwduzTyYIeYwZolc1b9ENAUt3ePu7R1sJSCWr/820ISssRxCJUyHI9Wb7j+0Uo1AA==} + /electron-to-chromium@1.4.787: + resolution: {integrity: sha512-d0EFmtLPjctczO3LogReyM2pbBiiZbnsKnGF+cdZhsYzHm/A0GV7W94kqzLD8SN4O3f3iHlgLUChqghgyznvCQ==} dev: true /emoji-regex@8.0.0: @@ -2049,7 +2049,7 @@ packages: eslint: '*' eslint-plugin-import: '*' dependencies: - debug: 4.3.4 + debug: 4.3.5 enhanced-resolve: 5.16.1 eslint: 8.57.0 eslint-module-utils: 2.8.1(@typescript-eslint/parser@7.11.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.6.1)(eslint@8.57.0) @@ -2287,7 +2287,7 @@ packages: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.3 - debug: 4.3.4 + debug: 4.3.5 doctrine: 3.0.0 escape-string-regexp: 4.0.0 eslint-scope: 7.2.2 @@ -4061,7 +4061,7 @@ packages: bundle-require: 4.1.0(esbuild@0.19.12) cac: 6.7.14 chokidar: 3.6.0 - debug: 4.3.4 + debug: 4.3.5 esbuild: 0.19.12 execa: 5.1.1 globby: 11.1.0 @@ -4208,7 +4208,7 @@ packages: hasBin: true dependencies: cac: 6.7.14 - debug: 4.3.4 + debug: 4.3.5 pathe: 1.1.2 picocolors: 1.0.1 vite: 5.2.12 @@ -4290,7 +4290,7 @@ packages: '@vitest/utils': 1.6.0 acorn-walk: 8.3.2 chai: 4.4.1 - debug: 4.3.4 + debug: 4.3.5 execa: 8.0.1 local-pkg: 0.5.0 magic-string: 0.30.10 @@ -4458,8 +4458,8 @@ packages: engines: {node: '>=12.20'} dev: true - github.com/DeterminateSystems/detsys-ts/5fcb0532d85556ebc2de286e483885976531339d: - resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/5fcb0532d85556ebc2de286e483885976531339d} + github.com/DeterminateSystems/detsys-ts/9d66d2c89c150f796165fdcc20b3be538807c0f4: + resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/9d66d2c89c150f796165fdcc20b3be538807c0f4} name: detsys-ts version: 1.0.0 dependencies: From be77a567664c3dfed544ede87a05f5bf6ed1c8a2 Mon Sep 17 00:00:00 2001 From: Graham Christensen Date: Fri, 31 May 2024 11:40:33 -0400 Subject: [PATCH 3/4] eslint stricter --- .eslintrc.json | 1 + 1 file changed, 1 insertion(+) diff --git a/.eslintrc.json b/.eslintrc.json index 6499d3b..5966041 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -29,6 +29,7 @@ "accessibility": "no-public" } ], + "@typescript-eslint/no-base-to-string": "error", "@typescript-eslint/no-require-imports": "error", "@typescript-eslint/array-type": "error", "@typescript-eslint/await-thenable": "error", From aecc58b9ac65e8264da763b5735975a216f35f9d Mon Sep 17 00:00:00 2001 From: Luc Perkins Date: Mon, 3 Jun 2024 09:12:51 -0700 Subject: [PATCH 4/4] Update detsys-ts (status page changes) --- dist/index.js | 120 ++++++++++++++++++++++++++++++++++++++++++++++--- pnpm-lock.yaml | 6 +-- 2 files changed, 118 insertions(+), 8 deletions(-) diff --git a/dist/index.js b/dist/index.js index 36238cd..59bb8c5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -93735,7 +93735,7 @@ const external_node_path_namespaceObject = __WEBPACK_EXTERNAL_createRequire(impo const external_node_stream_promises_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:stream/promises"); ;// CONCATENATED MODULE: external "node:zlib" const external_node_zlib_namespaceObject = __WEBPACK_EXTERNAL_createRequire(import.meta.url)("node:zlib"); -;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@9d66d2c89c150f796165fdcc20b3be538807c0f4_46ybmzqhaua4eiwu3nj2qm63te/node_modules/detsys-ts/dist/index.js +;// CONCATENATED MODULE: ./node_modules/.pnpm/github.com+DeterminateSystems+detsys-ts@fe64ba33b4bdeec0991bb65ae00420bf68b9954c_ler7zqcm5mrt635umsvjcuxcmy/node_modules/detsys-ts/dist/index.js var __defProp = Object.defineProperty; var __export = (target, all) => { for (var name in all) @@ -94072,7 +94072,7 @@ var IdsHost = class { setPrioritizedUrls(urls) { this.prioritizedURLs = urls; } - async getRootUrl() { + async getDynamicRootUrl() { const idsHost = process.env["IDS_HOST"]; if (idsHost !== void 0) { try { @@ -94093,9 +94093,17 @@ var IdsHost = class { ); } if (url === void 0) { - url = new URL(DEFAULT_IDS_HOST); + return void 0; + } else { + return new URL(url); } - return new URL(url); + } + async getRootUrl() { + const url = await this.getDynamicRootUrl(); + if (url === void 0) { + return new URL(DEFAULT_IDS_HOST); + } + return url; } async getDiagnosticsUrl() { if (this.runtimeDiagnosticsUrl === "") { @@ -94406,6 +94414,7 @@ var STATE_KEY_EXECUTION_PHASE = "detsys_action_execution_phase"; var STATE_KEY_NIX_NOT_FOUND = "detsys_action_nix_not_found"; var STATE_NOT_FOUND = "not-found"; var DIAGNOSTIC_ENDPOINT_TIMEOUT_MS = 3e4; +var CHECK_IN_ENDPOINT_TIMEOUT_MS = 5e3; var DetSysAction = class { determineExecutionPhase() { const currentPhase = core.getState(STATE_KEY_EXECUTION_PHASE); @@ -94428,6 +94437,8 @@ var DetSysAction = class { this.exceptionAttachments = /* @__PURE__ */ new Map(); this.nixStoreTrust = "unknown"; this.strictMode = getBool("_internal-strict-mode"); + this.features = {}; + this.featureEventMetadata = /* @__PURE__ */ new Map(); this.events = []; this.client = got_dist_source.extend({ retry: { @@ -94537,11 +94548,13 @@ var DetSysAction = class { return this.identity; } recordEvent(eventName, context = {}) { + const prefixedName = eventName === "$feature_flag_called" ? eventName : `${this.actionOptions.eventPrefix}${eventName}`; this.events.push({ - event_name: `${this.actionOptions.eventPrefix}${eventName}`, + event_name: prefixedName, context, correlation: this.identity, facts: this.facts, + features: this.featureEventMetadata, timestamp: /* @__PURE__ */ new Date(), uuid: (0,external_node_crypto_namespaceObject.randomUUID)() }); @@ -94577,6 +94590,7 @@ var DetSysAction = class { } async executeAsync() { try { + await this.checkIn(); process.env.DETSYS_CORRELATION = JSON.stringify( this.getCorrelationHashes() ); @@ -94624,6 +94638,94 @@ var DetSysAction = class { await this.complete(); } } + async checkIn() { + const checkin = await this.requestCheckIn(); + if (checkin === void 0) { + return; + } + this.features = checkin.options; + for (const [key, feature] of Object.entries(this.features)) { + this.featureEventMetadata.set(key, feature.variant); + } + const impactSymbol = /* @__PURE__ */ new Map([ + ["none", "\u26AA"], + ["maintenance", "\u{1F6E0}\uFE0F"], + ["minor", "\u{1F7E1}"], + ["major", "\u{1F7E0}"], + ["critical", "\u{1F534}"] + ]); + const defaultImpactSymbol = "\u{1F535}"; + if (checkin.status !== null) { + const summaries = []; + for (const incident of checkin.status.incidents) { + summaries.push( + `${impactSymbol.get(incident.impact) || defaultImpactSymbol} ${incident.status.replace("_", " ")}: ${incident.name} (${incident.shortlink})` + ); + } + for (const maintenance of checkin.status.scheduled_maintenances) { + summaries.push( + `${impactSymbol.get(maintenance.impact) || defaultImpactSymbol} ${maintenance.status.replace("_", " ")}: ${maintenance.name} (${maintenance.shortlink})` + ); + } + if (summaries.length > 0) { + core.info( + // Bright red, Bold, Underline + `${"\x1B[0;31m"}${"\x1B[1m"}${"\x1B[4m"}${checkin.status.page.name} Status` + ); + for (const notice of summaries) { + core.info(notice); + } + core.info(`See: ${checkin.status.page.url}`); + core.info(``); + } + } + } + getFeature(name) { + if (!this.features.hasOwnProperty(name)) { + return void 0; + } + const result = this.features[name]; + if (result === void 0) { + return void 0; + } + this.recordEvent("$feature_flag_called", { + $feature_flag: name, + $feature_flag_response: result.variant + }); + return result; + } + /** + * Check in to install.determinate.systems, to accomplish three things: + * + * 1. Preflight the server selected from IdsHost, to increase the chances of success. + * 2. Fetch any incidents and maintenance events to let users know in case things are weird. + * 3. Get feature flag data so we can gently roll out new features. + */ + async requestCheckIn() { + for (let attemptsRemaining = 5; attemptsRemaining > 0; attemptsRemaining--) { + const checkInUrl = await this.getCheckInUrl(); + if (checkInUrl === void 0) { + return void 0; + } + try { + core.debug(`Preflighting via ${checkInUrl}`); + checkInUrl.searchParams.set("ci", "github"); + checkInUrl.searchParams.set( + "correlation", + JSON.stringify(this.identity) + ); + return await this.client.get(checkInUrl, { + timeout: { + request: CHECK_IN_ENDPOINT_TIMEOUT_MS + } + }).json(); + } catch (e) { + core.debug(`Error checking in: ${stringifyError2(e)}`); + this.idsHost.markCurrentHostBroken(); + } + } + return void 0; + } /** * Fetch an artifact, such as a tarball, from the location determined by the * `source-*` inputs. If `source-binary` is specified, this will return a path @@ -94701,6 +94803,14 @@ var DetSysAction = class { this.recordEvent(`complete_${this.executionPhase}`); await this.submitEvents(); } + async getCheckInUrl() { + const checkInUrl = await this.idsHost.getDynamicRootUrl(); + if (checkInUrl === void 0) { + return void 0; + } + checkInUrl.pathname += "check-in"; + return checkInUrl; + } async getSourceUrl() { const p = this.sourceParameters; if (p.url) { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6c3c473..2559c91 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -13,7 +13,7 @@ dependencies: version: 1.1.1 detsys-ts: specifier: github:DeterminateSystems/detsys-ts - version: github.com/DeterminateSystems/detsys-ts/9d66d2c89c150f796165fdcc20b3be538807c0f4 + version: github.com/DeterminateSystems/detsys-ts/fe64ba33b4bdeec0991bb65ae00420bf68b9954c devDependencies: '@trivago/prettier-plugin-sort-imports': @@ -4458,8 +4458,8 @@ packages: engines: {node: '>=12.20'} dev: true - github.com/DeterminateSystems/detsys-ts/9d66d2c89c150f796165fdcc20b3be538807c0f4: - resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/9d66d2c89c150f796165fdcc20b3be538807c0f4} + github.com/DeterminateSystems/detsys-ts/fe64ba33b4bdeec0991bb65ae00420bf68b9954c: + resolution: {tarball: https://codeload.github.com/DeterminateSystems/detsys-ts/tar.gz/fe64ba33b4bdeec0991bb65ae00420bf68b9954c} name: detsys-ts version: 1.0.0 dependencies: