Tolerate NoSourceCodeSeen errors in CCR

This commit is contained in:
Michael B. Gale
2026-01-21 15:56:37 +00:00
parent 90379d9b6f
commit 796f1f4bd8
13 changed files with 180 additions and 3 deletions

View File

@@ -102946,6 +102946,7 @@ var cliErrorsConfig = {
// was unintended to have CodeQL analysis run on it.
["NoSourceCodeSeen" /* NoSourceCodeSeen */]: {
exitCode: 32,
toleratedByCCR: true,
cliErrorMessageCandidates: [
new RegExp(
"CodeQL detected code written in .* but could not process any of it"
@@ -103034,6 +103035,15 @@ function getUnsupportedPlatformError(cliError) {
`The CodeQL CLI does not support the platform/architecture combination of ${process.platform}/${process.arch} (see ${"https://codeql.github.com/docs/codeql-overview/system-requirements/" /* SYSTEM_REQUIREMENTS */}). The underlying error was: ${cliError.message}`
);
}
var ToleratedConfigurationError = class extends ConfigurationError {
constructor(category, message) {
super(message);
this.category = category;
}
getCategory() {
return this.category;
}
};
function wrapCliConfigurationError(cliError) {
if (isUnsupportedPlatform()) {
return getUnsupportedPlatformError(cliError);
@@ -103047,6 +103057,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}