review-comments: refactor getActionsStatus to accept an extra parameter designating if the analysis is third-party

This commit is contained in:
Fotis Koutoulakis (@NlightNFotis) 2025-04-01 14:58:59 +01:00
parent 01f1a1f2c9
commit 55ee663d5f
30 changed files with 121 additions and 56 deletions

8
lib/status-report.js generated
View file

@ -80,10 +80,12 @@ var JobStatus;
JobStatus["FailureStatus"] = "JOB_STATUS_FAILURE";
JobStatus["ConfigErrorStatus"] = "JOB_STATUS_CONFIGURATION_ERROR";
})(JobStatus || (exports.JobStatus = JobStatus = {}));
function getActionsStatus(error, otherFailureCause) {
function getActionsStatus(isThirdPartyAnalysis, error, otherFailureCause) {
if (error || otherFailureCause) {
if (error instanceof util_1.ConfigurationError ||
error instanceof upload_lib_1.InvalidSarifUploadError) {
if (error instanceof util_1.ConfigurationError) {
return "user-error";
}
if (error instanceof upload_lib_1.InvalidSarifUploadError && isThirdPartyAnalysis) {
return "user-error";
}
return "failure";