diff --git a/.github/workflows/cli.yml b/.github/workflows/runner.yml similarity index 69% rename from .github/workflows/cli.yml rename to .github/workflows/runner.yml index e8daba1910..30d546e4a6 100644 --- a/.github/workflows/cli.yml +++ b/.github/workflows/runner.yml @@ -1,4 +1,4 @@ -name: "CodeScanning CLI" +name: "CodeQL runner" on: [push, pull_request] @@ -9,15 +9,15 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Build CLI + - name: Build runner run: | - cd packaging + cd runner npm install - npm run build-cli + npm run build-runner - - name: Upload with CLI + - name: Upload with runner run: | - packaging/dist/code-scanning-cli-linux upload \ + runner/dist/codeql-runner-linux upload \ --sarif-file src/testdata/empty-sarif.sarif \ --repository $GITHUB_REPOSITORY \ --commit $GITHUB_SHA \ diff --git a/.gitignore b/.gitignore index a1f721507d..3c6742851f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -/packaging/dist/ -/packaging/node_modules/ +/runner/dist/ +/runner/node_modules/ diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index d9369969bd..b993ea08aa 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -49,9 +49,9 @@ Running locally will generate the CodeQL database and run all the queries, but i As well as the unit tests (see _Common tasks_ above), there are integration tests, defined in `.github/workflows/integration-testing.yml`. These are run by a CI check. Depending on the change you’re making, you may want to add a test to this file or extend an existing one. -### Building the CLI +### Building the CodeQL runner -Navigate to the `packaging` directory and run `npm install` to install dependencies needed only for compiling the CLI. Run `npm run build-cli` to output files to the `packaging/dist` directory. +Navigate to the `runner` directory and run `npm install` to install dependencies needed only for compiling the CodeQL runner. Run `npm run build-runner` to output files to the `runner/dist` directory. ## Submitting a pull request diff --git a/lib/cli.js.map b/lib/cli.js.map deleted file mode 100644 index 99a7d413d5..0000000000 --- a/lib/cli.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAAoC;A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,CAAC;KACtF,MAAM,CAAC,KAAK,EAAE,GAAe,EAAE,EAAE;IAChC,IAAI;QACF,MAAM,UAAU,CAAC,MAAM,CACrB,GAAG,CAAC,SAAS,EACb,+BAAkB,CAAC,GAAG,CAAC,UAAU,CAAC,EAClC,GAAG,CAAC,MAAM,EACV,GAAG,CAAC,GAAG,EACP,SAAS,EACT,SAAS,EACT,SAAS,EACT,GAAG,CAAC,YAAY,IAAI,OAAO,CAAC,GAAG,EAAE,EACjC,SAAS,EACT,GAAG,CAAC,UAAU,EACd,iBAAiB,CAAC,GAAG,CAAC,SAAS,CAAC,EAChC,KAAK,EACL,MAAM,CAAC,CAAC;KACX;IAAC,OAAO,CAAC,EAAE;QACV,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;QAC9B,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QAChB,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;KACtB;AACH,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/fingerprints.test.js b/lib/fingerprints.test.js index 11951a5122..88a81fe310 100644 --- a/lib/fingerprints.test.js +++ b/lib/fingerprints.test.js @@ -99,7 +99,7 @@ ava_1.default('hash', (t) => { function testResolveUriToFile(uri, index, artifactsURIs) { const location = { "uri": uri, "index": index }; const artifacts = artifactsURIs.map(uri => ({ "location": { "uri": uri } })); - return fingerprints.resolveUriToFile(location, artifacts, logging_1.getCLILogger()); + return fingerprints.resolveUriToFile(location, artifacts, logging_1.getRunnerLogger()); } ava_1.default('resolveUriToFile', t => { // The resolveUriToFile method checks that the file exists and is in the right directory @@ -144,7 +144,7 @@ ava_1.default('addFingerprints', t => { expected = JSON.stringify(JSON.parse(expected)); // The URIs in the SARIF files resolve to files in the testdata directory process.env['GITHUB_WORKSPACE'] = path.normalize(__dirname + '/../src/testdata'); - t.deepEqual(fingerprints.addFingerprints(input, logging_1.getCLILogger()), expected); + t.deepEqual(fingerprints.addFingerprints(input, logging_1.getRunnerLogger()), expected); }); ava_1.default('missingRegions', t => { // Run an end-to-end test on a test file @@ -155,6 +155,6 @@ ava_1.default('missingRegions', t => { expected = JSON.stringify(JSON.parse(expected)); // The URIs in the SARIF files resolve to files in the testdata directory process.env['GITHUB_WORKSPACE'] = path.normalize(__dirname + '/../src/testdata'); - t.deepEqual(fingerprints.addFingerprints(input, logging_1.getCLILogger()), expected); + t.deepEqual(fingerprints.addFingerprints(input, logging_1.getRunnerLogger()), expected); }); //# sourceMappingURL=fingerprints.test.js.map \ No newline at end of file diff --git a/lib/fingerprints.test.js.map b/lib/fingerprints.test.js.map index 09047973d7..bf6d72bc30 100644 --- a/lib/fingerprints.test.js.map +++ b/lib/fingerprints.test.js.map @@ -1 +1 @@ -{"version":3,"file":"fingerprints.test.js","sourceRoot":"","sources":["../src/fingerprints.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAuB;AAEvB,uCAAyB;AACzB,2CAA6B;AAE7B,6DAA+C;AAC/C,uCAAyC;AACzC,mDAA2C;AAE3C,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,SAAS,QAAQ,CAAC,CAAiB,EAAE,KAAa,EAAE,cAAwB;IAC1E,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,IAAI,QAAQ,GAAG,UAAU,UAAkB,EAAE,IAAY;QACvD,CAAC,CAAC,EAAE,CAAC,UAAU,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC;QAC5B,CAAC,CAAC,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC,CAAC,CAAC;QAClC,KAAK,EAAE,CAAC;IACV,CAAC,CAAC;IACF,YAAY,CAAC,IAAI,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACnC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAChD,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AgB,EAAE,CAAC,CAAC,EAAE;IACzB,wCAAwC;IACxC,IAAI,KAAK,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,GAAG,8CAA8C,CAAC,CAAC,QAAQ,EAAE,CAAC;IACnG,IAAI,QAAQ,GAAG,EAAE,CAAC,YAAY,CAAC,SAAS,GAAG,iDAAiD,CAAC,CAAC,QAAQ,EAAE,CAAC;IAEzG,mFAAmF;IACnF,KAAK,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;IAC1C,QAAQ,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;IAEhD,yEAAyE;IACzE,OAAO,CAAC,GAAG,CAAC,kBAAkB,CAAC,GAAG,IAAI,CAAC,SAAS,CAAC,SAAS,GAAG,kBAAkB,CAAC,CAAC;IAEjF,CAAC,CAAC,SAAS,CAAC,YAAY,CAAC,eAAe,CAAC,KAAK,EAAE,yBAAe,EAAE,CAAC,EAAE,QAAQ,CAAC,CAAC;AAChF,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/logging.js b/lib/logging.js index 579f51fcdf..8bbba26e16 100644 --- a/lib/logging.js +++ b/lib/logging.js @@ -12,7 +12,7 @@ function getActionsLogger() { return core; } exports.getActionsLogger = getActionsLogger; -function getCLILogger() { +function getRunnerLogger() { return { debug: console.debug, info: console.info, @@ -22,5 +22,5 @@ function getCLILogger() { endGroup: () => undefined, }; } -exports.getCLILogger = getCLILogger; +exports.getRunnerLogger = getRunnerLogger; //# sourceMappingURL=logging.js.map \ No newline at end of file diff --git a/lib/logging.js.map b/lib/logging.js.map index 1405035304..1bb7c6e412 100644 --- a/lib/logging.js.map +++ b/lib/logging.js.map @@ -1 +1 @@ -{"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAYtC,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAFD,4CAEC;AAED,SAAgB,YAAY;IAC1B,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;QAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;KAC1B,CAAC;AACJ,CAAC;AATD,oCASC"} \ No newline at end of file +{"version":3,"file":"logging.js","sourceRoot":"","sources":["../src/logging.ts"],"names":[],"mappings":";;;;;;;;;AAAA,oDAAsC;AAYtC,SAAgB,gBAAgB;IAC9B,OAAO,IAAI,CAAC;AACd,CAAC;AAFD,4CAEC;AAED,SAAgB,eAAe;IAC7B,OAAO;QACL,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,IAAI,EAAE,OAAO,CAAC,IAAI;QAClB,OAAO,EAAE,OAAO,CAAC,IAAI;QACrB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,UAAU,EAAE,GAAG,EAAE,CAAC,SAAS;QAC3B,QAAQ,EAAE,GAAG,EAAE,CAAC,SAAS;KAC1B,CAAC;AACJ,CAAC;AATD,0CASC"} \ No newline at end of file diff --git a/lib/cli.js b/lib/runner.js similarity index 94% rename from lib/cli.js rename to lib/runner.js index 6f35def908..c2bb2b19e7 100644 --- a/lib/cli.js +++ b/lib/runner.js @@ -32,7 +32,7 @@ function parseGithubApiUrl(inputUrl) { throw new Error(`"${inputUrl}" is not a valid URL`); } } -const logger = logging_1.getCLILogger(); +const logger = logging_1.getRunnerLogger(); program .command('upload') .description('Uploads a SARIF file, or all SARIF files from a directory, to code scanning') @@ -45,7 +45,7 @@ program .option('--checkout-path ', 'Checkout path (default: current working directory)') .action(async (cmd) => { try { - await upload_lib.upload(cmd.sarifFile, repository_1.parseRepositoryNwo(cmd.repository), cmd.commit, cmd.ref, undefined, undefined, undefined, cmd.checkoutPath || process.cwd(), undefined, cmd.githubAuth, parseGithubApiUrl(cmd.githubUrl), 'cli', logger); + await upload_lib.upload(cmd.sarifFile, repository_1.parseRepositoryNwo(cmd.repository), cmd.commit, cmd.ref, undefined, undefined, undefined, cmd.checkoutPath || process.cwd(), undefined, cmd.githubAuth, parseGithubApiUrl(cmd.githubUrl), 'runner', logger); } catch (e) { logger.error('Upload failed'); @@ -54,4 +54,4 @@ program } }); program.parse(process.argv); -//# sourceMappingURL=cli.js.map \ No newline at end of file +//# sourceMappingURL=runner.js.map \ No newline at end of file diff --git a/lib/runner.js.map b/lib/runner.js.map new file mode 100644 index 0000000000..43dbc3b372 --- /dev/null +++ b/lib/runner.js.map @@ -0,0 +1 @@ +{"version":3,"file":"runner.js","sourceRoot":"","sources":["../src/runner.ts"],"names":[],"mappings":";;;;;;;;;AAAA,yCAAoC;AACpC,2CAA6B;AAE7B,uCAA4C;AAC5C,6CAAkD;AAClD,yDAA2C;AAE3C,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAC9B,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAYzB,SAAS,iBAAiB,CAAC,QAAgB;IACzC,IAAI;QACF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;QAE9B,kDAAkD;QAClD,0CAA0C;QAC1C,IAAI,GAAG,CAAC,QAAQ,KAAK,YAAY,IAAI,GAAG,CAAC,QAAQ,KAAK,gBAAgB,EAAE;YACtE,OAAO,wBAAwB,CAAC;SACjC;QAED,gDAAgD;QAChD,IAAI,GAAG,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE;YAC1C,GAAG,CAAC,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC;SACrD;QAED,OAAO,GAAG,CAAC,QAAQ,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AC"} \ No newline at end of file diff --git a/lib/upload-lib.js b/lib/upload-lib.js index 5798aa004d..3252f3a4b1 100644 --- a/lib/upload-lib.js +++ b/lib/upload-lib.js @@ -154,7 +154,7 @@ exports.validateSarifFileSchema = validateSarifFileSchema; async function uploadFiles(sarifFiles, repositoryNwo, commitOid, ref, analysisKey, analysisName, workflowRunID, checkoutPath, environment, githubAuth, githubApiUrl, mode, logger) { logger.info("Uploading sarif files: " + JSON.stringify(sarifFiles)); if (mode === 'actions') { - // This check only works on actions as env vars don't persist between calls to the CLI + // This check only works on actions as env vars don't persist between calls to the runner const sentinelEnvVar = "CODEQL_UPLOAD_SARIF"; 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"); diff --git a/lib/upload-lib.js.map b/lib/upload-lib.js.map index 43c7378e37..fbd4398446 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,oDAAsC;AACtC,wDAA+B;AAC/B,uCAAyB;AACzB,uDAAyC;AACzC,2CAA6B;AAC7B,gDAAwB;AAExB,kDAAoC;AACpC,6DAA+C;AAG/C,gEAAkD;AAClD,6CAA+B;AAI/B,mEAAmE;AACnE,qDAAqD;AACrD,SAAgB,iBAAiB,CAAC,UAAoB;IACpD,IAAI,aAAa,GAAG;QAClB,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,EAAW;KAClB,CAAC;IAEF,KAAK,IAAI,SAAS,IAAI,UAAU,EAAE;QAChC,IAAI,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;QACjE,sBAAsB;QACtB,IAAI,aAAa,CAAC,OAAO,KAAK,IAAI,EAAE;YAClC,aAAa,CAAC,OAAO,GAAG,WAAW,CAAC,OAA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wB,EAAE,qBAAqB;QAC/C,oBAAoB,EAAE,gBAAgB;KACvC,CAAC;AACJ,CAAC"} \ No newline at end of file +{"version":3,"file":"upload-lib.js","sourceRoot":"","sources":["../src/upload-lib.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,oDAAsC;AACtC,wDAA+B;AAC/B,uCAAyB;AACzB,uDAAyC;AACzC,2CAA6B;AAC7B,gDAAwB;AAExB,kDAAoC;AACpC,6DAA+C;AAG/C,gEAAkD;AAClD,6CAA+B;AAI/B,mEAAmE;AACnE,qDAAqD;AACrD,SAAgB,iBAAiB,CAAC,UAAoB;IACpD,IAAI,aAAa,GAAG;QAClB,OAAO,EAAE,IAAI;QACb,IAAI,EAAE,EAAW;KAClB,CAAC;IAEF,KAAK,IAAI,SAAS,IAAI,UAAU,EAAE;QAChC,IAAI,WAAW,GAAG,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC,CAAC;QACjE,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,wCAAwC,GAAG,aAAa,CAAC,OAAO,GAAG,OAAO,GAAG,WAAW,CAAC,OAAO,CAAC;SACxG;QAED,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;KAC9C;IAED,OAAO,IAAI,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;AACvC,CAAC;AAnBD,8CAmBC;AAED,4BAA4B;AAC5B,qEAAqE;AACrE,KAAK,UAAU,aAAa,CAC1B,OAAY,EACZ,aAA4B,EAC5B,UAAkB,EAClB,YAAoB,EACpB,IAAgB,EAChB,MAAc;IAEd,MAAM,CAAC,IAAI,CAAC,mBAAmB,CAAC,CA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AAE,SAAS;YACvB,KAAK,EAAE,GAAG;YACV,OAAO,EAAE,YAAY;YACrB,cAAc,EAAE,WAAW;YAC3B,WAAW,EAAE,SAAS,CAAC,CAAC,CAAC;SAC1B,CAAC,CAAC;KACJ;IAED,4CAA4C;IAC5C,MAAM,kBAAkB,GAAG,YAAY,CAAC,MAAM,CAAC;IAC/C,MAAM,CAAC,KAAK,CAAC,mBAAmB,GAAG,kBAAkB,GAAG,QAAQ,CAAC,CAAC;IAClE,MAAM,qBAAqB,GAAG,YAAY,CAAC,MAAM,CAAC;IAClD,MAAM,CAAC,KAAK,CAAC,6BAA6B,GAAG,qBAAqB,GAAG,QAAQ,CAAC,CAAC;IAC/E,MAAM,gBAAgB,GAAG,mBAAmB,CAAC,YAAY,CAAC,CAAC;IAC3D,MAAM,CAAC,KAAK,CAAC,+BAA+B,GAAG,gBAAgB,CAAC,CAAC;IAEjE,kBAAkB;IAClB,MAAM,aAAa,CAAC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,CAAC,CAAC;IAEpF,OAAO;QACL,qBAAqB,EAAE,kBAAkB;QACzC,wBAAwB,EAAE,qBAAqB;QAC/C,oBAAoB,EAAE,gBAAgB;KACvC,CAAC;AACJ,CAAC"} \ No newline at end of file diff --git a/lib/upload-lib.test.js b/lib/upload-lib.test.js index cb480c830e..95bff48e5b 100644 --- a/lib/upload-lib.test.js +++ b/lib/upload-lib.test.js @@ -17,10 +17,10 @@ const uploadLib = __importStar(require("./upload-lib")); testing_utils_1.setupTests(ava_1.default); ava_1.default('validateSarifFileSchema - valid', t => { const inputFile = __dirname + '/../src/testdata/valid-sarif.sarif'; - t.notThrows(() => uploadLib.validateSarifFileSchema(inputFile, logging_1.getCLILogger())); + t.notThrows(() => uploadLib.validateSarifFileSchema(inputFile, logging_1.getRunnerLogger())); }); ava_1.default('validateSarifFileSchema - invalid', t => { const inputFile = __dirname + '/../src/testdata/invalid-sarif.sarif'; - t.throws(() => uploadLib.validateSarifFileSchema(inputFile, logging_1.getCLILogger())); + t.throws(() => uploadLib.validateSarifFileSchema(inputFile, logging_1.getRunnerLogger())); }); //# sourceMappingURL=upload-lib.test.js.map \ No newline at end of file diff --git a/lib/upload-lib.test.js.map b/lib/upload-lib.test.js.map index 35c0af6251..f799cf9045 100644 --- a/lib/upload-lib.test.js.map +++ b/lib/upload-lib.test.js.map @@ -1 +1 @@ -{"version":3,"file":"upload-lib.test.js","sourceRoot":"","sources":["../src/upload-lib.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAuB;AAEvB,uCAAyC;AACzC,mDAA2C;AAC3C,wDAA0C;AAE1C,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,iCAAiC,EAAE,CAAC,CAAC,EAAE;IAC1C,MAAM,SAAS,GAAG,SAAS,GAAG,oCAAoC,CAAC;IACnE,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,uBAAuB,CAAC,SAAS,EAAE,sBAAY,EAAE,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC,CAAC;AAEH,aAAI,CAAC,mCAAmC,EAAE,CAAC,CAAC,EAAE;IAC5C,MAAM,SAAS,GAAG,SAAS,GAAG,sCAAsC,CAAC;IACrE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,uBAAuB,CAAC,SAAS,EAAE,sBAAY,EAAE,CAAC,CAAC,CAAC;AAC/E,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"upload-lib.test.js","sourceRoot":"","sources":["../src/upload-lib.test.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,8CAAuB;AAEvB,uCAA4C;AAC5C,mDAA2C;AAC3C,wDAA0C;AAE1C,0BAAU,CAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,iCAAiC,EAAE,CAAC,CAAC,EAAE;IAC1C,MAAM,SAAS,GAAG,SAAS,GAAG,oCAAoC,CAAC;IACnE,CAAC,CAAC,SAAS,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,uBAAuB,CAAC,SAAS,EAAE,yBAAe,EAAE,CAAC,CAAC,CAAC;AACrF,CAAC,CAAC,CAAC;AAEH,aAAI,CAAC,mCAAmC,EAAE,CAAC,CAAC,EAAE;IAC5C,MAAM,SAAS,GAAG,SAAS,GAAG,sCAAsC,CAAC;IACrE,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,uBAAuB,CAAC,SAAS,EAAE,yBAAe,EAAE,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/queries/unguarded-action-lib.ql b/queries/unguarded-action-lib.ql index c7c8722142..f35fb6a2c2 100644 --- a/queries/unguarded-action-lib.ql +++ b/queries/unguarded-action-lib.ql @@ -27,21 +27,21 @@ class ActionsLibImport extends ImportDeclaration { } /** - * An entrypoint to the CLI. + * An entrypoint to the CodeQL runner. */ -class ClIEntrypoint extends Function { - ClIEntrypoint() { - getFile().getAbsolutePath().matches("%/cli.ts") +class RunnerEntrypoint extends Function { + RunnerEntrypoint() { + getFile().getAbsolutePath().matches("%/runner.ts") } } /** - * A check of whether we are in actions mode or CLI mode. + * A check of whether we are in actions mode or runner mode. */ class ModeGuard extends IfStmt { ModeGuard() { getCondition().(EqualityTest).getAnOperand().(StringLiteral).getValue() = "actions" or - getCondition().(EqualityTest).getAnOperand().(StringLiteral).getValue() = "cli" + getCondition().(EqualityTest).getAnOperand().(StringLiteral).getValue() = "runner" } string getOperand() { @@ -58,11 +58,11 @@ class ModeGuard extends IfStmt { Stmt getActionsBlock() { (getOperand() = "actions" and isPositive() and result = getThen()) or - (getOperand() = "cli" and not isPositive() and result = getThen()) + (getOperand() = "runner" and not isPositive() and result = getThen()) or (getOperand() = "actions" and not isPositive() and result = getElse()) or - (getOperand() = "cli" and isPositive() and result = getElse()) + (getOperand() = "runner" and isPositive() and result = getElse()) } /** @@ -99,10 +99,10 @@ Function calledBy(Function f) { not exists(ModeGuard guard | guard.getAnActionsExpr() = result)) } -from VarAccess v, ActionsLibImport actionsLib, ClIEntrypoint cliEntry +from VarAccess v, ActionsLibImport actionsLib, RunnerEntrypoint runnerEntry where actionsLib.getAProvidedVariable() = v.getVariable() - and getAFunctionChildExpr(calledBy*(cliEntry)) = v + and getAFunctionChildExpr(calledBy*(runnerEntry)) = v select v, "$@ is imported from $@ and this code can be called from $@", v, v.getName(), actionsLib, actionsLib.getName(), - cliEntry, "the CLI" + runnerEntry, "the runner" diff --git a/packaging/package-lock.json b/runner/package-lock.json similarity index 99% rename from packaging/package-lock.json rename to runner/package-lock.json index 052a330579..845267aad3 100644 --- a/packaging/package-lock.json +++ b/runner/package-lock.json @@ -1,5 +1,5 @@ { - "name": "codeql-packaging", + "name": "codeql-runner", "version": "0.0.0", "lockfileVersion": 1, "requires": true, diff --git a/packaging/package.json b/runner/package.json similarity index 57% rename from packaging/package.json rename to runner/package.json index 40adfd4dcf..66aee50baf 100644 --- a/packaging/package.json +++ b/runner/package.json @@ -1,10 +1,10 @@ { - "name": "codeql-packaging", + "name": "codeql-runner", "version": "0.0.0", "private": true, - "description": "CodeQL action - CLI packaging", + "description": "CodeQL runner", "scripts": { - "build-cli": "webpack --mode production && pkg dist/code-scanning-cli.js --out-path dist" + "build-runner": "webpack --mode production && pkg dist/codeql-runner.js --out-path dist" }, "license": "MIT", "dependencies": {}, diff --git a/packaging/webpack.config.js b/runner/webpack.config.js similarity index 84% rename from packaging/webpack.config.js rename to runner/webpack.config.js index 8f68b2087d..9513e11850 100644 --- a/packaging/webpack.config.js +++ b/runner/webpack.config.js @@ -1,7 +1,7 @@ const path = require('path'); module.exports = { - entry: '../src/cli.ts', + entry: '../src/runner.ts', module: { rules: [ { @@ -16,7 +16,7 @@ module.exports = { extensions: [ '.ts', '.js' ], }, output: { - filename: 'code-scanning-cli.js', + filename: 'codeql-runner.js', path: path.resolve(__dirname, 'dist'), }, optimization: { diff --git a/src/fingerprints.test.ts b/src/fingerprints.test.ts index 9ffd94cc54..a9eb96e581 100644 --- a/src/fingerprints.test.ts +++ b/src/fingerprints.test.ts @@ -4,7 +4,7 @@ import * as fs from 'fs'; import * as path from 'path'; import * as fingerprints from './fingerprints'; -import { getCLILogger } from './logging'; +import { getRunnerLogger } from './logging'; import {setupTests} from './testing-utils'; setupTests(test); @@ -116,7 +116,7 @@ test('hash', (t: ava.Assertions) => { function testResolveUriToFile(uri: any, index: any, artifactsURIs: any[]) { const location = { "uri": uri, "index": index }; const artifacts = artifactsURIs.map(uri => ({ "location": { "uri": uri } })); - return fingerprints.resolveUriToFile(location, artifacts, getCLILogger()); + return fingerprints.resolveUriToFile(location, artifacts, getRunnerLogger()); } test('resolveUriToFile', t => { @@ -175,7 +175,7 @@ test('addFingerprints', t => { // The URIs in the SARIF files resolve to files in the testdata directory process.env['GITHUB_WORKSPACE'] = path.normalize(__dirname + '/../src/testdata'); - t.deepEqual(fingerprints.addFingerprints(input, getCLILogger()), expected); + t.deepEqual(fingerprints.addFingerprints(input, getRunnerLogger()), expected); }); test('missingRegions', t => { @@ -190,5 +190,5 @@ test('missingRegions', t => { // The URIs in the SARIF files resolve to files in the testdata directory process.env['GITHUB_WORKSPACE'] = path.normalize(__dirname + '/../src/testdata'); - t.deepEqual(fingerprints.addFingerprints(input, getCLILogger()), expected); + t.deepEqual(fingerprints.addFingerprints(input, getRunnerLogger()), expected); }); diff --git a/src/logging.ts b/src/logging.ts index fb74b93bf5..fe93dfd45e 100644 --- a/src/logging.ts +++ b/src/logging.ts @@ -14,7 +14,7 @@ export function getActionsLogger(): Logger { return core; } -export function getCLILogger(): Logger { +export function getRunnerLogger(): Logger { return { debug: console.debug, info: console.info, diff --git a/src/cli.ts b/src/runner.ts similarity index 95% rename from src/cli.ts rename to src/runner.ts index 0af429d21f..736f693cc4 100644 --- a/src/cli.ts +++ b/src/runner.ts @@ -1,7 +1,7 @@ import { Command } from 'commander'; import * as path from 'path'; -import { getCLILogger } from './logging'; +import { getRunnerLogger } from './logging'; import { parseRepositoryNwo } from './repository'; import * as upload_lib from './upload-lib'; @@ -40,7 +40,7 @@ function parseGithubApiUrl(inputUrl: string): string { } } -const logger = getCLILogger(); +const logger = getRunnerLogger(); program .command('upload') @@ -66,7 +66,7 @@ program undefined, cmd.githubAuth, parseGithubApiUrl(cmd.githubUrl), - 'cli', + 'runner', logger); } catch (e) { logger.error('Upload failed'); diff --git a/src/upload-lib.test.ts b/src/upload-lib.test.ts index 9f1ebed072..36bbd31d3e 100644 --- a/src/upload-lib.test.ts +++ b/src/upload-lib.test.ts @@ -1,6 +1,6 @@ import test from 'ava'; -import { getCLILogger } from './logging'; +import { getRunnerLogger } from './logging'; import {setupTests} from './testing-utils'; import * as uploadLib from './upload-lib'; @@ -8,10 +8,10 @@ setupTests(test); test('validateSarifFileSchema - valid', t => { const inputFile = __dirname + '/../src/testdata/valid-sarif.sarif'; - t.notThrows(() => uploadLib.validateSarifFileSchema(inputFile, getCLILogger())); + t.notThrows(() => uploadLib.validateSarifFileSchema(inputFile, getRunnerLogger())); }); test('validateSarifFileSchema - invalid', t => { const inputFile = __dirname + '/../src/testdata/invalid-sarif.sarif'; - t.throws(() => uploadLib.validateSarifFileSchema(inputFile, getCLILogger())); + t.throws(() => uploadLib.validateSarifFileSchema(inputFile, getRunnerLogger())); }); diff --git a/src/upload-lib.ts b/src/upload-lib.ts index 2455b934d8..f74dfc40b1 100644 --- a/src/upload-lib.ts +++ b/src/upload-lib.ts @@ -12,7 +12,7 @@ import { RepositoryNwo } from './repository'; import * as sharedEnv from './shared-environment'; import * as util from './util'; -type UploadMode = 'actions' | 'cli'; +type UploadMode = 'actions' | 'runner'; // Takes a list of paths to sarif files and combines them together, // returning the contents of the combined sarif file. @@ -221,7 +221,7 @@ async function uploadFiles( logger.info("Uploading sarif files: " + JSON.stringify(sarifFiles)); if (mode === 'actions') { - // This check only works on actions as env vars don't persist between calls to the CLI + // This check only works on actions as env vars don't persist between calls to the runner const sentinelEnvVar = "CODEQL_UPLOAD_SARIF"; 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");