diff --git a/lib/cli-errors.js b/lib/cli-errors.js index fe19ce6be8..ef1fb9899a 100644 --- a/lib/cli-errors.js +++ b/lib/cli-errors.js @@ -110,27 +110,27 @@ var CliConfigErrorCategory; exports.cliErrorsConfig = { // Version of CodeQL CLI is incompatible with this version of the CodeQL Action [CliConfigErrorCategory.IncompatibleWithActionVersion]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("is not compatible with this CodeQL CLI"), ], }, [CliConfigErrorCategory.InitCalledTwice]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("Refusing to create databases .* but could not process any of it"), ], additionalErrorMessageToAppend: `Is the "init" action called twice in the same job?`, }, // Expected source location for database creation does not exist [CliConfigErrorCategory.InvalidSourceRoot]: { - cliErrorMessageSnippets: [new RegExp("Invalid source root")], + cliErrorMessageCandidates: [new RegExp("Invalid source root")], }, [CliConfigErrorCategory.NoBuildCommandAutodetected]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("Could not auto-detect a suitable build method"), ], }, [CliConfigErrorCategory.NoBuildMethodAutodetected]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("Could not detect a suitable build command for the source checkout"), ], }, @@ -138,7 +138,7 @@ exports.cliErrorsConfig = { // was unintended to have CodeQL analysis run on it. [CliConfigErrorCategory.NoSourceCodeSeen]: { exitCode: 32, - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("CodeQL detected code written in .* but could not process any of it"), new RegExp("CodeQL did not detect any code written in languages supported by CodeQL"), /** @@ -153,12 +153,14 @@ exports.cliErrorsConfig = { ], }, [CliConfigErrorCategory.NoSupportedBuildCommandSucceeded]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("No supported build command succeeded"), ], }, [CliConfigErrorCategory.NoSupportedBuildSystemDetected]: { - cliErrorMessageSnippets: [new RegExp("No supported build system detected")], + cliErrorMessageCandidates: [ + new RegExp("No supported build system detected"), + ], }, }; /** @@ -174,7 +176,7 @@ function getCliConfigCategoryIfExists(cliError) { cliError.exitCode === configuration.exitCode) { return category; } - for (const e of configuration.cliErrorMessageSnippets) { + for (const e of configuration.cliErrorMessageCandidates) { if (cliError.message.match(e) || cliError.stderr.match(e)) { return category; } diff --git a/lib/cli-errors.js.map b/lib/cli-errors.js.map index 8b13a49d84..a87998863f 100644 --- a/lib/cli-errors.js.map +++ b/lib/cli-errors.js.map @@ -1 +1 @@ -{"version":3,"file":"cli-errors.js","sourceRoot":"","sources":["../src/cli-errors.ts"],"names":[],"mappings":";;;AAAA,iCAA4C;AAE5C,MAAM,6BAA6B,GACjC,8EAA8E,CAAC;AAEjF;;;GAGG;AACH,MAAa,sBAAuB,SAAQ,KAAK;IAC/C,YACE,GAAW,EACX,IAAc,EACP,QAAgB,EAChB,MAAc,EACd,MAAc;QAErB,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;aACjC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;aAC5C,IAAI,CAAC,GAAG,CAAC,CAAC;QAEb,MAAM,WAAW,GAAG,kBAAkB,CAAC,MAAM,CAAC,CAAC;QAC/C,MAAM,QAAQ,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,IAAI,EAAE,CAAC;QACzD,IAAI,KAAK,GAAG,WAAW;YACrB,CAAC,CAAC,mBAAmB,WAAW,CAAC,IAAI,EAAE,EAAE;YACzC,CAAC,CAAC,QAAQ;gBACV,CAAC,CAAC,2BAA2B,QAAQ,EAAE;gBACvC,CAAC,CAAC,EAAE,CAAC;QACP,IAAI,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,KAAK,GAAG,EAAE,CA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C;IAED,MAAM,sBAAsB,GAAG,4BAA4B,CAAC,QAAQ,CAAC,CAAC;IACtE,IAAI,sBAAsB,KAAK,SAAS,EAAE,CAAC;QACzC,OAAO,QAAQ,CAAC;IAClB,CAAC;IAED,IAAI,mBAAmB,GAAG,QAAQ,CAAC,OAAO,CAAC;IAE3C,2FAA2F;IAC3F,gCAAgC;IAChC,IAAI,sBAAsB,KAAK,sBAAsB,CAAC,gBAAgB,EAAE,CAAC;QACvE,mBAAmB,GAAG,2BAA2B,CAAC,mBAAmB,CAAC,CAAC;IACzE,CAAC;IAED,MAAM,8BAA8B,GAClC,uBAAe,CAAC,sBAAsB,CAAC,CAAC,8BAA8B,CAAC;IACzE,IAAI,8BAA8B,KAAK,SAAS,EAAE,CAAC;QACjD,mBAAmB,GAAG,GAAG,mBAAmB,IAAI,8BAA8B,EAAE,CAAC;IACnF,CAAC;IAED,OAAO,IAAI,yBAAkB,CAAC,mBAAmB,CAAC,CAAC;AACrD,CAAC;AAzBD,8DAyBC"} \ No newline at end of file diff --git a/src/cli-errors.ts b/src/cli-errors.ts index 36abcde366..4fc634ec1a 100644 --- a/src/cli-errors.ts +++ b/src/cli-errors.ts @@ -113,10 +113,9 @@ export enum CliConfigErrorCategory { } type CliErrorConfiguration = { - /** One of these snippets, or the exit code, must be present in the error message. */ - cliErrorMessageSnippets: RegExp[]; + /** One of these candidates, or the exit code, must be present in the error message. */ + cliErrorMessageCandidates: RegExp[]; exitCode?: number; - // Optional additional message to append for this type of CLI error. additionalErrorMessageToAppend?: string; }; @@ -130,12 +129,12 @@ export const cliErrorsConfig: Record< > = { // Version of CodeQL CLI is incompatible with this version of the CodeQL Action [CliConfigErrorCategory.IncompatibleWithActionVersion]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("is not compatible with this CodeQL CLI"), ], }, [CliConfigErrorCategory.InitCalledTwice]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp( "Refusing to create databases .* but could not process any of it", ), @@ -144,15 +143,15 @@ export const cliErrorsConfig: Record< }, // Expected source location for database creation does not exist [CliConfigErrorCategory.InvalidSourceRoot]: { - cliErrorMessageSnippets: [new RegExp("Invalid source root")], + cliErrorMessageCandidates: [new RegExp("Invalid source root")], }, [CliConfigErrorCategory.NoBuildCommandAutodetected]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("Could not auto-detect a suitable build method"), ], }, [CliConfigErrorCategory.NoBuildMethodAutodetected]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp( "Could not detect a suitable build command for the source checkout", ), @@ -162,7 +161,7 @@ export const cliErrorsConfig: Record< // was unintended to have CodeQL analysis run on it. [CliConfigErrorCategory.NoSourceCodeSeen]: { exitCode: 32, - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp( "CodeQL detected code written in .* but could not process any of it", ), @@ -182,12 +181,14 @@ export const cliErrorsConfig: Record< }, [CliConfigErrorCategory.NoSupportedBuildCommandSucceeded]: { - cliErrorMessageSnippets: [ + cliErrorMessageCandidates: [ new RegExp("No supported build command succeeded"), ], }, [CliConfigErrorCategory.NoSupportedBuildSystemDetected]: { - cliErrorMessageSnippets: [new RegExp("No supported build system detected")], + cliErrorMessageCandidates: [ + new RegExp("No supported build system detected"), + ], }, }; @@ -209,7 +210,7 @@ export function getCliConfigCategoryIfExists( return category as CliConfigErrorCategory; } - for (const e of configuration.cliErrorMessageSnippets) { + for (const e of configuration.cliErrorMessageCandidates) { if (cliError.message.match(e) || cliError.stderr.match(e)) { return category as CliConfigErrorCategory; }