Merge pull request #2207 from github/henrymercer/more-processing-error-categorization
Mark some more processing errors as invalid SARIF upload requests
This commit is contained in:
commit
964f5e7811
3 changed files with 13 additions and 6 deletions
5
lib/upload-lib.js
generated
5
lib/upload-lib.js
generated
|
|
@ -383,8 +383,9 @@ function shouldConsiderConfigurationError(processingErrors) {
|
||||||
* Returns whether the provided processing errors are the result of an invalid SARIF upload request.
|
* Returns whether the provided processing errors are the result of an invalid SARIF upload request.
|
||||||
*/
|
*/
|
||||||
function shouldConsiderInvalidRequest(processingErrors) {
|
function shouldConsiderInvalidRequest(processingErrors) {
|
||||||
return (processingErrors.length === 1 &&
|
return processingErrors.every((error) => error.startsWith("rejecting SARIF") ||
|
||||||
processingErrors[0].startsWith("rejecting SARIF,"));
|
error.startsWith("could not convert rules: invalid security severity value, is not a number") ||
|
||||||
|
/^SARIF URI scheme [^\s]* did not match the checkout URI scheme [^\s]*/.test(error));
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Checks the processing result for an unsuccessful execution. Throws if the
|
* Checks the processing result for an unsuccessful execution. Throws if the
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
|
|
@ -530,9 +530,15 @@ function shouldConsiderConfigurationError(processingErrors: string[]): boolean {
|
||||||
* Returns whether the provided processing errors are the result of an invalid SARIF upload request.
|
* Returns whether the provided processing errors are the result of an invalid SARIF upload request.
|
||||||
*/
|
*/
|
||||||
function shouldConsiderInvalidRequest(processingErrors: string[]): boolean {
|
function shouldConsiderInvalidRequest(processingErrors: string[]): boolean {
|
||||||
return (
|
return processingErrors.every(
|
||||||
processingErrors.length === 1 &&
|
(error) =>
|
||||||
processingErrors[0].startsWith("rejecting SARIF,")
|
error.startsWith("rejecting SARIF") ||
|
||||||
|
error.startsWith(
|
||||||
|
"could not convert rules: invalid security severity value, is not a number",
|
||||||
|
) ||
|
||||||
|
/^SARIF URI scheme [^\s]* did not match the checkout URI scheme [^\s]*/.test(
|
||||||
|
error,
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue