From 583a1019cc4829ff6b4a2b97891e9b9890ad9a3f Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 6 Sep 2023 18:14:30 +0100 Subject: [PATCH 1/2] Mark invalid SARIF errors as user errors in the `upload-sarif` Action --- lib/analyze-action.js | 4 +- lib/analyze-action.js.map | 2 +- lib/init-action-post-helper.js | 2 +- lib/init-action-post-helper.js.map | 2 +- lib/upload-lib.js | 46 ++++++++++++------ lib/upload-lib.js.map | 2 +- lib/upload-sarif-action.js | 2 +- lib/upload-sarif-action.js.map | 2 +- src/analyze-action.ts | 3 +- src/init-action-post-helper.ts | 1 + src/upload-lib.ts | 75 ++++++++++++++++++++---------- src/upload-sarif-action.ts | 1 + 12 files changed, 95 insertions(+), 47 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 59bc49d041..e92913756b 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -155,7 +155,7 @@ async function run() { throw new Error("Config file could not be found at expected location. Has the 'init' action been called?"); } if (hasBadExpectErrorInput()) { - throw new Error("`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork."); + throw new util.UserError("`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork."); } const apiDetails = (0, api_client_1.getApiDetails)(); const outputDir = actionsUtil.getRequiredInput("output"); @@ -180,7 +180,7 @@ async function run() { core.setOutput("sarif-output", path_1.default.resolve(outputDir)); const uploadInput = actionsUtil.getOptionalInput("upload"); if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") { - uploadResult = await uploadLib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger); + uploadResult = await uploadLib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { invalidRequestIsUserError: false }); core.setOutput("sarif-id", uploadResult.sarifID); } else { diff --git a/lib/analyze-action.js.map b/lib/analyze-action.js.map index 21b864f3f3..f3068db93b 100644 --- a/lib/analyze-action.js.map +++ b/lib/analyze-action.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AAEtC,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAgF;AAChF,uDAAoD;AACpD,+CAAuC;AACvC,mDAAoD;AACpD,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wDAA0C;AAE1C,6CAA+B;AAC/B,iCAAoD;AAkBpD,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,MAA0B,EAC1B,KAAuC,EACvC,KAAwB,EACxB,mBAAuC,EACvC,iBAAsD,EACtD,mBAA4B,EAC5B,MAAc;IAEd,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,MAAM,IAAI,CAAC,cAAc,EAAE,EAC3B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IACF,MAAM,MAAM,GAAuB;QACjC,GAAG,gBAAgB;QACnB,GAAG,CAAC,MAAM;YACR,CAAC,CAAC;gBACE,6BAA6B,EAAE,IAAA,0CAA2B,EAAC,MAAM,CAAC;aACnE;YACH,CAAC,CAAC,EAAE,CAAC;QACP,GAAG,CAAC,KAAK,IAAI,EAAE,CAAC;QAChB,GAAG,CAAC,iBAAiB,IAAI,EAAE,CAAC;KAC7B,CAAC;IACF,IAAI,MAAM,IAAI,mBAAmB,EAAE;QACjC,MAAM,2BAA2B,GAAqC;YACpE,GAAG,MAAM;YACT,6BA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MAAM,kBAAU,CAAC;KAClB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACtE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AAEtC,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAgF;AAChF,uDAAoD;AACpD,+CAAuC;AACvC,mDAAoD;AACpD,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wDAA0C;AAE1C,6CAA+B;AAC/B,iCAAoD;AAkBpD,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,MAA0B,EAC1B,KAAuC,EACvC,KAAwB,EACxB,mBAAuC,EACvC,iBAAsD,EACtD,mBAA4B,EAC5B,MAAc;IAEd,MAAM,MAAM,GAAG,IAAA,gCAAgB,EAAC,KAAK,EAAE,KAAK,EAAE,wBAAwB,CAAC,CAAC;IACxE,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,QAAQ,EACR,MAAM,EACN,SAAS,EACT,MAAM,IAAI,CAAC,cAAc,EAAE,EAC3B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IACF,MAAM,MAAM,GAAuB;QACjC,GAAG,gBAAgB;QACnB,GAAG,CAAC,MAAM;YACR,CAAC,CAAC;gBACE,6BAA6B,EAAE,IAAA,0CAA2B,EAAC,MAAM,CAAC;aACnE;YACH,CAAC,CA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,MAAM,CACP,CAAC;KACH;SAAM;QACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;AACH,CAAC;AAEY,QAAA,UAAU,GAAG,GAAG,EAAE,CAAC;AAEhC,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,kBAAU,CAAC;KAClB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACtE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/init-action-post-helper.js b/lib/init-action-post-helper.js index ff27331bcb..168c15202e 100644 --- a/lib/init-action-post-helper.js +++ b/lib/init-action-post-helper.js @@ -74,7 +74,7 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) { await codeql.databaseExportDiagnostics(databasePath, sarifFile, category, config.tempDir, logger); } core.info(`Uploading failed SARIF file ${sarifFile}`); - const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger); + const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger, { invalidRequestIsUserError: false }); await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true }); return uploadResult?.statusReport ?? {}; } diff --git a/lib/init-action-post-helper.js.map b/lib/init-action-post-helper.js.map index ad0be3f70a..9232e898d9 100644 --- a/lib/init-action-post-helper.js.map +++ b/lib/init-action-post-helper.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,qCAAqC;A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AAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAtDD,kBAsDC"} \ No newline at end of file +{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AACvC,mDAA6D;AAG7D,wDAA0C;AAC1C,iCAKgB;AAChB,yCAKoB;AAWpB,SAAS,mCAAmC,CAC1C,KAAc;IAEd,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;IACtC,OAAO;QACL,uBAAuB,EAAE,YAAY,CAAC,OAAO;QAC7C,6BAA6B,EAAE,YAAY,CAAC,KAAK;KAClD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CACnC,MAAc,EACd,aAA4B,EAC5B,QAA2B,EAC3B,MAAc;IAEd,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,CAAC;KAC1E;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,uBAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,EAAE;QACxE,OAAO,EAAE,iCAAiC,EAAE,kBAAkB,EAAE,CAAC;KAClE;IACD,MAAM,QAAQ,GAAG,MAAM,IAAA,sBAAW,EAAC,MAAM,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,IAAA,0BAAmB,EAAC,YAAY,CAAC,CAAC;IAClD,MAAM,MAAM,GAAG,IAAA,u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OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,KAAK,MAAM;QAClE,CAAC,uBAAuB,CAAC,qBAAqB,EAC9C;QACA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,4EAA4E;YAC1E,8BAA8B,KAAK,GAAG,CACzC,CAAC;KACH;IAED,qDAAqD;IACrD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,IAAI,CAAC,IAAI,CACP,mGAAmG,CACpG,CAAC;QACF,MAAM,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAtDD,kBAsDC"} \ No newline at end of file diff --git a/lib/upload-lib.js b/lib/upload-lib.js index fd5485e10b..04b63b0087 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -55,7 +55,7 @@ function combineSarifFiles(sarifFiles) { combinedSarif.version = sarifObject.version; } else if (combinedSarif.version !== sarifObject.version) { - throw new Error(`Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`); + throw new InvalidUploadSarifRequest(`Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`); } combinedSarif.runs.push(...sarifObject.runs); } @@ -129,21 +129,33 @@ function findSarifFilesInDir(sarifPath) { return sarifFiles; } exports.findSarifFilesInDir = findSarifFilesInDir; -// Uploads a single sarif file or a directory of sarif files -// depending on what the path happens to refer to. -async function uploadFromActions(sarifPath, checkoutPath, category, logger) { - return await uploadFiles(getSarifFilePaths(sarifPath), (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), await actionsUtil.getCommitOid(checkoutPath), await actionsUtil.getRef(), await api.getAnalysisKey(), category, util.getRequiredEnvParam("GITHUB_WORKFLOW"), actionsUtil.getWorkflowRunID(), actionsUtil.getWorkflowRunAttempt(), checkoutPath, actionsUtil.getRequiredInput("matrix"), logger); +/** + * Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers to. + * + * @param invalidRequestIsUserError Whether an invalid request, for example one with a `sarifPath` + * that does not exist, should be considered a user error. + */ +async function uploadFromActions(sarifPath, checkoutPath, category, logger, { invalidRequestIsUserError }) { + try { + return await uploadFiles(getSarifFilePaths(sarifPath), (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), await actionsUtil.getCommitOid(checkoutPath), await actionsUtil.getRef(), await api.getAnalysisKey(), category, util.getRequiredEnvParam("GITHUB_WORKFLOW"), actionsUtil.getWorkflowRunID(), actionsUtil.getWorkflowRunAttempt(), checkoutPath, actionsUtil.getRequiredInput("matrix"), logger); + } + catch (e) { + if (e instanceof InvalidUploadSarifRequest && invalidRequestIsUserError) { + throw new util_1.UserError(e.message); + } + throw e; + } } exports.uploadFromActions = uploadFromActions; function getSarifFilePaths(sarifPath) { if (!fs.existsSync(sarifPath)) { - throw new Error(`Path does not exist: ${sarifPath}`); + throw new InvalidUploadSarifRequest(`Path does not exist: ${sarifPath}`); } let sarifFiles; if (fs.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath); if (sarifFiles.length === 0) { - throw new Error(`No SARIF files found to upload in "${sarifPath}".`); + throw new InvalidUploadSarifRequest(`No SARIF files found to upload in "${sarifPath}".`); } } else { @@ -159,14 +171,14 @@ function countResultsInSarif(sarif) { parsedSarif = JSON.parse(sarif); } catch (e) { - throw new Error(`Invalid SARIF. JSON syntax error: ${(0, util_1.wrapError)(e).message}`); + throw new InvalidUploadSarifRequest(`Invalid SARIF. JSON syntax error: ${(0, util_1.wrapError)(e).message}`); } if (!Array.isArray(parsedSarif.runs)) { - throw new Error("Invalid SARIF. Missing 'runs' array."); + throw new InvalidUploadSarifRequest("Invalid SARIF. Missing 'runs' array."); } for (const run of parsedSarif.runs) { if (!Array.isArray(run.results)) { - throw new Error("Invalid SARIF. Missing 'results' array in run."); + throw new InvalidUploadSarifRequest("Invalid SARIF. Missing 'results' array in run."); } numResults += run.results.length; } @@ -195,7 +207,7 @@ function validateSarifFileSchema(sarifFilePath, logger) { // Set the main error message to the stacks of all the errors. // This should be of a manageable size and may even give enough to fix the error. const sarifErrors = errors.map((e) => `- ${e.stack}`); - throw new Error(`Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join("\n")}`); + throw new InvalidUploadSarifRequest(`Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join("\n")}`); } } exports.validateSarifFileSchema = validateSarifFileSchema; @@ -334,7 +346,7 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = { const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`; throw shouldConsiderAsUserError(response.data.errors) ? new util_1.UserError(message) - : new Error(message); + : new InvalidUploadSarifRequest(message); } else { util.assertNever(status); @@ -397,7 +409,7 @@ function validateUniqueCategory(sarif) { for (const [category, { id, tool }] of Object.entries(categories)) { const sentinelEnvVar = `CODEQL_UPLOAD_SARIF_${category}`; if (process.env[sentinelEnvVar]) { - throw new Error("Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " + + throw new InvalidUploadSarifRequest("Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " + "The easiest fix is to specify a unique value for the `category` input. If .runs[].automationDetails.id is specified " + "in the sarif file, that will take precedence over your configured `category`. " + `Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})`); @@ -449,4 +461,12 @@ function pruneInvalidResults(sarif, logger) { return { ...sarif, runs: newRuns }; } exports.pruneInvalidResults = pruneInvalidResults; +/** + * An error that occurred due to an invalid SARIF upload request. + */ +class InvalidUploadSarifRequest extends Error { + constructor(message) { + super(message); + } +} //# sourceMappingURL=upload-lib.js.map \ No newline at end of file diff --git a/lib/upload-lib.js.map b/lib/upload-lib.js.map index 1e667549d6..1bc5524011 100644 --- a/lib/upload-lib.js.map +++ b/lib/upload-lib.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,qCAA8B;AAC9B,gDAAwB;AAExB,oDAAsC;AAEtC,wDAA+B;AAC/B,uDAAyC;AAEzC,4DAA8C;AAC9C,kDAAoC;AACpC,+CAAuC;AACvC,6DAA+C;AAE/C,6CAAiE;AACjE,6CAA+B;AAC/B,iCAAgF;AAEhF,mEAAmE;AACnE,qDAAqD;AACrD,SAAS,iBAAiB,CAAC,UAAoB;IAC7C,MAAM,aAAa,GAAc;QAC/B,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CACtB,CAAC;QACf,sBAAsB;QACtB,IAAI,aAAa,CAAC,OAAO,KAAK,IAAI,EAAE;YAClC,aAAa,CAAC,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;SAC7C;aAAM,IAAI,aAAa,CAAC,OAAO,KAAK,WAAW,CAAC,OAAO,EAAE;YACxD,MAAM,IAAI,KAAK,CACb,yCAAyC,aAAa,CAAC,OAAO,QAAQ,WAAW,CAAC,OAAO,EAAE,CAC5F,CAAC;SACH;QAED,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;KAC9C;IAED,OAAO,aAAa,CAAC;AACvB,CAAC;AAED,sFAAsF;AACtF,6CAA6C;AAC7C,SAAgB,4BAA4B,CAC1C,KAAgB,EAChB,QAA4B,EAC5B,YAAoB,EACpB,WAA+B;IAE/B,MAAM,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M,EAAE,eAAe,KAAK,QAAQ,EAC9C;YACA,mEAAmE;YACnE,iEAAiE;YACjE,qEAAqE;YACrE,MAAM,UAAU,GAAkB,EAAE,CAAC;YACrC,KAAK,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,IAAI,EAAE,EAAE;gBACtC,IACE,MAAM,CAAC,MAAM,KAAK,iCAAiC;oBACnD,CAAC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;wBACtC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAC3C;oBACA,MAAM,IAAI,CAAC,CAAC;oBACZ,SAAS;iBACV;gBACD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,CAAC,IAAI,CACT,UAAU,MAAM,kDAAkD,CACnE,CAAC;KACH;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AArCD,kDAqCC"} \ No newline at end of file +{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,qCAA8B;AAC9B,gDAAwB;AAExB,oDAAsC;AAEtC,wDAA+B;AAC/B,uDAAyC;AAEzC,4DAA8C;AAC9C,kDAAoC;AACpC,+CAAuC;AACvC,6DAA+C;AAE/C,6CAAiE;AACjE,6CAA+B;AAC/B,iCAAgF;AAEhF,mEAAmE;AACnE,qDAAqD;AACrD,SAAS,iBAAiB,CAAC,UAAoB;IAC7C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AAO,EAAE,IAAI,EAAE,QAAQ,CAAC,OAAO,CAAC;wBACtC,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAC3C;oBACA,MAAM,IAAI,CAAC,CAAC;oBACZ,SAAS;iBACV;gBACD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,CAAC,IAAI,CACT,UAAU,MAAM,kDAAkD,CACnE,CAAC;KACH;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AArCD,kDAqCC;AAED;;GAEG;AACH,MAAM,yBAA0B,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF"} \ No newline at end of file diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 5b23383d21..36b8b5d66b 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -47,7 +47,7 @@ async function run() { return; } try { - const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger); + const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { invalidRequestIsUserError: true }); core.setOutput("sarif-id", uploadResult.sarifID); // We don't upload results in test mode, so don't wait for processing if ((0, util_1.isInTestMode)()) { diff --git a/lib/upload-sarif-action.js.map b/lib/upload-sarif-action.js.map index f14df5caf8..d31bd8e9d4 100644 --- a/lib/upload-sarif-action.js.map +++ b/lib/upload-sarif-action.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAAkD;AAClD,uCAA6C;AAC7C,6CAAkD;AAClD,mDAKyB;AACzB,yDAA2C;AAC3C,iCAMgB;AAMhB,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,WAA0C;IAE1C,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,cAAc,EACd,SAAS,EACT,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,CACvB,CAAC;IACF,MAAM,YAAY,GAA4B;QAC5C,GAAG,gBAAgB;QACnB,GAAG,WAAW;KACf,CAAC;IACF,MAAM,IAAA,gCAAgB,EAAC,YAAY,CAAC,CAAC;AACvC,CAAC;AAED,KAAK,UAAU,GAAG;IAChB,MAAM,SAAS,GAAG,IAAI,IAAI,EAAE,CAAC;IAC7B,MAAM,MAAM,GAAG,IAAA,0BAAgB,GAAE,CAAC;IAClC,IAAA,4BAAqB,EAAC,IAAA,+BAAgB,GAAE,CAAC,CAAC;IAC1C,IACE,CAAC,CAAC,MAAM,IAAA,gCAAgB,EACtB,MAAM,IAAA,sCAAsB,EAC1B,cAAc,EACd,UAAU,EACV,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,CACvB,CACF,CAAC,EACF;QACA,OAAO;KACR;IAED,IAAI;QACF,MAAM,YAAY,GAAG,MAAM,UAAU,CAAC,iBAAiB,CACrD,WAAW,CAAC,gBAAgB,CAAC,YAAY,CAAC,EAC1C,WAAW,CAAC,gBAAgB,CAAC,eAAe,CAAC,EAC7C,WAAW,CAAC,gBAAgB,CAAC,UAAU,CAAC,EACxC,MAAM,CACP,CAAC;QACF,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,YAAY,CAAC,OAAO,CAAC,CAAC;QAEjD,qEAAqE;QACrE,IAAI,IAAA,mBAAY,GAAE,EAAE;YAClB,IAAI,CAAC,KAAK,CAAC,mDAAmD,CAAC,CAAC;SACjE;aAAM,IAAI,WAAW,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,KAAK,MAAM,EAAE;YACzE,MAAM,UAAU,CAAC,iBAAiB,CAChC,IAAA,+BAAkB,EAAC,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,CAAC,EAC5D,YAAY,CAAC,OAAO,EACpB,MAAM,CACP,CAAC;SACH;QACD,MAAM,uBAAuB,CAAC,SAAS,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACrE;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,cAAc,EACd,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;KACR;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CACZ,sCAAsC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACjE,CAAC;KACH;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oD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W,CAAC,gBAAgB,CAAC,qBAAqB,CAAC,KAAK,MAAM,EAAE;YACzE,MAAM,UAAU,CAAC,iBAAiB,CAChC,IAAA,+BAAkB,EAAC,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,CAAC,EAC5D,YAAY,CAAC,OAAO,EACpB,MAAM,CACP,CAAC;SACH;QACD,MAAM,uBAAuB,CAAC,SAAS,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACrE;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,cAAc,EACd,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;KACR;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CACZ,sCAAsC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACjE,CAAC;KACH;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/src/analyze-action.ts b/src/analyze-action.ts index c25063eec6..74308c8ba0 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -206,7 +206,7 @@ async function run() { } if (hasBadExpectErrorInput()) { - throw new Error( + throw new util.UserError( "`expect-error` input parameter is for internal use only. It should only be set by codeql-action or a fork.", ); } @@ -281,6 +281,7 @@ async function run() { actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, + { invalidRequestIsUserError: false }, ); core.setOutput("sarif-id", uploadResult.sarifID); } else { diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index e78e782e7f..b569cb432c 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -98,6 +98,7 @@ async function maybeUploadFailedSarif( checkoutPath, category, logger, + { invalidRequestIsUserError: false }, ); await uploadLib.waitForProcessing( repositoryNwo, diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 10c402f8de..e3f43257d0 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -33,7 +33,7 @@ function combineSarifFiles(sarifFiles: string[]): SarifFile { if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; } else if (combinedSarif.version !== sarifObject.version) { - throw new Error( + throw new InvalidUploadSarifRequest( `Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`, ); } @@ -155,40 +155,54 @@ export function findSarifFilesInDir(sarifPath: string): string[] { return sarifFiles; } -// Uploads a single sarif file or a directory of sarif files -// depending on what the path happens to refer to. +/** + * Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers to. + * + * @param invalidRequestIsUserError Whether an invalid request, for example one with a `sarifPath` + * that does not exist, should be considered a user error. + */ export async function uploadFromActions( sarifPath: string, checkoutPath: string, category: string | undefined, logger: Logger, + { invalidRequestIsUserError }: { invalidRequestIsUserError: boolean }, ): Promise { - return await uploadFiles( - getSarifFilePaths(sarifPath), - parseRepositoryNwo(util.getRequiredEnvParam("GITHUB_REPOSITORY")), - await actionsUtil.getCommitOid(checkoutPath), - await actionsUtil.getRef(), - await api.getAnalysisKey(), - category, - util.getRequiredEnvParam("GITHUB_WORKFLOW"), - actionsUtil.getWorkflowRunID(), - actionsUtil.getWorkflowRunAttempt(), - checkoutPath, - actionsUtil.getRequiredInput("matrix"), - logger, - ); + try { + return await uploadFiles( + getSarifFilePaths(sarifPath), + parseRepositoryNwo(util.getRequiredEnvParam("GITHUB_REPOSITORY")), + await actionsUtil.getCommitOid(checkoutPath), + await actionsUtil.getRef(), + await api.getAnalysisKey(), + category, + util.getRequiredEnvParam("GITHUB_WORKFLOW"), + actionsUtil.getWorkflowRunID(), + actionsUtil.getWorkflowRunAttempt(), + checkoutPath, + actionsUtil.getRequiredInput("matrix"), + logger, + ); + } catch (e) { + if (e instanceof InvalidUploadSarifRequest && invalidRequestIsUserError) { + throw new UserError(e.message); + } + throw e; + } } function getSarifFilePaths(sarifPath: string) { if (!fs.existsSync(sarifPath)) { - throw new Error(`Path does not exist: ${sarifPath}`); + throw new InvalidUploadSarifRequest(`Path does not exist: ${sarifPath}`); } let sarifFiles: string[]; if (fs.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath); if (sarifFiles.length === 0) { - throw new Error(`No SARIF files found to upload in "${sarifPath}".`); + throw new InvalidUploadSarifRequest( + `No SARIF files found to upload in "${sarifPath}".`, + ); } } else { sarifFiles = [sarifPath]; @@ -203,17 +217,19 @@ function countResultsInSarif(sarif: string): number { try { parsedSarif = JSON.parse(sarif); } catch (e) { - throw new Error( + throw new InvalidUploadSarifRequest( `Invalid SARIF. JSON syntax error: ${wrapError(e).message}`, ); } if (!Array.isArray(parsedSarif.runs)) { - throw new Error("Invalid SARIF. Missing 'runs' array."); + throw new InvalidUploadSarifRequest("Invalid SARIF. Missing 'runs' array."); } for (const run of parsedSarif.runs) { if (!Array.isArray(run.results)) { - throw new Error("Invalid SARIF. Missing 'results' array in run."); + throw new InvalidUploadSarifRequest( + "Invalid SARIF. Missing 'results' array in run.", + ); } numResults += run.results.length; } @@ -253,7 +269,7 @@ export function validateSarifFileSchema(sarifFilePath: string, logger: Logger) { // Set the main error message to the stacks of all the errors. // This should be of a manageable size and may even give enough to fix the error. const sarifErrors = errors.map((e) => `- ${e.stack}`); - throw new Error( + throw new InvalidUploadSarifRequest( `Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join( "\n", )}`, @@ -475,7 +491,7 @@ export async function waitForProcessing( const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`; throw shouldConsiderAsUserError(response.data.errors as string[]) ? new UserError(message) - : new Error(message); + : new InvalidUploadSarifRequest(message); } else { util.assertNever(status); } @@ -552,7 +568,7 @@ export function validateUniqueCategory(sarif: SarifFile): void { for (const [category, { id, tool }] of Object.entries(categories)) { const sentinelEnvVar = `CODEQL_UPLOAD_SARIF_${category}`; if (process.env[sentinelEnvVar]) { - throw new Error( + throw new InvalidUploadSarifRequest( "Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " + "The easiest fix is to specify a unique value for the `category` input. If .runs[].automationDetails.id is specified " + "in the sarif file, that will take precedence over your configured `category`. " + @@ -614,3 +630,12 @@ export function pruneInvalidResults( } return { ...sarif, runs: newRuns }; } + +/** + * An error that occurred due to an invalid SARIF upload request. + */ +class InvalidUploadSarifRequest extends Error { + constructor(message: string) { + super(message); + } +} diff --git a/src/upload-sarif-action.ts b/src/upload-sarif-action.ts index cde8dc3287..dc05494276 100644 --- a/src/upload-sarif-action.ts +++ b/src/upload-sarif-action.ts @@ -63,6 +63,7 @@ async function run() { actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, + { invalidRequestIsUserError: true }, ); core.setOutput("sarif-id", uploadResult.sarifID); From a7c12a522555ecd630965e7f80e9e3dc35dc0268 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Thu, 7 Sep 2023 20:44:15 +0100 Subject: [PATCH 2/2] Address PR comments --- lib/analyze-action.js | 2 +- lib/analyze-action.js.map | 2 +- lib/init-action-post-helper.js | 2 +- lib/init-action-post-helper.js.map | 2 +- lib/upload-lib.js | 34 +++++++++++++++------------- lib/upload-lib.js.map | 2 +- lib/upload-sarif-action.js | 2 +- lib/upload-sarif-action.js.map | 2 +- src/analyze-action.ts | 2 +- src/init-action-post-helper.ts | 2 +- src/upload-lib.ts | 36 +++++++++++++++++------------- src/upload-sarif-action.ts | 2 +- 12 files changed, 48 insertions(+), 42 deletions(-) diff --git a/lib/analyze-action.js b/lib/analyze-action.js index 0fe968f2f4..c63368a9b5 100644 --- a/lib/analyze-action.js +++ b/lib/analyze-action.js @@ -180,7 +180,7 @@ async function run() { core.setOutput("sarif-output", path_1.default.resolve(outputDir)); const uploadInput = actionsUtil.getOptionalInput("upload"); if (runStats && actionsUtil.getUploadValue(uploadInput) === "always") { - uploadResult = await uploadLib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { invalidRequestIsUserError: false }); + uploadResult = await uploadLib.uploadFromActions(outputDir, actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { considerInvalidRequestUserError: false }); core.setOutput("sarif-id", uploadResult.sarifID); } else { diff --git a/lib/analyze-action.js.map b/lib/analyze-action.js.map index 7fbbcb9f22..2e2eccd4a5 100644 --- a/lib/analyze-action.js.map +++ b/lib/analyze-action.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AAEtC,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAgF;AAChF,uDAAoD;AACpD,+CAAuC;AACvC,mDAA2C;AAC3C,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wDAA0C;AAE1C,6CAA+B;AAC/B,iCAAoD;AAkBpD,KAAK,UAAU,gBAAgB,CAC7B,SAAe,EACf,MAA0B,EAC1B,KAAuC,EACvC,KAAwB,EACxB,mBAAuC,EACvC,iBAAsD,EACtD,mBAA4B,EAC5B,MAAc;IAEd,MAAM,MAA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AC5B,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN;YACE,GAAG,QAAQ;YACX,GAAG,YAAY,CAAC,YAAY;SAC7B,EACD,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM,IAAI,QAAQ,EAAE;QACnB,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,EAAE,GAAG,QAAQ,EAAE,EACf,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM;QACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;AACH,CAAC;AAEY,QAAA,UAAU,GAAG,GAAG,EAAE,CAAC;AAEhC,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,kBAAU,CAAC;KAClB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACtE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze-action.js","sourceRoot":"","sources":["../src/analyze-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,gDAAwB;AACxB,2CAAyC;AAEzC,oDAAsC;AAEtC,4DAA8C;AAC9C,uCAOmB;AACnB,6CAA+D;AAC/D,2CAA2C;AAC3C,qCAAqC;AACrC,iDAAgF;AAChF,uDAAoD;AACpD,+CAAuC;AACvC,mDAA2C;AAC3C,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,8DAAgD;AAChD,mDAKyB;AACzB,iDAAqE;AACrE,wD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aAAM;YACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,KAAK,EACL,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;SACH;QAED,OAAO;KACR;IAED,IAAI,QAAQ,IAAI,YAAY,EAAE;QAC5B,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN;YACE,GAAG,QAAQ;YACX,GAAG,YAAY,CAAC,YAAY;SAC7B,EACD,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM,IAAI,QAAQ,EAAE;QACnB,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,EAAE,GAAG,QAAQ,EAAE,EACf,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;SAAM;QACL,MAAM,gBAAgB,CACpB,SAAS,EACT,MAAM,EACN,SAAS,EACT,SAAS,EACT,mBAAmB,EACnB,iBAAiB,EACjB,mBAAmB,EACnB,MAAM,CACP,CAAC;KACH;AACH,CAAC;AAEY,QAAA,UAAU,GAAG,GAAG,EAAE,CAAC;AAEhC,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,kBAAU,CAAC;KAClB;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,0BAA0B,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACtE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/init-action-post-helper.js b/lib/init-action-post-helper.js index 168c15202e..51af11d8fc 100644 --- a/lib/init-action-post-helper.js +++ b/lib/init-action-post-helper.js @@ -74,7 +74,7 @@ async function maybeUploadFailedSarif(config, repositoryNwo, features, logger) { await codeql.databaseExportDiagnostics(databasePath, sarifFile, category, config.tempDir, logger); } core.info(`Uploading failed SARIF file ${sarifFile}`); - const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger, { invalidRequestIsUserError: false }); + const uploadResult = await uploadLib.uploadFromActions(sarifFile, checkoutPath, category, logger, { considerInvalidRequestUserError: false }); await uploadLib.waitForProcessing(repositoryNwo, uploadResult.sarifID, logger, { isUnsuccessfulExecution: true }); return uploadResult?.statusReport ?? {}; } diff --git a/lib/init-action-post-helper.js.map b/lib/init-action-post-helper.js.map index 9232e898d9..b23bd736d5 100644 --- a/lib/init-action-post-helper.js.map +++ b/lib/init-action-post-helper.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AACvC,mDAA6D;AAG7D,wDAA0C;AAC1C,iCAKgB;AAChB,yCAKoB;AAWpB,SAAS,mCAAmC,CAC1C,KAAc;IAEd,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;IACtC,OAAO;QACL,uBAAuB,EAAE,YAAY,CAAC,OAAO;QAC7C,6BAA6B,EAAE,YAAY,CAAC,KAAK;KAClD,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,KAAK,UAAU,sBAAsB,CACnC,MAAc,EACd,aAA4B,EAC5B,QAA2B,EAC3B,MAAc;IAEd,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE;QACrB,OAAO,EAAE,iCAAiC,EAAE,0BAA0B,EAAE,CAAC;KAC1E;IACD,MAAM,MAAM,GAAG,MAAM,IAAA,kBAAS,EAAC,MAAM,CAAC,SAAS,CAAC,CAAC;IACjD,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,QAAQ,CAAC,uBAAO,CAAC,wBAAwB,EAAE,MAAM,CAAC,CAAC,EAAE;QAC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,aAAa,EACb,QAAQ,EACR,MAAM,CACP,CAAC;IAEF,IAAI,uBAAuB,CAAC,iCAAiC,EAAE;QAC7D,MAAM,CAAC,KAAK,CACV,8EAA8E;YAC5E,GAAG,uBAAuB,CAAC,iCAAiC,GAAG,CAClE,CAAC;KACH;IACD,8FAA8F;IAC9F,iCAAiC;IACjC,IACE,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,KAAK,MAAM;QAClE,CAAC,uBAAuB,CAAC,qBAAqB,EAC9C;QACA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,4EAA4E;YAC1E,8BAA8B,KAAK,GAAG,CACzC,CAAC;KACH;IAED,qDAAqD;IACrD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,IAAI,CAAC,IAAI,CACP,mGAAmG,CACpG,CAAC;QACF,MAAM,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAtDD,kBAsDC"} \ No newline at end of file +{"version":3,"file":"init-action-post-helper.js","sourceRoot":"","sources":["../src/init-action-post-helper.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,qCAAqC;AACrC,iDAAmD;AACnD,+CAAuC;AACvC,mDAA6D;AAG7D,wDAA0C;AAC1C,iCAKgB;AAChB,yCAKoB;AAWpB,SAAS,mCAAmC,CAC1C,KAAc;IAEd,MAAM,YAAY,GAAG,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC;IACtC,OAAO;QACL,uBAAuB,EAAE,YAAY,CAAC,OAAO;QAC7C,6BAA6B,EAAE,YAAY,CAAC,KAAK;KAClD,CAAC;AACJ,CAAC;AAED;;;G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A0BC;AAEM,KAAK,UAAU,GAAG,CACvB,iCAA2C,EAC3C,uBAAiC,EACjC,cAAwB,EACxB,aAA4B,EAC5B,QAA2B,EAC3B,MAAc;IAEd,MAAM,MAAM,GAAG,MAAM,IAAA,wBAAS,EAAC,WAAW,CAAC,qBAAqB,EAAE,EAAE,MAAM,CAAC,CAAC;IAC5E,IAAI,MAAM,KAAK,SAAS,EAAE;QACxB,MAAM,CAAC,OAAO,CACZ,iGAAiG,CAClG,CAAC;QACF,OAAO;KACR;IAED,MAAM,uBAAuB,GAAG,MAAM,yBAAyB,CAC7D,MAAM,EACN,aAAa,EACb,QAAQ,EACR,MAAM,CACP,CAAC;IAEF,IAAI,uBAAuB,CAAC,iCAAiC,EAAE;QAC7D,MAAM,CAAC,KAAK,CACV,8EAA8E;YAC5E,GAAG,uBAAuB,CAAC,iCAAiC,GAAG,CAClE,CAAC;KACH;IACD,8FAA8F;IAC9F,iCAAiC;IACjC,IACE,OAAO,CAAC,GAAG,CAAC,0CAA0C,CAAC,KAAK,MAAM;QAClE,CAAC,uBAAuB,CAAC,qBAAqB,EAC9C;QACA,MAAM,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,uBAAuB,CAAC,CAAC;QACtD,MAAM,IAAI,KAAK,CACb,4EAA4E;YAC1E,8BAA8B,KAAK,GAAG,CACzC,CAAC;KACH;IAED,qDAAqD;IACrD,IAAI,MAAM,CAAC,SAAS,EAAE;QACpB,IAAI,CAAC,IAAI,CACP,mGAAmG,CACpG,CAAC;QACF,MAAM,iCAAiC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QACxD,MAAM,uBAAuB,CAAC,MAAM,CAAC,CAAC;QAEtC,MAAM,cAAc,CAAC,MAAM,CAAC,CAAC;KAC9B;IAED,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAtDD,kBAsDC"} \ No newline at end of file diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 04b63b0087..a0c6185367 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -55,7 +55,7 @@ function combineSarifFiles(sarifFiles) { combinedSarif.version = sarifObject.version; } else if (combinedSarif.version !== sarifObject.version) { - throw new InvalidUploadSarifRequest(`Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`); + throw new InvalidRequestError(`Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`); } combinedSarif.runs.push(...sarifObject.runs); } @@ -130,17 +130,19 @@ function findSarifFilesInDir(sarifPath) { } exports.findSarifFilesInDir = findSarifFilesInDir; /** - * Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers to. + * Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers + * to. * - * @param invalidRequestIsUserError Whether an invalid request, for example one with a `sarifPath` - * that does not exist, should be considered a user error. + * @param considerInvalidRequestUserError Whether an invalid request, for example one with a + * `sarifPath` that does not exist, should be considered a + * user error. */ -async function uploadFromActions(sarifPath, checkoutPath, category, logger, { invalidRequestIsUserError }) { +async function uploadFromActions(sarifPath, checkoutPath, category, logger, { considerInvalidRequestUserError, }) { try { return await uploadFiles(getSarifFilePaths(sarifPath), (0, repository_1.parseRepositoryNwo)(util.getRequiredEnvParam("GITHUB_REPOSITORY")), await actionsUtil.getCommitOid(checkoutPath), await actionsUtil.getRef(), await api.getAnalysisKey(), category, util.getRequiredEnvParam("GITHUB_WORKFLOW"), actionsUtil.getWorkflowRunID(), actionsUtil.getWorkflowRunAttempt(), checkoutPath, actionsUtil.getRequiredInput("matrix"), logger); } catch (e) { - if (e instanceof InvalidUploadSarifRequest && invalidRequestIsUserError) { + if (e instanceof InvalidRequestError && considerInvalidRequestUserError) { throw new util_1.UserError(e.message); } throw e; @@ -149,13 +151,13 @@ async function uploadFromActions(sarifPath, checkoutPath, category, logger, { in exports.uploadFromActions = uploadFromActions; function getSarifFilePaths(sarifPath) { if (!fs.existsSync(sarifPath)) { - throw new InvalidUploadSarifRequest(`Path does not exist: ${sarifPath}`); + throw new InvalidRequestError(`Path does not exist: ${sarifPath}`); } let sarifFiles; if (fs.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath); if (sarifFiles.length === 0) { - throw new InvalidUploadSarifRequest(`No SARIF files found to upload in "${sarifPath}".`); + throw new InvalidRequestError(`No SARIF files found to upload in "${sarifPath}".`); } } else { @@ -171,14 +173,14 @@ function countResultsInSarif(sarif) { parsedSarif = JSON.parse(sarif); } catch (e) { - throw new InvalidUploadSarifRequest(`Invalid SARIF. JSON syntax error: ${(0, util_1.wrapError)(e).message}`); + throw new InvalidRequestError(`Invalid SARIF. JSON syntax error: ${(0, util_1.wrapError)(e).message}`); } if (!Array.isArray(parsedSarif.runs)) { - throw new InvalidUploadSarifRequest("Invalid SARIF. Missing 'runs' array."); + throw new InvalidRequestError("Invalid SARIF. Missing 'runs' array."); } for (const run of parsedSarif.runs) { if (!Array.isArray(run.results)) { - throw new InvalidUploadSarifRequest("Invalid SARIF. Missing 'results' array in run."); + throw new InvalidRequestError("Invalid SARIF. Missing 'results' array in run."); } numResults += run.results.length; } @@ -207,7 +209,7 @@ function validateSarifFileSchema(sarifFilePath, logger) { // Set the main error message to the stacks of all the errors. // This should be of a manageable size and may even give enough to fix the error. const sarifErrors = errors.map((e) => `- ${e.stack}`); - throw new InvalidUploadSarifRequest(`Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join("\n")}`); + throw new InvalidRequestError(`Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join("\n")}`); } } exports.validateSarifFileSchema = validateSarifFileSchema; @@ -346,7 +348,7 @@ async function waitForProcessing(repositoryNwo, sarifID, logger, options = { const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`; throw shouldConsiderAsUserError(response.data.errors) ? new util_1.UserError(message) - : new InvalidUploadSarifRequest(message); + : new InvalidRequestError(message); } else { util.assertNever(status); @@ -409,7 +411,7 @@ function validateUniqueCategory(sarif) { for (const [category, { id, tool }] of Object.entries(categories)) { const sentinelEnvVar = `CODEQL_UPLOAD_SARIF_${category}`; if (process.env[sentinelEnvVar]) { - throw new InvalidUploadSarifRequest("Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " + + throw new InvalidRequestError("Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " + "The easiest fix is to specify a unique value for the `category` input. If .runs[].automationDetails.id is specified " + "in the sarif file, that will take precedence over your configured `category`. " + `Category: (${id ? id : "none"}) Tool: (${tool ? tool : "none"})`); @@ -419,7 +421,7 @@ function validateUniqueCategory(sarif) { } exports.validateUniqueCategory = validateUniqueCategory; /** - * Santizes a string to be used as an environment variable name. + * Sanitizes a string to be used as an environment variable name. * This will replace all non-alphanumeric characters with underscores. * There could still be some false category clashes if two uploads * occur that differ only in their non-alphanumeric characters. This is @@ -464,7 +466,7 @@ exports.pruneInvalidResults = pruneInvalidResults; /** * An error that occurred due to an invalid SARIF upload request. */ -class InvalidUploadSarifRequest extends Error { +class InvalidRequestError extends Error { constructor(message) { super(message); } diff --git a/lib/upload-lib.js.map b/lib/upload-lib.js.map index 1bc5524011..4f6d118cfe 100644 --- a/lib/upload-lib.js.map +++ b/lib/upload-lib.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,qCAA8B;AAC9B,gDAAwB;AAExB,oDAAsC;AAEtC,wDAA+B;AAC/B,uDAAyC;AAEzC,4DAA8C;AAC9C,kDAAoC;AACpC,+CAAuC;AACvC,6DAA+C;AAE/C,6CAAiE;AACjE,6CAA+B;AAC/B,iCAAgF;AAEhF,mEAAmE;AACnE,qDAAqD;AACrD,SAAS,iBAAiB,CAAC,UAAoB;IAC7C,MAAM,aAAa,GAAc;QAC/B,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,K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EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC,EAC3C;oBACA,MAAM,IAAI,CAAC,CAAC;oBACZ,SAAS;iBACV;gBACD,UAAU,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,CAAC,IAAI,CACT,UAAU,MAAM,kDAAkD,CACnE,CAAC;KACH;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AArCD,kDAqCC;AAED;;GAEG;AACH,MAAM,yBAA0B,SAAQ,KAAK;IAC3C,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF"} \ No newline at end of file +{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,qCAA8B;AAC9B,gDAAwB;AAExB,oDAAsC;AAEtC,wDAA+B;AAC/B,uDAAyC;AAEzC,4DAA8C;AAC9C,kDAAoC;AACpC,+CAAuC;AACvC,6DAA+C;AAE/C,6CAAiE;AACjE,6CAA+B;AAC/B,iCAAgF;AAEhF,mEAAmE;AACnE,qDAAqD;AACrD,SAAS,iBAAiB,CAAC,UAAoB;IAC7C,MAAM,aAAa,GAAc;QAC/B,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,KAAK,MAAM,SAAS,IAAI,UAAU,EAAE;QAClC,MAAM,WAAW,GAAG,IAAI,CAAC,KAAK,CAC5B,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAC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CAAC,CAAC;aACzB;YACD,OAAO,CAAC,IAAI,CAAC,EAAE,GAAG,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC,CAAC;SAC/C;aAAM;YACL,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;SACnB;KACF;IACD,IAAI,MAAM,GAAG,CAAC,EAAE;QACd,MAAM,CAAC,IAAI,CACT,UAAU,MAAM,kDAAkD,CACnE,CAAC;KACH;IACD,OAAO,EAAE,GAAG,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;AACrC,CAAC;AArCD,kDAqCC;AAED;;GAEG;AACH,MAAM,mBAAoB,SAAQ,KAAK;IACrC,YAAY,OAAe;QACzB,KAAK,CAAC,OAAO,CAAC,CAAC;IACjB,CAAC;CACF"} \ No newline at end of file diff --git a/lib/upload-sarif-action.js b/lib/upload-sarif-action.js index 36b8b5d66b..2c54c71e5c 100644 --- a/lib/upload-sarif-action.js +++ b/lib/upload-sarif-action.js @@ -47,7 +47,7 @@ async function run() { return; } try { - const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { invalidRequestIsUserError: true }); + const uploadResult = await upload_lib.uploadFromActions(actionsUtil.getRequiredInput("sarif_file"), actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, { considerInvalidRequestUserError: true }); core.setOutput("sarif-id", uploadResult.sarifID); // We don't upload results in test mode, so don't wait for processing if ((0, util_1.isInTestMode)()) { diff --git a/lib/upload-sarif-action.js.map b/lib/upload-sarif-action.js.map index d31bd8e9d4..414e2b91a3 100644 --- a/lib/upload-sarif-action.js.map +++ b/lib/upload-sarif-action.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C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C,qBAAqB,CAAC,KAAK,MAAM,EAAE;YACzE,MAAM,UAAU,CAAC,iBAAiB,CAChC,IAAA,+BAAkB,EAAC,IAAA,0BAAmB,EAAC,mBAAmB,CAAC,CAAC,EAC5D,YAAY,CAAC,OAAO,EACpB,MAAM,CACP,CAAC;SACH;QACD,MAAM,uBAAuB,CAAC,SAAS,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACrE;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,cAAc,EACd,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;KACR;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CACZ,sCAAsC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACjE,CAAC;KACH;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"upload-sarif-action.js","sourceRoot":"","sources":["../src/upload-sarif-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAAsC;AAEtC,4DAA8C;AAC9C,iDAAkD;AAClD,uCAA6C;AAC7C,6CAAkD;AAClD,mDAKyB;AACzB,yDAA2C;AAC3C,iCAMgB;AAMhB,KAAK,UAAU,uBAAuB,CACpC,SAAe,EACf,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EAC5D,YAAY,CAAC,OAAO,EACpB,MAAM,CACP,CAAC;SACH;QACD,MAAM,uBAAuB,CAAC,SAAS,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;KACrE;IAAC,OAAO,cAAc,EAAE;QACvB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,CAAC;QAC9B,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC;QACxB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC;QACnB,MAAM,IAAA,gCAAgB,EACpB,MAAM,IAAA,sCAAsB,EAC1B,cAAc,EACd,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,GAAE,EACtB,OAAO,EACP,KAAK,CAAC,KAAK,CACZ,CACF,CAAC;QACF,OAAO;KACR;AACH,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CACZ,sCAAsC,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CACjE,CAAC;KACH;AACH,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/src/analyze-action.ts b/src/analyze-action.ts index bca2f0c17f..c0276d734e 100644 --- a/src/analyze-action.ts +++ b/src/analyze-action.ts @@ -280,7 +280,7 @@ async function run() { actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, - { invalidRequestIsUserError: false }, + { considerInvalidRequestUserError: false }, ); core.setOutput("sarif-id", uploadResult.sarifID); } else { diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index b569cb432c..225e8843ba 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -98,7 +98,7 @@ async function maybeUploadFailedSarif( checkoutPath, category, logger, - { invalidRequestIsUserError: false }, + { considerInvalidRequestUserError: false }, ); await uploadLib.waitForProcessing( repositoryNwo, diff --git a/src/upload-lib.ts b/src/upload-lib.ts index e3f43257d0..8228570166 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -33,7 +33,7 @@ function combineSarifFiles(sarifFiles: string[]): SarifFile { if (combinedSarif.version === null) { combinedSarif.version = sarifObject.version; } else if (combinedSarif.version !== sarifObject.version) { - throw new InvalidUploadSarifRequest( + throw new InvalidRequestError( `Different SARIF versions encountered: ${combinedSarif.version} and ${sarifObject.version}`, ); } @@ -156,17 +156,21 @@ export function findSarifFilesInDir(sarifPath: string): string[] { } /** - * Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers to. + * Uploads a single SARIF file or a directory of SARIF files depending on what `sarifPath` refers + * to. * - * @param invalidRequestIsUserError Whether an invalid request, for example one with a `sarifPath` - * that does not exist, should be considered a user error. + * @param considerInvalidRequestUserError Whether an invalid request, for example one with a + * `sarifPath` that does not exist, should be considered a + * user error. */ export async function uploadFromActions( sarifPath: string, checkoutPath: string, category: string | undefined, logger: Logger, - { invalidRequestIsUserError }: { invalidRequestIsUserError: boolean }, + { + considerInvalidRequestUserError, + }: { considerInvalidRequestUserError: boolean }, ): Promise { try { return await uploadFiles( @@ -184,7 +188,7 @@ export async function uploadFromActions( logger, ); } catch (e) { - if (e instanceof InvalidUploadSarifRequest && invalidRequestIsUserError) { + if (e instanceof InvalidRequestError && considerInvalidRequestUserError) { throw new UserError(e.message); } throw e; @@ -193,14 +197,14 @@ export async function uploadFromActions( function getSarifFilePaths(sarifPath: string) { if (!fs.existsSync(sarifPath)) { - throw new InvalidUploadSarifRequest(`Path does not exist: ${sarifPath}`); + throw new InvalidRequestError(`Path does not exist: ${sarifPath}`); } let sarifFiles: string[]; if (fs.lstatSync(sarifPath).isDirectory()) { sarifFiles = findSarifFilesInDir(sarifPath); if (sarifFiles.length === 0) { - throw new InvalidUploadSarifRequest( + throw new InvalidRequestError( `No SARIF files found to upload in "${sarifPath}".`, ); } @@ -217,17 +221,17 @@ function countResultsInSarif(sarif: string): number { try { parsedSarif = JSON.parse(sarif); } catch (e) { - throw new InvalidUploadSarifRequest( + throw new InvalidRequestError( `Invalid SARIF. JSON syntax error: ${wrapError(e).message}`, ); } if (!Array.isArray(parsedSarif.runs)) { - throw new InvalidUploadSarifRequest("Invalid SARIF. Missing 'runs' array."); + throw new InvalidRequestError("Invalid SARIF. Missing 'runs' array."); } for (const run of parsedSarif.runs) { if (!Array.isArray(run.results)) { - throw new InvalidUploadSarifRequest( + throw new InvalidRequestError( "Invalid SARIF. Missing 'results' array in run.", ); } @@ -269,7 +273,7 @@ export function validateSarifFileSchema(sarifFilePath: string, logger: Logger) { // Set the main error message to the stacks of all the errors. // This should be of a manageable size and may even give enough to fix the error. const sarifErrors = errors.map((e) => `- ${e.stack}`); - throw new InvalidUploadSarifRequest( + throw new InvalidRequestError( `Unable to upload "${sarifFilePath}" as it is not valid SARIF:\n${sarifErrors.join( "\n", )}`, @@ -491,7 +495,7 @@ export async function waitForProcessing( const message = `Code Scanning could not process the submitted SARIF file:\n${response.data.errors}`; throw shouldConsiderAsUserError(response.data.errors as string[]) ? new UserError(message) - : new InvalidUploadSarifRequest(message); + : new InvalidRequestError(message); } else { util.assertNever(status); } @@ -568,7 +572,7 @@ export function validateUniqueCategory(sarif: SarifFile): void { for (const [category, { id, tool }] of Object.entries(categories)) { const sentinelEnvVar = `CODEQL_UPLOAD_SARIF_${category}`; if (process.env[sentinelEnvVar]) { - throw new InvalidUploadSarifRequest( + throw new InvalidRequestError( "Aborting upload: only one run of the codeql/analyze or codeql/upload-sarif actions is allowed per job per tool/category. " + "The easiest fix is to specify a unique value for the `category` input. If .runs[].automationDetails.id is specified " + "in the sarif file, that will take precedence over your configured `category`. " + @@ -580,7 +584,7 @@ export function validateUniqueCategory(sarif: SarifFile): void { } /** - * Santizes a string to be used as an environment variable name. + * Sanitizes a string to be used as an environment variable name. * This will replace all non-alphanumeric characters with underscores. * There could still be some false category clashes if two uploads * occur that differ only in their non-alphanumeric characters. This is @@ -634,7 +638,7 @@ export function pruneInvalidResults( /** * An error that occurred due to an invalid SARIF upload request. */ -class InvalidUploadSarifRequest extends Error { +class InvalidRequestError extends Error { constructor(message: string) { super(message); } diff --git a/src/upload-sarif-action.ts b/src/upload-sarif-action.ts index dc05494276..a7550623d5 100644 --- a/src/upload-sarif-action.ts +++ b/src/upload-sarif-action.ts @@ -63,7 +63,7 @@ async function run() { actionsUtil.getRequiredInput("checkout_path"), actionsUtil.getOptionalInput("category"), logger, - { invalidRequestIsUserError: true }, + { considerInvalidRequestUserError: true }, ); core.setOutput("sarif-id", uploadResult.sarifID);