From d0c18ba23ebe5c9ec61bc58f89bf2591a0b04872 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 22 Sep 2023 14:54:03 +0100 Subject: [PATCH 1/4] Warn when workflow analyzes the same language twice --- lib/init-action.js | 4 +- lib/init-action.js.map | 2 +- lib/workflow.js | 38 +++- lib/workflow.js.map | 2 +- lib/workflow.test.js | 231 +++++++++++++--------- lib/workflow.test.js.map | 2 +- src/init-action.ts | 5 +- src/workflow.test.ts | 404 ++++++++++++++++++++++++++++----------- src/workflow.ts | 49 ++++- 9 files changed, 516 insertions(+), 221 deletions(-) diff --git a/lib/init-action.js b/lib/init-action.js index fd33a87d27..7a468bf7d7 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -121,8 +121,7 @@ async function run() { const features = new feature_flags_1.Features(gitHubVersion, repositoryNwo, (0, actions_util_1.getTemporaryDirectory)(), logger); core.exportVariable(environment_1.EnvVar.JOB_RUN_UUID, (0, uuid_1.v4)()); try { - const workflowErrors = await (0, workflow_1.validateWorkflow)(logger); - if (!(await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("init", "starting", startedAt, await (0, util_1.checkDiskUsage)(logger), workflowErrors)))) { + if (!(await (0, status_report_1.sendStatusReport)(await (0, status_report_1.createStatusReportBase)("init", "starting", startedAt, await (0, util_1.checkDiskUsage)(logger))))) { return; } const codeQLDefaultVersionInfo = await features.getDefaultCliVersion(gitHubVersion.type); @@ -132,6 +131,7 @@ async function run() { toolsDownloadDurationMs = initCodeQLResult.toolsDownloadDurationMs; toolsVersion = initCodeQLResult.toolsVersion; toolsSource = initCodeQLResult.toolsSource; + await (0, workflow_1.validateWorkflow)(codeql, logger); config = await (0, init_1.initConfig)((0, actions_util_1.getOptionalInput)("languages"), (0, actions_util_1.getOptionalInput)("queries"), (0, actions_util_1.getOptionalInput)("packs"), registriesInput, (0, actions_util_1.getOptionalInput)("config-file"), (0, actions_util_1.getOptionalInput)("db-location"), (0, actions_util_1.getOptionalInput)("config"), getTrapCachingEnabled(), // Debug mode is enabled if: // - The `init` Action is passed `debug: true`. diff --git a/lib/init-action.js.map b/lib/init-action.js.map index 3a15c38dab..00052e3163 100644 --- a/lib/init-action.js.map +++ b/lib/init-action.js.map @@ -1 +1 @@ -{"version":3,"file":"init-action.js","sourceRoot":"","sources":["../src/init-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,oDAAsC;AACtC,+BAAoC;AAEpC,iDAKwB;AACxB,6CAAgD;AAGhD,iDAA6D;AAC7D,+CAAuC;AACvC,mDAAoD;AACpD,iCAA4E;AAC5E,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,iDAA6C;AAC7C,mDAKyB;AACzB,iDAAmD;AACnD,iCAcgB;AAChB,yCAA8C;AAgD9C,KAAK,UAAU,yBAAyB,CACtC,SAAe,EACf,MAAsC,EACtC,uBAA2C,EAC3C,sBAA2C,EAC3C,WAAwB,EACxB,YAAoB,EACpB,MAAc,EACd,KAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,MAAM,EACN,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAA,+BAAgB,EAAC,WAAW,CAAC,CAAC;IAExD,MAAM,gBAAgB,GAAqB;QACzC,GAAG,gBAAgB;QACnB,WAAW,EAAE,IAAA,+BAAgB,EAAC,OAAO,CAAC,IAAI,EAAE;QAC5C,sBAAsB,EAAE,YAAY;QACpC,YAAY,EAAE,WAAW,IAAI,0BAAW,CAAC,OAAO;QAChD,kBAAkB,EAAE,iBAAiB,IAAI,EAAE;KAC5C,CAAC;IAEF,MAAM,uBAAuB,GAA4B,EAAE,CAAC;IAE5D,IAAI,uBAAuB,KAAK,SAAS,E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AAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACnE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file +{"version":3,"file":"init-action.js","sourceRoot":"","sources":["../src/init-action.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6B;AAE7B,oDAAsC;AACtC,+BAAoC;AAEpC,iDAKwB;AACxB,6CAAgD;AAGhD,iDAA6D;AAC7D,+CAAuC;AACvC,mDAAoD;AACpD,iCAA4E;AAC5E,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,iDAA6C;AAC7C,mDAKyB;AACzB,iDAAmD;AACnD,iCAcgB;AAChB,yCAA8C;AAgD9C,KAAK,UAAU,yBAAyB,CACtC,SAAe,EACf,MAAsC,EACtC,uBAA2C,EAC3C,sBAA2C,EAC3C,WAAwB,EACxB,YAAoB,EACpB,MAAc,EACd,KAAa;IAEb,MAAM,gBAAgB,GAAG,MAAM,IAAA,sCAAsB,EACnD,MAAM,EACN,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IAEF,MAAM,iBAAiB,GAAG,IAAA,+BAAgB,EAAC,WAAW,CAAC,CAAC;IAExD,MAAM,gBAAgB,GAAqB;QACzC,GAAG,gBAAgB;QACnB,WAAW,EAAE,IAAA,+BAAgB,EAAC,OAAO,CAAC,IAAI,EAAE;QAC5C,sBAAsB,EAAE,YAAY;QACpC,YAAY,EAAE,WAAW,IAAI,0B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AW,KAAK,MAAM,CAAC;IAE7D,6FAA6F;IAC7F,IAAI,CAAC,IAAA,qBAAc,GAAE;QAAE,OAAO,KAAK,CAAC;IAEpC,oDAAoD;IACpD,OAAO,IAAI,CAAC;AACd,CAAC;AAED,KAAK,UAAU,UAAU;IACvB,IAAI;QACF,MAAM,GAAG,EAAE,CAAC;KACb;IAAC,OAAO,KAAK,EAAE;QACd,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;KACnE;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/workflow.js b/lib/workflow.js index 9b7394f06a..bb49d7ce6d 100644 --- a/lib/workflow.js +++ b/lib/workflow.js @@ -78,11 +78,43 @@ exports.WorkflowErrors = toCodedErrors({ MissingPushHook: `Please specify an on.push hook to analyze and see code scanning alerts from the default branch on the Security tab.`, CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`, }); -function getWorkflowErrors(doc) { +async function getWorkflowErrors(doc, codeql) { const errors = []; const jobName = process.env.GITHUB_JOB; if (jobName) { const job = doc?.jobs?.[jobName]; + if (job?.strategy?.matrix?.language) { + const matrixLanguages = job.strategy.matrix.language; + if (Array.isArray(matrixLanguages)) { + const resolveResult = await codeql.betterResolveLanguages(); + if (resolveResult.aliases) { + const aliases = resolveResult.aliases; + // Map extractors to entries in the `language` matrix parameter. This will allow us to + // detect languages which are analyzed in more than one job. + const matrixLanguagesByExtractor = {}; + for (const language of matrixLanguages) { + const extractorName = aliases[language] || language; + if (!matrixLanguagesByExtractor[extractorName]) { + matrixLanguagesByExtractor[extractorName] = []; + } + matrixLanguagesByExtractor[extractorName].push(language); + } + // Check for duplicate languages in the matrix + for (const [extractor, languages] of Object.entries(matrixLanguagesByExtractor)) { + if (languages.length > 1) { + errors.push({ + message: `CodeQL language '${extractor}' is referenced by more than one entry in the ` + + `'language' matrix parameter for job '${jobName}'. This may result in duplicate alerts. ` + + `Please edit the 'language' matrix parameter to keep only one of the following: ${languages + .map((language) => `'${language}'`) + .join(", ")}.`, + code: "DuplicateLanguageInMatrix", + }); + } + } + } + } + } const steps = job?.steps; if (Array.isArray(steps)) { for (const step of steps) { @@ -127,7 +159,7 @@ function getWorkflowErrors(doc) { return errors; } exports.getWorkflowErrors = getWorkflowErrors; -async function validateWorkflow(logger) { +async function validateWorkflow(codeql, logger) { let workflow; try { workflow = await getWorkflow(logger); @@ -137,7 +169,7 @@ async function validateWorkflow(logger) { } let workflowErrors; try { - workflowErrors = getWorkflowErrors(workflow); + workflowErrors = await getWorkflowErrors(workflow, codeql); } catch (e) { return `error: getWorkflowErrors() failed: ${String(e)}`; diff --git a/lib/workflow.js.map b/lib/workflow.js.map index 38da30e33c..439c8dacea 100644 --- a/lib/workflow.js.map +++ b/lib/workflow.js.map @@ -1 +1 @@ -{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,gDAAwB;AAExB,oDAAsC;AACtC,8CAAgC;AAEhC,kDAAoC;AACpC,+CAAuC;AAEvC,iCAA2D;AAqC3D,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC;AAC7C,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7C,SAAS,YAAY,CAAC,MAAM;IAC1B,OAAO,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC,oCAAoC;AAC5F,CAAC;AAED,SAAS,eAAe,CAAC,KAAK;IAC5B,OAAO,IAAI,MAAM,CACf,IAAI,KAAK;SACN,QAAQ,EAAE;S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G;AACH,SAAgB,uBAAuB,CACrC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,UAAU,EACV,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,0DAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,QAAQ,EACR,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,sDAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,2BAA2B,CACzC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,CACL,eAAe,CACb,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,eAAe,EACf,UAAU,CACX,IAAI,IAAA,0BAAmB,EAAC,kBAAkB,CAAC,CAAC,oEAAoE;KAClH,CAAC;AACJ,CAAC;AAdD,kEAcC"} \ No newline at end of file +{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAC7B,gDAAwB;AAExB,oDAAsC;AACtC,8CAAgC;AAEhC,kDAAoC;AAEpC,+CAAuC;AAEvC,iCAA2D;AAsC3D,SAAS,QAAQ,CAAC,CAAU;IAC1B,OAAO,CAAC,KAAK,IAAI,IAAI,OAAO,CAAC,KAAK,QAAQ,CAAC;AAC7C,CAAC;AAED,MAAM,YAAY,GAAG,IAAI,MAAM,CAAC,WAAW,CAAC,CAAC;AAE7C,SAAS,YAAY,CAAC,MAAM;IAC1B,OAAO,MAAM,CAAC,OAAO,CAAC,qBAAqB,EAAE,MAAM,CAAC,CAAC,CAAC,oCAAoC;AAC5F,CAAC;AAED,SAAS,eAAe,CAAC,KAAK;IAC5B,OAAO,IAAI,MAAM,C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B,CAAC;KACvC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB,CACrC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,UAAU,EACV,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,0DAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,QAAQ,EACR,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,sDAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,2BAA2B,CACzC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,CACL,eAAe,CACb,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,eAAe,EACf,UAAU,CACX,IAAI,IAAA,0BAAmB,EAAC,kBAAkB,CAAC,CAAC,oEAAoE;KAClH,CAAC;AACJ,CAAC;AAdD,kEAcC"} \ No newline at end of file diff --git a/lib/workflow.test.js b/lib/workflow.test.js index 71b8537d50..05c1f6503f 100644 --- a/lib/workflow.test.js +++ b/lib/workflow.test.js @@ -28,119 +28,114 @@ var __importDefault = (this && this.__importDefault) || function (mod) { Object.defineProperty(exports, "__esModule", { value: true }); const ava_1 = __importDefault(require("ava")); const yaml = __importStar(require("js-yaml")); +const sinon = __importStar(require("sinon")); +const codeql_1 = require("./codeql"); const testing_utils_1 = require("./testing-utils"); const workflow_1 = require("./workflow"); function errorCodes(actual, expected) { return [actual.map(({ code }) => code), expected.map(({ code }) => code)]; } (0, testing_utils_1.setupTests)(ava_1.default); -(0, ava_1.default)("getWorkflowErrors() when on is empty", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ on: {} }); +(0, ava_1.default)("getWorkflowErrors() when on is empty", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: {} }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push is an array missing pull_request", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ on: ["push"] }); +(0, ava_1.default)("getWorkflowErrors() when on.push is an array missing pull_request", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: ["push"] }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push is an array missing push", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ on: ["pull_request"] }); +(0, ava_1.default)("getWorkflowErrors() when on.push is an array missing push", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: ["pull_request"] }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [workflow_1.WorkflowErrors.MissingPushHook])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push is valid", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ +(0, ava_1.default)("getWorkflowErrors() when on.push is valid", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: ["push", "pull_request"], - }); + }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push is a valid superset", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ +(0, ava_1.default)("getWorkflowErrors() when on.push is a valid superset", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: ["push", "pull_request", "schedule"], - }); + }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push is a correct object", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ - on: { push: { branches: ["main"] }, pull_request: { branches: ["main"] } }, - }); +(0, ava_1.default)("getWorkflowErrors() when on.push is a correct object", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ + on: { + push: { branches: ["main"] }, + pull_request: { branches: ["main"] }, + }, + }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.pull_requests is a string and correct", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ +(0, ava_1.default)("getWorkflowErrors() when on.pull_requests is a string and correct", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: { push: { branches: "*" }, pull_request: { branches: "*" } }, - }); + }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push is correct with empty objects", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)(yaml.load(` +(0, ava_1.default)("getWorkflowErrors() when on.push is correct with empty objects", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` on: push: pull_request: - `)); + `), await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push is not mismatched", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ +(0, ava_1.default)("getWorkflowErrors() when on.push is not mismatched", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: { push: { branches: ["main", "feature"] }, pull_request: { branches: ["main"] }, }, - }); + }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() for a range of malformed workflows", (t) => { - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)({ +(0, ava_1.default)("getWorkflowErrors() for a range of malformed workflows", async (t) => { + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: { push: 1, pull_request: 1, }, - }), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, - }), [])); - t.deepEqual(...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - (0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: 1, - }), [])); - t.deepEqual(...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - (0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: [1], - }), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: { 1: 1 }, - }), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: { test: 1 }, - }), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: { test: [1] }, - }), [])); - t.deepEqual(...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - (0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: { test: { steps: 1 } }, - }), [])); - t.deepEqual(...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - (0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: { test: { steps: [{ notrun: "git checkout HEAD^2" }] } }, - }), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: 1, jobs: { test: [undefined] }, - }), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)(1), [])); - t.deepEqual(...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - (0, workflow_1.getWorkflowErrors)({ + }, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)(1, await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)({ on: { push: { branches: 1, @@ -149,25 +144,77 @@ function errorCodes(actual, expected) { branches: 1, }, }, - }), [])); + }, await (0, codeql_1.getCodeQLForTesting)()), [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.pull_request for wildcard branches", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)({ +(0, ava_1.default)("getWorkflowErrors() when on.pull_request for wildcard branches", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)({ on: { push: { branches: ["feature/*"] }, pull_request: { branches: "feature/moose" }, }, - }); + }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when HEAD^2 is checked out", (t) => { +(0, ava_1.default)("getWorkflowErrors() when HEAD^2 is checked out", async (t) => { process.env.GITHUB_JOB = "test"; - const errors = (0, workflow_1.getWorkflowErrors)({ + const errors = await (0, workflow_1.getWorkflowErrors)({ on: ["push", "pull_request"], jobs: { test: { steps: [{ run: "git checkout HEAD^2" }] } }, - }); + }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [workflow_1.WorkflowErrors.CheckoutWrongHead])); }); +(0, ava_1.default)("getWorkflowErrors() for workflow with language name and its alias", async (t) => { + await testLanguageAliases(t, ["java", "kotlin"], "java", ["java-kotlin", "kotlin"], [ + "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + + "matrix parameter to keep only one of the following: 'java', 'kotlin'.", + ]); +}); +(0, ava_1.default)("getWorkflowErrors() for workflow with two aliases same language", async (t) => { + await testLanguageAliases(t, ["java-kotlin", "kotlin"], "java", ["java-kotlin", "kotlin"], [ + "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + + "matrix parameter to keep only one of the following: 'java-kotlin', 'kotlin'.", + ]); +}); +(0, ava_1.default)("getWorkflowErrors() does not produce error if codeql doesn't support language aliases", async (t) => { + await testLanguageAliases(t, ["java-kotlin", "kotlin"], "java", undefined, []); +}); +async function testLanguageAliases(t, matrixLanguages, languageName, aliases, expectedErrorMessages) { + process.env.GITHUB_JOB = "test"; + const codeql = await (0, codeql_1.getCodeQLForTesting)(); + sinon.stub(codeql, "betterResolveLanguages").resolves({ + aliases: aliases !== undefined + ? Object.assign({}, ...aliases.map((alias) => ({ [alias]: languageName }))) + : undefined, + extractors: { + java: [ + { + extractor_root: "", + }, + ], + }, + }); + const errors = await (0, workflow_1.getWorkflowErrors)({ + on: ["push", "pull_request"], + jobs: { + test: { + strategy: { + matrix: { + language: matrixLanguages, + }, + }, + steps: [ + { uses: "actions/checkout@v2" }, + { uses: "github/codeql-action/init@v2" }, + { uses: "github/codeql-action/analyze@v2" }, + ], + }, + }, + }, codeql); + t.is(errors.length, expectedErrorMessages.length); + t.deepEqual(errors.map((e) => e.message), expectedErrorMessages); +} (0, ava_1.default)("formatWorkflowErrors() when there is one error", (t) => { const message = (0, workflow_1.formatWorkflowErrors)([workflow_1.WorkflowErrors.CheckoutWrongHead]); t.true(message.startsWith("1 issue was detected with this workflow:")); @@ -213,19 +260,19 @@ function errorCodes(actual, expected) { t.true((0, workflow_1.patternIsSuperset)("/robin/*/release/*", "/robin/moose/release/goose")); t.false((0, workflow_1.patternIsSuperset)("/robin/moose/release/goose", "/robin/*/release/*")); }); -(0, ava_1.default)("getWorkflowErrors() when branches contain dots", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)(yaml.load(` +(0, ava_1.default)("getWorkflowErrors() when branches contain dots", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` on: push: branches: [4.1, master] pull_request: # The branches below must be a subset of the branches above branches: [4.1, master] - `)); + `), await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on.push has a trailing comma", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)(yaml.load(` +(0, ava_1.default)("getWorkflowErrors() when on.push has a trailing comma", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: push: @@ -233,12 +280,12 @@ function errorCodes(actual, expected) { pull_request: # The branches below must be a subset of the branches above branches: [master] - `)); + `), await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() should only report the current job's CheckoutWrongHead", (t) => { +(0, ava_1.default)("getWorkflowErrors() should only report the current job's CheckoutWrongHead", async (t) => { process.env.GITHUB_JOB = "test"; - const errors = (0, workflow_1.getWorkflowErrors)(yaml.load(` + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: push: @@ -257,12 +304,12 @@ function errorCodes(actual, expected) { test3: steps: [] - `)); + `), await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [workflow_1.WorkflowErrors.CheckoutWrongHead])); }); -(0, ava_1.default)("getWorkflowErrors() should not report a different job's CheckoutWrongHead", (t) => { +(0, ava_1.default)("getWorkflowErrors() should not report a different job's CheckoutWrongHead", async (t) => { process.env.GITHUB_JOB = "test3"; - const errors = (0, workflow_1.getWorkflowErrors)(yaml.load(` + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: push: @@ -281,41 +328,41 @@ function errorCodes(actual, expected) { test3: steps: [] - `)); + `), await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() when on is missing", (t) => { - const errors = (0, workflow_1.getWorkflowErrors)(yaml.load(` +(0, ava_1.default)("getWorkflowErrors() when on is missing", async (t) => { + const errors = await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" - `)); + `), await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [])); }); -(0, ava_1.default)("getWorkflowErrors() with a different on setup", (t) => { - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)(yaml.load(` +(0, ava_1.default)("getWorkflowErrors() with a different on setup", async (t) => { + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: "workflow_dispatch" - `)), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)(yaml.load(` + `), await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: [workflow_dispatch] - `)), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)(yaml.load(` + `), await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: workflow_dispatch: {} - `)), [])); + `), await (0, codeql_1.getCodeQLForTesting)()), [])); }); -(0, ava_1.default)("getWorkflowErrors() should not report an error if PRs are totally unconfigured", (t) => { - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)(yaml.load(` +(0, ava_1.default)("getWorkflowErrors() should not report an error if PRs are totally unconfigured", async (t) => { + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: push: branches: [master] - `)), [])); - t.deepEqual(...errorCodes((0, workflow_1.getWorkflowErrors)(yaml.load(` + `), await (0, codeql_1.getCodeQLForTesting)()), [])); + t.deepEqual(...errorCodes(await (0, workflow_1.getWorkflowErrors)(yaml.load(` name: "CodeQL" on: ["push"] - `)), [])); + `), await (0, codeql_1.getCodeQLForTesting)()), [])); }); (0, ava_1.default)("getCategoryInputOrThrow returns category for simple workflow with category", (t) => { process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; diff --git a/lib/workflow.test.js.map b/lib/workflow.test.js.map index a4378055ad..6411ecc01a 100644 --- a/lib/workflow.test.js.map +++ b/lib/workflow.test.js.map @@ -1 +1 @@ -{"version":3,"file":"workflow.test.js","sourceRoot":"","sources":["../src/workflow.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,8CAAgC;AAEhC,mDAA6C;AAC7C,yCASoB;AAEpB,SAAS,UAAU,CACjB,MAAoB,EACpB,QAAsB;IAEtB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,sCAAsC,EAAE,CAAC,CAAC,EAAE,EAAE;IACjD,MAAM,MAAM,GAAG,IAAA,4BAAiB,EAAC,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;IAE7C,CAAC,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC;AACzC,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,mEAAmE,EAAE,CAAC,CAAC,EAAE,EAAE;IAC9E,MAAM,MAAM,GAAG,IAAA,4BAAiB,EAAC,EAAE,E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,IAAI,CAAC,IAAI,CAAC;;;;;;;;;SAST,CAAa,EACd,UAAU,EACV,EAAE,CACH,EACH;QACE,OAAO,EACL,kFAAkF;YAClF,gCAAgC;KACnC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,kFAAkF,EAAE,CAAC,CAAC,EAAE,EAAE;IAC7F,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;IAC1E,CAAC,CAAC,MAAM,CACN,GAAG,EAAE,CACH,IAAA,kCAAuB,EACrB,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;SAaT,CAAa,EACd,UAAU,EACV,EAAE,CACH,EACH;QACE,OAAO,EACL,sFAAsF;YACtF,oDAAoD;KACvD,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"workflow.test.js","sourceRoot":"","sources":["../src/workflow.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA6C;AAC7C,8CAAgC;AAChC,6CAA+B;AAE/B,qCAA+C;AAC/C,mDAA6C;AAC7C,yCASoB;AAEpB,SAAS,UAAU,CACjB,MAAoB,EACpB,QAAsB;IAEtB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AAC5E,CAAC;AAED,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,sCAAsC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACvD,MAAM,MAAM,GAAG,MAAM,IAAA,4BAAiB,EACpC,EAAE,EAAE,EAAE,EAAE,EAAE,EACV,MAAM,IAAA,4BAAmB,GAAE,CAC5B,CAAC;IAEF,CAAC,CAAC,SAAS,C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,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;IAC1E,CAAC,CAAC,MAAM,CACN,GAAG,EAAE,CACH,IAAA,kCAAuB,EACrB,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;SAaT,CAAa,EACd,UAAU,EACV,EAAE,CACH,EACH;QACE,OAAO,EACL,sFAAsF;YACtF,oDAAoD;KACvD,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/src/init-action.ts b/src/init-action.ts index ed775fc47e..a08e5446b7 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -217,8 +217,6 @@ async function run() { core.exportVariable(EnvVar.JOB_RUN_UUID, uuidV4()); try { - const workflowErrors = await validateWorkflow(logger); - if ( !(await sendStatusReport( await createStatusReportBase( @@ -226,7 +224,6 @@ async function run() { "starting", startedAt, await checkDiskUsage(logger), - workflowErrors, ), )) ) { @@ -250,6 +247,8 @@ async function run() { toolsVersion = initCodeQLResult.toolsVersion; toolsSource = initCodeQLResult.toolsSource; + await validateWorkflow(codeql, logger); + config = await initConfig( getOptionalInput("languages"), getOptionalInput("queries"), diff --git a/src/workflow.test.ts b/src/workflow.test.ts index c2309b18cb..baa1f5eb2f 100644 --- a/src/workflow.test.ts +++ b/src/workflow.test.ts @@ -1,6 +1,8 @@ -import test from "ava"; +import test, { ExecutionContext } from "ava"; import * as yaml from "js-yaml"; +import * as sinon from "sinon"; +import { getCodeQLForTesting } from "./codeql"; import { setupTests } from "./testing-utils"; import { CodedError, @@ -22,227 +24,387 @@ function errorCodes( setupTests(test); -test("getWorkflowErrors() when on is empty", (t) => { - const errors = getWorkflowErrors({ on: {} }); +test("getWorkflowErrors() when on is empty", async (t) => { + const errors = await getWorkflowErrors( + { on: {} }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.push is an array missing pull_request", (t) => { - const errors = getWorkflowErrors({ on: ["push"] }); +test("getWorkflowErrors() when on.push is an array missing pull_request", async (t) => { + const errors = await getWorkflowErrors( + { on: ["push"] }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.push is an array missing push", (t) => { - const errors = getWorkflowErrors({ on: ["pull_request"] }); +test("getWorkflowErrors() when on.push is an array missing push", async (t) => { + const errors = await getWorkflowErrors( + { on: ["pull_request"] }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [WorkflowErrors.MissingPushHook])); }); -test("getWorkflowErrors() when on.push is valid", (t) => { - const errors = getWorkflowErrors({ - on: ["push", "pull_request"], - }); +test("getWorkflowErrors() when on.push is valid", async (t) => { + const errors = await getWorkflowErrors( + { + on: ["push", "pull_request"], + }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.push is a valid superset", (t) => { - const errors = getWorkflowErrors({ - on: ["push", "pull_request", "schedule"], - }); +test("getWorkflowErrors() when on.push is a valid superset", async (t) => { + const errors = await getWorkflowErrors( + { + on: ["push", "pull_request", "schedule"], + }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.push is a correct object", (t) => { - const errors = getWorkflowErrors({ - on: { push: { branches: ["main"] }, pull_request: { branches: ["main"] } }, - }); +test("getWorkflowErrors() when on.push is a correct object", async (t) => { + const errors = await getWorkflowErrors( + { + on: { + push: { branches: ["main"] }, + pull_request: { branches: ["main"] }, + }, + }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.pull_requests is a string and correct", (t) => { - const errors = getWorkflowErrors({ - on: { push: { branches: "*" }, pull_request: { branches: "*" } }, - }); +test("getWorkflowErrors() when on.pull_requests is a string and correct", async (t) => { + const errors = await getWorkflowErrors( + { + on: { push: { branches: "*" }, pull_request: { branches: "*" } }, + }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.push is correct with empty objects", (t) => { - const errors = getWorkflowErrors( +test("getWorkflowErrors() when on.push is correct with empty objects", async (t) => { + const errors = await getWorkflowErrors( yaml.load(` on: push: pull_request: `) as Workflow, + await getCodeQLForTesting(), ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.push is not mismatched", (t) => { - const errors = getWorkflowErrors({ - on: { - push: { branches: ["main", "feature"] }, - pull_request: { branches: ["main"] }, +test("getWorkflowErrors() when on.push is not mismatched", async (t) => { + const errors = await getWorkflowErrors( + { + on: { + push: { branches: ["main", "feature"] }, + pull_request: { branches: ["main"] }, + }, }, - }); + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() for a range of malformed workflows", (t) => { +test("getWorkflowErrors() for a range of malformed workflows", async (t) => { t.deepEqual( ...errorCodes( - getWorkflowErrors({ - on: { - push: 1, - pull_request: 1, - }, - } as Workflow), + await getWorkflowErrors( + { + on: { + push: 1, + pull_request: 1, + }, + } as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - getWorkflowErrors({ - on: 1, - } as Workflow), + await getWorkflowErrors( + { + on: 1, + } as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - getWorkflowErrors({ - on: 1, - jobs: 1, - } as any), + await getWorkflowErrors( + { + on: 1, + jobs: 1, + } as unknown as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - getWorkflowErrors({ - on: 1, - jobs: [1], - } as any), + await getWorkflowErrors( + { + on: 1, + jobs: [1], + } as unknown as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - getWorkflowErrors({ - on: 1, - jobs: { 1: 1 }, - } as Workflow), + await getWorkflowErrors( + { + on: 1, + jobs: { 1: 1 }, + } as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - getWorkflowErrors({ - on: 1, - jobs: { test: 1 }, - } as Workflow), + await getWorkflowErrors( + { + on: 1, + jobs: { test: 1 }, + } as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - getWorkflowErrors({ - on: 1, - jobs: { test: [1] }, - } as Workflow), + await getWorkflowErrors( + { + on: 1, + jobs: { test: [1] }, + } as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - getWorkflowErrors({ - on: 1, - jobs: { test: { steps: 1 } }, - } as any), + await getWorkflowErrors( + { + on: 1, + jobs: { test: { steps: 1 } }, + } as unknown as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - getWorkflowErrors({ - on: 1, - jobs: { test: { steps: [{ notrun: "git checkout HEAD^2" }] } }, - } as any), + await getWorkflowErrors( + { + on: 1, + jobs: { test: { steps: [{ notrun: "git checkout HEAD^2" }] } }, + } as unknown as Workflow, + await getCodeQLForTesting(), + ), [], ), ); t.deepEqual( ...errorCodes( - getWorkflowErrors({ - on: 1, - jobs: { test: [undefined] }, - } as Workflow), + await getWorkflowErrors( + { + on: 1, + jobs: { test: [undefined] }, + } as Workflow, + await getCodeQLForTesting(), + ), [], ), ); - t.deepEqual(...errorCodes(getWorkflowErrors(1 as Workflow), [])); + t.deepEqual( + ...errorCodes( + await getWorkflowErrors(1 as Workflow, await getCodeQLForTesting()), + [], + ), + ); t.deepEqual( ...errorCodes( - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument - getWorkflowErrors({ - on: { - push: { - branches: 1, - }, - pull_request: { - branches: 1, + await getWorkflowErrors( + { + on: { + push: { + branches: 1, + }, + pull_request: { + branches: 1, + }, }, - }, - } as any), + } as unknown as Workflow, + await getCodeQLForTesting(), + ), [], ), ); }); -test("getWorkflowErrors() when on.pull_request for wildcard branches", (t) => { - const errors = getWorkflowErrors({ - on: { - push: { branches: ["feature/*"] }, - pull_request: { branches: "feature/moose" }, +test("getWorkflowErrors() when on.pull_request for wildcard branches", async (t) => { + const errors = await getWorkflowErrors( + { + on: { + push: { branches: ["feature/*"] }, + pull_request: { branches: "feature/moose" }, + }, }, - }); + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when HEAD^2 is checked out", (t) => { +test("getWorkflowErrors() when HEAD^2 is checked out", async (t) => { process.env.GITHUB_JOB = "test"; - const errors = getWorkflowErrors({ - on: ["push", "pull_request"], - jobs: { test: { steps: [{ run: "git checkout HEAD^2" }] } }, - }); + const errors = await getWorkflowErrors( + { + on: ["push", "pull_request"], + jobs: { test: { steps: [{ run: "git checkout HEAD^2" }] } }, + }, + await getCodeQLForTesting(), + ); t.deepEqual(...errorCodes(errors, [WorkflowErrors.CheckoutWrongHead])); }); +test("getWorkflowErrors() for workflow with language name and its alias", async (t) => { + await testLanguageAliases( + t, + ["java", "kotlin"], + "java", + ["java-kotlin", "kotlin"], + [ + "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + + "matrix parameter to keep only one of the following: 'java', 'kotlin'.", + ], + ); +}); + +test("getWorkflowErrors() for workflow with two aliases same language", async (t) => { + await testLanguageAliases( + t, + ["java-kotlin", "kotlin"], + "java", + ["java-kotlin", "kotlin"], + [ + "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + + "matrix parameter to keep only one of the following: 'java-kotlin', 'kotlin'.", + ], + ); +}); + +test("getWorkflowErrors() does not produce error if codeql doesn't support language aliases", async (t) => { + await testLanguageAliases( + t, + ["java-kotlin", "kotlin"], + "java", + undefined, + [], + ); +}); + +async function testLanguageAliases( + t: ExecutionContext, + matrixLanguages: string[], + languageName: string, + aliases: string[] | undefined, + expectedErrorMessages: string[], +) { + process.env.GITHUB_JOB = "test"; + + const codeql = await getCodeQLForTesting(); + sinon.stub(codeql, "betterResolveLanguages").resolves({ + aliases: + aliases !== undefined + ? Object.assign( + {}, + ...aliases.map((alias) => ({ [alias]: languageName })), + ) + : undefined, + extractors: { + java: [ + { + extractor_root: "", + }, + ], + }, + }); + + const errors = await getWorkflowErrors( + { + on: ["push", "pull_request"], + jobs: { + test: { + strategy: { + matrix: { + language: matrixLanguages, + }, + }, + steps: [ + { uses: "actions/checkout@v2" }, + { uses: "github/codeql-action/init@v2" }, + { uses: "github/codeql-action/analyze@v2" }, + ], + }, + }, + } as Workflow, + codeql, + ); + + t.is(errors.length, expectedErrorMessages.length); + t.deepEqual( + errors.map((e) => e.message), + expectedErrorMessages, + ); +} + test("formatWorkflowErrors() when there is one error", (t) => { const message = formatWorkflowErrors([WorkflowErrors.CheckoutWrongHead]); t.true(message.startsWith("1 issue was detected with this workflow:")); @@ -297,8 +459,8 @@ test("patternIsSuperset()", (t) => { ); }); -test("getWorkflowErrors() when branches contain dots", (t) => { - const errors = getWorkflowErrors( +test("getWorkflowErrors() when branches contain dots", async (t) => { + const errors = await getWorkflowErrors( yaml.load(` on: push: @@ -307,13 +469,14 @@ test("getWorkflowErrors() when branches contain dots", (t) => { # The branches below must be a subset of the branches above branches: [4.1, master] `) as Workflow, + await getCodeQLForTesting(), ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on.push has a trailing comma", (t) => { - const errors = getWorkflowErrors( +test("getWorkflowErrors() when on.push has a trailing comma", async (t) => { + const errors = await getWorkflowErrors( yaml.load(` name: "CodeQL" on: @@ -323,15 +486,16 @@ test("getWorkflowErrors() when on.push has a trailing comma", (t) => { # The branches below must be a subset of the branches above branches: [master] `) as Workflow, + await getCodeQLForTesting(), ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() should only report the current job's CheckoutWrongHead", (t) => { +test("getWorkflowErrors() should only report the current job's CheckoutWrongHead", async (t) => { process.env.GITHUB_JOB = "test"; - const errors = getWorkflowErrors( + const errors = await getWorkflowErrors( yaml.load(` name: "CodeQL" on: @@ -352,15 +516,16 @@ test("getWorkflowErrors() should only report the current job's CheckoutWrongHead test3: steps: [] `) as Workflow, + await getCodeQLForTesting(), ); t.deepEqual(...errorCodes(errors, [WorkflowErrors.CheckoutWrongHead])); }); -test("getWorkflowErrors() should not report a different job's CheckoutWrongHead", (t) => { +test("getWorkflowErrors() should not report a different job's CheckoutWrongHead", async (t) => { process.env.GITHUB_JOB = "test3"; - const errors = getWorkflowErrors( + const errors = await getWorkflowErrors( yaml.load(` name: "CodeQL" on: @@ -381,29 +546,32 @@ test("getWorkflowErrors() should not report a different job's CheckoutWrongHead" test3: steps: [] `) as Workflow, + await getCodeQLForTesting(), ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() when on is missing", (t) => { - const errors = getWorkflowErrors( +test("getWorkflowErrors() when on is missing", async (t) => { + const errors = await getWorkflowErrors( yaml.load(` name: "CodeQL" `) as Workflow, + await getCodeQLForTesting(), ); t.deepEqual(...errorCodes(errors, [])); }); -test("getWorkflowErrors() with a different on setup", (t) => { +test("getWorkflowErrors() with a different on setup", async (t) => { t.deepEqual( ...errorCodes( - getWorkflowErrors( + await getWorkflowErrors( yaml.load(` name: "CodeQL" on: "workflow_dispatch" `) as Workflow, + await getCodeQLForTesting(), ), [], ), @@ -411,11 +579,12 @@ test("getWorkflowErrors() with a different on setup", (t) => { t.deepEqual( ...errorCodes( - getWorkflowErrors( + await getWorkflowErrors( yaml.load(` name: "CodeQL" on: [workflow_dispatch] `) as Workflow, + await getCodeQLForTesting(), ), [], ), @@ -423,28 +592,30 @@ test("getWorkflowErrors() with a different on setup", (t) => { t.deepEqual( ...errorCodes( - getWorkflowErrors( + await getWorkflowErrors( yaml.load(` name: "CodeQL" on: workflow_dispatch: {} `) as Workflow, + await getCodeQLForTesting(), ), [], ), ); }); -test("getWorkflowErrors() should not report an error if PRs are totally unconfigured", (t) => { +test("getWorkflowErrors() should not report an error if PRs are totally unconfigured", async (t) => { t.deepEqual( ...errorCodes( - getWorkflowErrors( + await getWorkflowErrors( yaml.load(` name: "CodeQL" on: push: branches: [master] `) as Workflow, + await getCodeQLForTesting(), ), [], ), @@ -452,11 +623,12 @@ test("getWorkflowErrors() should not report an error if PRs are totally unconfig t.deepEqual( ...errorCodes( - getWorkflowErrors( + await getWorkflowErrors( yaml.load(` name: "CodeQL" on: ["push"] `) as Workflow, + await getCodeQLForTesting(), ), [], ), diff --git a/src/workflow.ts b/src/workflow.ts index c1406fbfb0..2ecbb05a70 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -6,6 +6,7 @@ import * as core from "@actions/core"; import * as yaml from "js-yaml"; import * as api from "./api-client"; +import { CodeQL } from "./codeql"; import { EnvVar } from "./environment"; import { Logger } from "./logging"; import { getRequiredEnvParam, isInTestMode } from "./util"; @@ -21,6 +22,7 @@ interface WorkflowJob { name?: string; "runs-on"?: string; steps?: WorkflowJobStep[]; + strategy?: { matrix: { [key: string]: string[] } }; uses?: string; } @@ -104,7 +106,10 @@ export const WorkflowErrors = toCodedErrors({ CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`, }); -export function getWorkflowErrors(doc: Workflow): CodedError[] { +export async function getWorkflowErrors( + doc: Workflow, + codeql: CodeQL, +): Promise { const errors: CodedError[] = []; const jobName = process.env.GITHUB_JOB; @@ -112,6 +117,45 @@ export function getWorkflowErrors(doc: Workflow): CodedError[] { if (jobName) { const job = doc?.jobs?.[jobName]; + if (job?.strategy?.matrix?.language) { + const matrixLanguages = job.strategy.matrix.language; + if (Array.isArray(matrixLanguages)) { + const resolveResult = await codeql.betterResolveLanguages(); + if (resolveResult.aliases) { + const aliases = resolveResult.aliases; + // Map extractors to entries in the `language` matrix parameter. This will allow us to + // detect languages which are analyzed in more than one job. + const matrixLanguagesByExtractor: { + [extractorName: string]: string[]; + } = {}; + for (const language of matrixLanguages) { + const extractorName = aliases[language] || language; + if (!matrixLanguagesByExtractor[extractorName]) { + matrixLanguagesByExtractor[extractorName] = []; + } + matrixLanguagesByExtractor[extractorName].push(language); + } + + // Check for duplicate languages in the matrix + for (const [extractor, languages] of Object.entries( + matrixLanguagesByExtractor, + )) { + if (languages.length > 1) { + errors.push({ + message: + `CodeQL language '${extractor}' is referenced by more than one entry in the ` + + `'language' matrix parameter for job '${jobName}'. This may result in duplicate alerts. ` + + `Please edit the 'language' matrix parameter to keep only one of the following: ${languages + .map((language) => `'${language}'`) + .join(", ")}.`, + code: "DuplicateLanguageInMatrix", + }); + } + } + } + } + } + const steps = job?.steps; if (Array.isArray(steps)) { @@ -163,6 +207,7 @@ export function getWorkflowErrors(doc: Workflow): CodedError[] { } export async function validateWorkflow( + codeql: CodeQL, logger: Logger, ): Promise { let workflow: Workflow; @@ -173,7 +218,7 @@ export async function validateWorkflow( } let workflowErrors: CodedError[]; try { - workflowErrors = getWorkflowErrors(workflow); + workflowErrors = await getWorkflowErrors(workflow, codeql); } catch (e) { return `error: getWorkflowErrors() failed: ${String(e)}`; } From 431174f62063abb35081859de7214678dcda7f51 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 22 Sep 2023 18:55:52 +0100 Subject: [PATCH 2/4] Factor out `groupLanguagesByExtractor` --- lib/workflow.js | 40 ++++++++++++++++++++++------------ lib/workflow.js.map | 2 +- src/workflow.ts | 52 +++++++++++++++++++++++++++++++-------------- 3 files changed, 64 insertions(+), 30 deletions(-) diff --git a/lib/workflow.js b/lib/workflow.js index bb49d7ce6d..9292a4c37b 100644 --- a/lib/workflow.js +++ b/lib/workflow.js @@ -78,6 +78,27 @@ exports.WorkflowErrors = toCodedErrors({ MissingPushHook: `Please specify an on.push hook to analyze and see code scanning alerts from the default branch on the Security tab.`, CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`, }); +/** + * Groups the given list of CodeQL languages by their extractor name. + * + * Resolves to `undefined` if the CodeQL version does not support language aliasing. + */ +async function groupLanguagesByExtractor(languages, codeql) { + const resolveResult = await codeql.betterResolveLanguages(); + if (!resolveResult.aliases) { + return undefined; + } + const aliases = resolveResult.aliases; + const languagesByExtractor = {}; + for (const language of languages) { + const extractorName = aliases[language] || language; + if (!languagesByExtractor[extractorName]) { + languagesByExtractor[extractorName] = []; + } + languagesByExtractor[extractorName].push(language); + } + return languagesByExtractor; +} async function getWorkflowErrors(doc, codeql) { const errors = []; const jobName = process.env.GITHUB_JOB; @@ -86,19 +107,12 @@ async function getWorkflowErrors(doc, codeql) { if (job?.strategy?.matrix?.language) { const matrixLanguages = job.strategy.matrix.language; if (Array.isArray(matrixLanguages)) { - const resolveResult = await codeql.betterResolveLanguages(); - if (resolveResult.aliases) { - const aliases = resolveResult.aliases; - // Map extractors to entries in the `language` matrix parameter. This will allow us to - // detect languages which are analyzed in more than one job. - const matrixLanguagesByExtractor = {}; - for (const language of matrixLanguages) { - const extractorName = aliases[language] || language; - if (!matrixLanguagesByExtractor[extractorName]) { - matrixLanguagesByExtractor[extractorName] = []; - } - matrixLanguagesByExtractor[extractorName].push(language); - } + // Map extractors to entries in the `language` matrix parameter. This will allow us to + // detect languages which are analyzed in more than one job. + const matrixLanguagesByExtractor = await groupLanguagesByExtractor(matrixLanguages, codeql); + // If the CodeQL version does not support language aliasing, then `matrixLanguagesByExtractor` + // will be `undefined`. In this case, we cannot detect duplicate languages in the matrix. + if (matrixLanguagesByExtractor !== undefined) { // Check for duplicate languages in the matrix for (const [extractor, languages] of Object.entries(matrixLanguagesByExtractor)) { if (languages.length > 1) { diff --git a/lib/workflow.js.map b/lib/workflow.js.map index 439c8dacea..9b8f6d2e0f 100644 --- a/lib/workflow.js.map +++ b/lib/workflow.js.map @@ -1 +1 @@ -{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,cAAc,GAAG,IAAI,EAAE,KAAK,CAAC,CAAC;SACrD;KACF;IACD,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE;QAChD,MAAM,IAAI,KAAK,CACb,iBAAiB,SAAS,aAAa,UAAU,oDAAoD,CACtG,CAAC;KACH;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED;;;;GAIG;AACH,SAAS,oBAAoB;IAC3B,IACE,IAAA,mBAAY,GAAE;QACd,OAAO,CAAC,GAAG,CAAC,oBAAM,CAAC,mBAAmB,CAAC,KAAK,yBAAyB,EACrE;QACA,OAAO,WAAW,CAAC;KACpB;SAAM;QACL,OAAO,8BAA8B,CAAC;KACvC;AACH,CAAC;AAED;;;;;;;;GAQG;AACH,SAAgB,uBAAuB,CACrC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,UAAU,EACV,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,0DAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,qBAAqB,CACnC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,eAAe,CACpB,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,QAAQ,EACR,UAAU,CACX,CAAC;AACJ,CAAC;AAZD,sDAYC;AAED;;;;;;;;GAQG;AACH,SAAgB,2BAA2B,CACzC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,CACL,eAAe,CACb,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,eAAe,EACf,UAAU,CACX,IAAI,IAAA,0BAAmB,EAAC,kBAAkB,CAAC,CAAC,oEAAoE;KAClH,CAAC;AACJ,CAAC;AAdD,kEAcC"} \ No newline at end of file +{"version":3,"file":"workflow.js","sourceRoot":"","sources":["../src/workflow.ts"],"names":[],"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AQG;AACH,SAAgB,2BAA2B,CACzC,QAAkB,EAClB,OAAe,EACf,UAAiD;IAEjD,OAAO,CACL,eAAe,CACb,QAAQ,EACR,OAAO,EACP,oBAAoB,EAAE,EACtB,eAAe,EACf,UAAU,CACX,IAAI,IAAA,0BAAmB,EAAC,kBAAkB,CAAC,CAAC,oEAAoE;KAClH,CAAC;AACJ,CAAC;AAdD,kEAcC"} \ No newline at end of file diff --git a/src/workflow.ts b/src/workflow.ts index 2ecbb05a70..decd03f64a 100644 --- a/src/workflow.ts +++ b/src/workflow.ts @@ -106,6 +106,33 @@ export const WorkflowErrors = toCodedErrors({ CheckoutWrongHead: `git checkout HEAD^2 is no longer necessary. Please remove this step as Code Scanning recommends analyzing the merge commit for best results.`, }); +/** + * Groups the given list of CodeQL languages by their extractor name. + * + * Resolves to `undefined` if the CodeQL version does not support language aliasing. + */ +async function groupLanguagesByExtractor( + languages: string[], + codeql: CodeQL, +): Promise<{ [extractorName: string]: string[] } | undefined> { + const resolveResult = await codeql.betterResolveLanguages(); + if (!resolveResult.aliases) { + return undefined; + } + const aliases = resolveResult.aliases; + const languagesByExtractor: { + [extractorName: string]: string[]; + } = {}; + for (const language of languages) { + const extractorName = aliases[language] || language; + if (!languagesByExtractor[extractorName]) { + languagesByExtractor[extractorName] = []; + } + languagesByExtractor[extractorName].push(language); + } + return languagesByExtractor; +} + export async function getWorkflowErrors( doc: Workflow, codeql: CodeQL, @@ -120,22 +147,15 @@ export async function getWorkflowErrors( if (job?.strategy?.matrix?.language) { const matrixLanguages = job.strategy.matrix.language; if (Array.isArray(matrixLanguages)) { - const resolveResult = await codeql.betterResolveLanguages(); - if (resolveResult.aliases) { - const aliases = resolveResult.aliases; - // Map extractors to entries in the `language` matrix parameter. This will allow us to - // detect languages which are analyzed in more than one job. - const matrixLanguagesByExtractor: { - [extractorName: string]: string[]; - } = {}; - for (const language of matrixLanguages) { - const extractorName = aliases[language] || language; - if (!matrixLanguagesByExtractor[extractorName]) { - matrixLanguagesByExtractor[extractorName] = []; - } - matrixLanguagesByExtractor[extractorName].push(language); - } - + // Map extractors to entries in the `language` matrix parameter. This will allow us to + // detect languages which are analyzed in more than one job. + const matrixLanguagesByExtractor = await groupLanguagesByExtractor( + matrixLanguages, + codeql, + ); + // If the CodeQL version does not support language aliasing, then `matrixLanguagesByExtractor` + // will be `undefined`. In this case, we cannot detect duplicate languages in the matrix. + if (matrixLanguagesByExtractor !== undefined) { // Check for duplicate languages in the matrix for (const [extractor, languages] of Object.entries( matrixLanguagesByExtractor, From d1a917f44560a850ca5a2c2f25f137962d1bb6e8 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 22 Sep 2023 19:08:38 +0100 Subject: [PATCH 3/4] Test that workflow with two different languages doesn't produce an error --- lib/workflow.test.js | 25 +++++++++++++++++-------- lib/workflow.test.js.map | 2 +- src/workflow.test.ts | 36 ++++++++++++++++++++++-------------- 3 files changed, 40 insertions(+), 23 deletions(-) diff --git a/lib/workflow.test.js b/lib/workflow.test.js index 05c1f6503f..ffd9115b17 100644 --- a/lib/workflow.test.js +++ b/lib/workflow.test.js @@ -163,29 +163,38 @@ function errorCodes(actual, expected) { }, await (0, codeql_1.getCodeQLForTesting)()); t.deepEqual(...errorCodes(errors, [workflow_1.WorkflowErrors.CheckoutWrongHead])); }); -(0, ava_1.default)("getWorkflowErrors() for workflow with language name and its alias", async (t) => { - await testLanguageAliases(t, ["java", "kotlin"], "java", ["java-kotlin", "kotlin"], [ +(0, ava_1.default)("getWorkflowErrors() produces an error for workflow with language name and its alias", async (t) => { + await testLanguageAliases(t, ["java", "kotlin"], { java: ["java-kotlin", "kotlin"] }, [ "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + "matrix parameter to keep only one of the following: 'java', 'kotlin'.", ]); }); -(0, ava_1.default)("getWorkflowErrors() for workflow with two aliases same language", async (t) => { - await testLanguageAliases(t, ["java-kotlin", "kotlin"], "java", ["java-kotlin", "kotlin"], [ +(0, ava_1.default)("getWorkflowErrors() produces an error for workflow with two aliases same language", async (t) => { + await testLanguageAliases(t, ["java-kotlin", "kotlin"], { java: ["java-kotlin", "kotlin"] }, [ "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + "matrix parameter to keep only one of the following: 'java-kotlin', 'kotlin'.", ]); }); -(0, ava_1.default)("getWorkflowErrors() does not produce error if codeql doesn't support language aliases", async (t) => { - await testLanguageAliases(t, ["java-kotlin", "kotlin"], "java", undefined, []); +(0, ava_1.default)("getWorkflowErrors() does not produce an error for workflow with two distinct languages", async (t) => { + await testLanguageAliases(t, ["java", "typescript"], { + java: ["java-kotlin", "kotlin"], + javascript: ["javascript-typescript", "typescript"], + }, []); }); -async function testLanguageAliases(t, matrixLanguages, languageName, aliases, expectedErrorMessages) { +(0, ava_1.default)("getWorkflowErrors() does not produce an error if codeql doesn't support language aliases", async (t) => { + await testLanguageAliases(t, ["java-kotlin", "kotlin"], undefined, []); +}); +async function testLanguageAliases(t, matrixLanguages, aliases, expectedErrorMessages) { process.env.GITHUB_JOB = "test"; const codeql = await (0, codeql_1.getCodeQLForTesting)(); sinon.stub(codeql, "betterResolveLanguages").resolves({ aliases: aliases !== undefined - ? Object.assign({}, ...aliases.map((alias) => ({ [alias]: languageName }))) + ? // Remap from languageName -> aliases to alias -> languageName + Object.assign({}, ...Object.entries(aliases).flatMap(([language, languageAliases]) => languageAliases.map((alias) => ({ + [alias]: language, + })))) : undefined, extractors: { java: [ diff --git a/lib/workflow.test.js.map b/lib/workflow.test.js.map index 6411ecc01a..f28eacb659 100644 --- a/lib/workflow.test.js.map +++ b/lib/workflow.test.js.map @@ -1 +1 @@ -{"version":3,"file":"workflow.test.js","sourceRoot":"","sources":["../src/workflow.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA6C;AAC7C,8CAAgC;AAChC,6CAA+B;AA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;;;;;;OAeT,CAAa,EACd,UAAU,EACV,EAAE,QAAQ,EAAE,YAAY,EAAE,CAC3B,EACD,sBAAsB,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,yEAAyE,EAAE,CAAC,CAAC,EAAE,EAAE;IACpF,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;IAC1E,CAAC,CAAC,MAAM,CACN,GAAG,EAAE,CACH,IAAA,kCAAuB,EACrB,IAAI,CAAC,IAAI,CAAC;;;;;;;;;SAST,CAAa,EACd,UAAU,EACV,EAAE,CACH,EACH;QACE,OAAO,EACL,kFAAkF;YAClF,gCAAgC;KACnC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,kFAAkF,EAAE,CAAC,CAAC,EAAE,EAAE;IAC7F,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;IAC1E,CAAC,CAAC,MAAM,CACN,GAAG,EAAE,CACH,IAAA,kCAAuB,EACrB,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;SAaT,CAAa,EACd,UAAU,EACV,EAAE,CACH,EACH;QACE,OAAO,EACL,sFAAsF;YACtF,oDAAoD;KACvD,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"workflow.test.js","sourceRoot":"","sources":["../src/workflow.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA6C;AAC7C,8CAAgC;AAChC,6CAA+B;AAE/B,qCAA+C;AAC/C,mDAA6C;AAC7C,yCASoB;AAEpB,SAAS,UAAU,CACjB,MAAoB,EACpB,QAAsB;IAEtB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,E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AAC,0EAA0E,EAAE,CAAC,CAAC,EAAE,EAAE;IACrF,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;IAC1E,CAAC,CAAC,EAAE,CACF,IAAA,kCAAuB,EACrB,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;;;OAeT,CAAa,EACd,UAAU,EACV,EAAE,QAAQ,EAAE,YAAY,EAAE,CAC3B,EACD,sBAAsB,CACvB,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,yEAAyE,EAAE,CAAC,CAAC,EAAE,EAAE;IACpF,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;IAC1E,CAAC,CAAC,MAAM,CACN,GAAG,EAAE,CACH,IAAA,kCAAuB,EACrB,IAAI,CAAC,IAAI,CAAC;;;;;;;;;SAST,CAAa,EACd,UAAU,EACV,EAAE,CACH,EACH;QACE,OAAO,EACL,kFAAkF;YAClF,gCAAgC;KACnC,CACF,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,kFAAkF,EAAE,CAAC,CAAC,EAAE,EAAE;IAC7F,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;IAC1E,CAAC,CAAC,MAAM,CACN,GAAG,EAAE,CACH,IAAA,kCAAuB,EACrB,IAAI,CAAC,IAAI,CAAC;;;;;;;;;;;;;SAaT,CAAa,EACd,UAAU,EACV,EAAE,CACH,EACH;QACE,OAAO,EACL,sFAAsF;YACtF,oDAAoD;KACvD,CACF,CAAC;AACJ,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/src/workflow.test.ts b/src/workflow.test.ts index baa1f5eb2f..dbba412ab3 100644 --- a/src/workflow.test.ts +++ b/src/workflow.test.ts @@ -312,12 +312,11 @@ test("getWorkflowErrors() when HEAD^2 is checked out", async (t) => { t.deepEqual(...errorCodes(errors, [WorkflowErrors.CheckoutWrongHead])); }); -test("getWorkflowErrors() for workflow with language name and its alias", async (t) => { +test("getWorkflowErrors() produces an error for workflow with language name and its alias", async (t) => { await testLanguageAliases( t, ["java", "kotlin"], - "java", - ["java-kotlin", "kotlin"], + { java: ["java-kotlin", "kotlin"] }, [ "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + @@ -326,12 +325,11 @@ test("getWorkflowErrors() for workflow with language name and its alias", async ); }); -test("getWorkflowErrors() for workflow with two aliases same language", async (t) => { +test("getWorkflowErrors() produces an error for workflow with two aliases same language", async (t) => { await testLanguageAliases( t, ["java-kotlin", "kotlin"], - "java", - ["java-kotlin", "kotlin"], + { java: ["java-kotlin", "kotlin"] }, [ "CodeQL language 'java' is referenced by more than one entry in the 'language' matrix " + "parameter for job 'test'. This may result in duplicate alerts. Please edit the 'language' " + @@ -340,21 +338,26 @@ test("getWorkflowErrors() for workflow with two aliases same language", async (t ); }); -test("getWorkflowErrors() does not produce error if codeql doesn't support language aliases", async (t) => { +test("getWorkflowErrors() does not produce an error for workflow with two distinct languages", async (t) => { await testLanguageAliases( t, - ["java-kotlin", "kotlin"], - "java", - undefined, + ["java", "typescript"], + { + java: ["java-kotlin", "kotlin"], + javascript: ["javascript-typescript", "typescript"], + }, [], ); }); +test("getWorkflowErrors() does not produce an error if codeql doesn't support language aliases", async (t) => { + await testLanguageAliases(t, ["java-kotlin", "kotlin"], undefined, []); +}); + async function testLanguageAliases( t: ExecutionContext, matrixLanguages: string[], - languageName: string, - aliases: string[] | undefined, + aliases: { [languageName: string]: string[] } | undefined, expectedErrorMessages: string[], ) { process.env.GITHUB_JOB = "test"; @@ -363,9 +366,14 @@ async function testLanguageAliases( sinon.stub(codeql, "betterResolveLanguages").resolves({ aliases: aliases !== undefined - ? Object.assign( + ? // Remap from languageName -> aliases to alias -> languageName + Object.assign( {}, - ...aliases.map((alias) => ({ [alias]: languageName })), + ...Object.entries(aliases).flatMap(([language, languageAliases]) => + languageAliases.map((alias) => ({ + [alias]: language, + })), + ), ) : undefined, extractors: { From 0dfaf4ef65a1e83ead70c55c6bfef221731eda92 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Fri, 22 Sep 2023 19:13:56 +0100 Subject: [PATCH 4/4] Add a changelog note --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 03e926d72e..a01733bac2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ See the [releases page](https://github.com/github/codeql-action/releases) for th ## [UNRELEASED] -No user facing changes. +- Add a warning to help customers avoid inadvertently analyzing the same CodeQL language in multiple matrix jobs. [#1901](https://github.com/github/codeql-action/pull/1901) ## 2.21.8 - 19 Sep 2023