Remove support for CodeQL v2.12.5 and earlier
This commit is contained in:
parent
2f0d0eaebd
commit
1a60a91726
19 changed files with 45 additions and 315 deletions
|
|
@ -1,8 +1,5 @@
|
|||
import { ConfigurationError } from "./util";
|
||||
|
||||
const NO_SOURCE_CODE_SEEN_DOCS_LINK =
|
||||
"https://gh.io/troubleshooting-code-scanning/no-source-code-seen-during-build";
|
||||
|
||||
/**
|
||||
* A class of Error that we can classify as an error stemming from a CLI
|
||||
* invocation, with associated exit code, stderr,etc.
|
||||
|
|
@ -203,15 +200,6 @@ export const cliErrorsConfig: Record<
|
|||
new RegExp(
|
||||
"CodeQL did not detect any code written in languages supported by CodeQL",
|
||||
),
|
||||
/**
|
||||
* Earlier versions of the JavaScript extractor (pre-CodeQL 2.12.0) extract externs even if no
|
||||
* source code was found. This means that we don't get the no code found error from
|
||||
* `codeql database finalize`. To ensure users get a good error message, we detect this manually
|
||||
* here, and upon detection override the error message.
|
||||
*
|
||||
* This can be removed once support for CodeQL 2.11.6 is removed.
|
||||
*/
|
||||
new RegExp("No JavaScript or TypeScript code found"),
|
||||
],
|
||||
},
|
||||
|
||||
|
|
@ -262,18 +250,6 @@ export function getCliConfigCategoryIfExists(
|
|||
return undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prepend a clearer error message with the docs link if the error message does not already
|
||||
* include it. Can be removed once support for CodeQL 2.11.6 is removed; at that point, all runs
|
||||
* should already include the doc link.
|
||||
*/
|
||||
function prependDocsLinkIfApplicable(cliErrorMessage: string): string {
|
||||
if (!cliErrorMessage.includes(NO_SOURCE_CODE_SEEN_DOCS_LINK)) {
|
||||
return `No code found during the build. Please see: ${NO_SOURCE_CODE_SEEN_DOCS_LINK}. Detailed error: ${cliErrorMessage}`;
|
||||
}
|
||||
return cliErrorMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Changes an error received from the CLI to a ConfigurationError with optionally an extra
|
||||
* error message appended, if it exists in a known set of configuration errors. Otherwise,
|
||||
|
|
@ -291,12 +267,6 @@ export function wrapCliConfigurationError(cliError: Error): Error {
|
|||
|
||||
let errorMessageBuilder = cliError.message;
|
||||
|
||||
// Can be removed once support for CodeQL 2.11.6 is removed; at that point, all runs should
|
||||
// already include the doc link.
|
||||
if (cliConfigErrorCategory === CliConfigErrorCategory.NoSourceCodeSeen) {
|
||||
errorMessageBuilder = prependDocsLinkIfApplicable(errorMessageBuilder);
|
||||
}
|
||||
|
||||
const additionalErrorMessageToAppend =
|
||||
cliErrorsConfig[cliConfigErrorCategory].additionalErrorMessageToAppend;
|
||||
if (additionalErrorMessageToAppend !== undefined) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue