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
+16
View File
@@ -142861,6 +142861,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"
@@ -142949,6 +142950,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);
@@ -142962,6 +142972,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}
+18 -1
View File
@@ -105443,6 +105443,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"
@@ -105531,6 +105532,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);
@@ -105544,6 +105554,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}
@@ -111530,7 +111546,8 @@ async function run(startedAt2) {
core14.exportVariable("CODEQL_ACTION_ANALYZE_DID_COMPLETE_SUCCESSFULLY" /* ANALYZE_DID_COMPLETE_SUCCESSFULLY */, "true");
} catch (unwrappedError) {
const error3 = wrapError(unwrappedError);
if (getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput()) {
const tolerateErrorForCCR = isCCR() && error3 instanceof ToleratedConfigurationError;
if (!tolerateErrorForCCR && (getOptionalInput("expect-error") !== "true" || hasBadExpectErrorInput())) {
core14.setFailed(error3.message);
}
await sendStatusReport2(
+16
View File
@@ -102023,6 +102023,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"
@@ -102111,6 +102112,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);
@@ -102124,6 +102134,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}
+16
View File
@@ -146182,6 +146182,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"
@@ -146270,6 +146271,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);
@@ -146283,6 +146293,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}
+16
View File
@@ -105276,6 +105276,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"
@@ -105364,6 +105365,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);
@@ -105377,6 +105387,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}
+16
View File
@@ -102022,6 +102022,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"
@@ -102110,6 +102111,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);
@@ -102123,6 +102133,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}
+16
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);
}
+1
View File
@@ -143012,6 +143012,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"
+16
View File
@@ -105056,6 +105056,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"
@@ -105144,6 +105145,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);
@@ -105157,6 +105167,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}
+1
View File
@@ -142696,6 +142696,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"
+16
View File
@@ -106224,6 +106224,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"
@@ -106312,6 +106313,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);
@@ -106325,6 +106335,12 @@ function wrapCliConfigurationError(cliError) {
if (additionalErrorMessageToAppend !== void 0) {
errorMessageBuilder = `${errorMessageBuilder} ${additionalErrorMessageToAppend}`;
}
if (cliErrorsConfig[cliConfigErrorCategory].toleratedByCCR) {
return new ToleratedConfigurationError(
cliConfigErrorCategory,
errorMessageBuilder
);
}
return new ConfigurationError(errorMessageBuilder);
}