From 1354fe53557580e3ef88d0c51eb4357a26b937f4 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Tue, 11 Jun 2024 20:36:53 +0100 Subject: [PATCH 1/6] Attempt to clean up the database cluster directory This will help to avoid issues where the database cluster directory is left in an inconsistent state. --- CHANGELOG.md | 1 + lib/actions-util.js | 6 ++- lib/actions-util.js.map | 2 +- lib/init-action.js | 1 + lib/init-action.js.map | 2 +- lib/init.js | 39 ++++++++++++++- lib/init.js.map | 2 +- lib/init.test.js | 79 ++++++++++++++++++++++++++++++ lib/init.test.js.map | 2 +- src/actions-util.ts | 4 ++ src/init-action.ts | 3 ++ src/init.test.ts | 104 +++++++++++++++++++++++++++++++++++++++- src/init.ts | 51 ++++++++++++++++++++ 13 files changed, 288 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b865fcd2f..5288ff40bf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the ## [UNRELEASED] - Avoid failing database creation if the database folder already exists and contains some unexpected files. [#2330](https://github.com/github/codeql-action/pull/2330) +- The init Action will attempt to clean up the database cluster directory before creating a new database. This will help to avoid issues where the database cluster directory is left in an inconsistent state. [#2332](https://github.com/github/codeql-action/pull/2332) ## 3.25.8 - 04 Jun 2024 diff --git a/lib/actions-util.js b/lib/actions-util.js index 43a725278b..df1a130727 100644 --- a/lib/actions-util.js +++ b/lib/actions-util.js @@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.getFileType = exports.FileCmdNotFoundError = exports.getWorkflowRunAttempt = exports.getWorkflowRunID = exports.getUploadValue = exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getWorkflowEvent = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.getWorkflowEventName = exports.getActionVersion = exports.getRef = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0; +exports.isSelfHostedRunner = exports.getFileType = exports.FileCmdNotFoundError = exports.getWorkflowRunAttempt = exports.getWorkflowRunID = exports.getUploadValue = exports.printDebugLogs = exports.isAnalyzingDefaultBranch = exports.getWorkflowEvent = exports.getRelativeScriptPath = exports.isRunningLocalAction = exports.getWorkflowEventName = exports.getActionVersion = exports.getRef = exports.determineMergeBaseCommitOid = exports.getCommitOid = exports.getTemporaryDirectory = exports.getOptionalInput = exports.getRequiredInput = void 0; const fs = __importStar(require("fs")); const path = __importStar(require("path")); const core = __importStar(require("@actions/core")); @@ -425,4 +425,8 @@ const getFileType = async (filePath) => { } }; exports.getFileType = getFileType; +function isSelfHostedRunner() { + return process.env.RUNNER_ENVIRONMENT === "self-hosted"; +} +exports.isSelfHostedRunner = isSelfHostedRunner; //# sourceMappingURL=actions-util.js.map \ No newline at end of file diff --git a/lib/actions-util.js.map b/lib/actions-util.js.map index b51e1f2786..f193a5b381 100644 --- a/lib/actions-util.js.map +++ b/lib/actions-util.js.map @@ -1 +1 @@ -{"version":3,"file":"actions-util.js","sourceRoot":"","sources":["../src/actions-util.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,yEAA2D;AAC3D,kEAAoD;AAIpD,iCAKgB;AAEhB,8CAA8C;AAC9C,MAAM,GAAG,GAAG,OAAO,CAAC,iBAAiB,CAAqC,CAAC;AAE3E;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,UAAU,IAAY;IACpD,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,MAAM,IAAI,yBAAkB,CAAC,oCAAoC,IAAI,EAAE,CAAC,CAAC;IAC3E,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC,CAAC;AANW,QAAA,gBAAgB,oBA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SACF,CAAC,CAAC,IAAI,EAAE,CAAC;QACV,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAAC,OAAO,CAAC,EAAE,CAAC;QACX,IAAI,CAAC,IAAI,CACP,+BAA+B,QAAQ,SAAS,MAAM,KAAK,MAAM,EAAE,CACpE,CAAC;QAEF,MAAM,CAAC,CAAC;IACV,CAAC;AACH,CAAC,CAAC;AArCW,QAAA,WAAW,eAqCtB;AAEF,SAAgB,kBAAkB;IAChC,OAAO,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,aAAa,CAAC;AAC1D,CAAC;AAFD,gDAEC"} \ No newline at end of file diff --git a/lib/init-action.js b/lib/init-action.js index 8396512244..2f984b76d9 100644 --- a/lib/init-action.js +++ b/lib/init-action.js @@ -181,6 +181,7 @@ async function run() { return; } try { + (0, init_1.cleanupDatabaseClusterDirectory)(config, logger); // Forward Go flags const goFlags = process.env["GOFLAGS"]; if (goFlags) { diff --git a/lib/init-action.js.map b/lib/init-action.js.map index 5f73fffffd..a9f3548c27 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,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,uDAAmD;AACnD,+BAAoC;AAEpC,iDAOwB;AACxB,6CAAgD;AAGhD,+CAKuB;AACvB,+CAAuC;AACvC,mDAAoD;AACpD,iCAMgB;AAChB,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,iDAA6C;AAC7C,mDAMyB;AACzB,qDAAgD;AAChD,iDAAmD;AACnD,iCAegB;AAChB,yCAA8C;AA0C9C,KAAK,UAAU,yBAAyB,CACtC,SAAe,EACf,MAAsC,EACtC,uBAA2C,EAC3C,sBAA2C,EAC3C,WAAwB,EACxB,YAAoB,EACpB,MAAc,EACd,KAAa;IAEb,MAA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C;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;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,uCAAyB;AACzB,2CAA6B;AAE7B,oDAAsC;AACtC,uDAAmD;AACnD,+BAAoC;AAEpC,iDAOwB;AACxB,6CAAgD;AAGhD,+CAKuB;AACvB,+CAAuC;AACvC,mDAAoD;AACpD,iCAOgB;AAChB,2CAAuC;AACvC,uCAAqD;AACrD,6CAAkD;AAClD,iDAA6C;AAC7C,mDAMyB;AACzB,qDAAgD;AAChD,iDAAmD;AACnD,iCAegB;AAChB,yCAA8C;AA0C9C,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,0BAAU,CAAC,IAAI,EACf,IAAA,gCAAgB,EAAC,KAAK,CAAC,EACvB,SAAS,EACT,MAAM,EACN,MAAM,IAAA,qBAAc,EAAC,MAAM,CAAC,EAC5B,MAAM,EACN,KAAK,EAAE,OAAO,EACd,KAAK,EAAE,KAAK,CACb,CAAC;IAEF,IAAI,gBAAgB,KAAK,SAAS,EAAE,CAAC;QACnC,OAAO;IACT,CAAC;IAED,MAAM,iBAAiB,GAAG,IAAA,+BAAgB,EAAC,WAAW,CAAC,CAAC;IAExD,MAAM,gBAAgB,GAAqB;QACzC,GAAG,gBAAgB;QACnB,WAAW,EAAE,IAAA,+BAAgB,EAAC,OAAO,CA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AE,CAAC;QACxB,MAAM,KAAK,GAAG,IAAA,gBAAS,EAAC,cAAc,CAAC,CAAC;QACxC,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;QAC9B,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,EACN,KAAK,CACN,CAAC;QACF,OAAO;IACT,CAAC;YAAS,CAAC;QACT,IAAA,qCAAuB,GAAE,CAAC;IAC5B,CAAC;IACD,MAAM,yBAAyB,CAC7B,SAAS,EACT,MAAM,EACN,uBAAuB,EACvB,sBAAsB,EACtB,WAAW,EACX,YAAY,EACZ,MAAM,CACP,CAAC;AACJ,CAAC;AAED,SAAS,qBAAqB;IAC5B,0DAA0D;IAC1D,MAAM,WAAW,GAAG,IAAA,+BAAgB,EAAC,cAAc,CAAC,CAAC;IACrD,IAAI,WAAW,KAAK,SAAS;QAAE,OAAO,WAAW,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,CAAC;QACH,MAAM,GAAG,EAAE,CAAC;IACd,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,CAAC,SAAS,CAAC,uBAAuB,IAAA,gBAAS,EAAC,KAAK,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IACD,MAAM,IAAA,sBAAe,GAAE,CAAC;AAC1B,CAAC;AAED,KAAK,UAAU,EAAE,CAAC"} \ No newline at end of file diff --git a/lib/init.js b/lib/init.js index 351af33e30..811bc41a5b 100644 --- a/lib/init.js +++ b/lib/init.js @@ -23,17 +23,19 @@ var __importStar = (this && this.__importStar) || function (mod) { return result; }; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isSipEnabled = exports.checkInstallPython311 = exports.printPathFiltersWarning = exports.runInit = exports.initConfig = exports.initCodeQL = void 0; +exports.cleanupDatabaseClusterDirectory = exports.isSipEnabled = exports.checkInstallPython311 = exports.printPathFiltersWarning = exports.runInit = exports.initConfig = exports.initCodeQL = void 0; const fs = __importStar(require("fs")); const path = __importStar(require("path")); const exec = __importStar(require("@actions/exec/lib/exec")); const toolrunner = __importStar(require("@actions/exec/lib/toolrunner")); const safeWhich = __importStar(require("@chrisgavin/safe-which")); +const actions_util_1 = require("./actions-util"); const codeql_1 = require("./codeql"); const configUtils = __importStar(require("./config-utils")); const languages_1 = require("./languages"); const tools_features_1 = require("./tools-features"); const tracer_config_1 = require("./tracer-config"); +const util = __importStar(require("./util")); async function initCodeQL(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger) { logger.startGroup("Setup CodeQL tools"); const { codeql, toolsDownloadDurationMs, toolsSource, toolsVersion } = await (0, codeql_1.setupCodeQL)(toolsInput, apiDetails, tempDir, variant, defaultCliVersion, logger, true); @@ -111,4 +113,39 @@ async function isSipEnabled(logger) { } } exports.isSipEnabled = isSipEnabled; +function cleanupDatabaseClusterDirectory(config, logger, +// We can't stub the fs module in tests, so we allow the caller to override the rmSync function +// for testing. +rmSync = fs.rmSync) { + if (fs.existsSync(config.dbLocation) && + (fs.statSync(config.dbLocation).isFile() || + fs.readdirSync(config.dbLocation).length)) { + logger.warning(`The database cluster directory ${config.dbLocation} must be empty. Attempting to clean it up.`); + try { + rmSync(config.dbLocation, { + force: true, + maxRetries: 3, + recursive: true, + }); + logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`); + } + catch (e) { + const blurb = `The CodeQL Action requires an empty database cluster directory. ${(0, actions_util_1.getOptionalInput)("db-location") + ? `This is currently configured to be ${config.dbLocation}. ` + : `By default, this is located at ${config.dbLocation}. ` + + "You can customize it using the 'db-location' input to the init Action. "}An attempt was made to clean up the directory, but this failed.`; + // Hosted runners are automatically cleaned up, so this error should not occur for hosted runners. + if ((0, actions_util_1.isSelfHostedRunner)()) { + throw new util.ConfigurationError(`${blurb} This can happen if another process is using the directory or the directory is owned by a different user. ` + + "Please clean up the directory manually and rerun the job."); + } + else { + throw new Error(`${blurb} This shouldn't typically happen on hosted runners. ` + + "If you are using an advanced setup, please check your workflow, otherwise we " + + "recommend rerunning the job."); + } + } + } +} +exports.cleanupDatabaseClusterDirectory = cleanupDatabaseClusterDirectory; //# sourceMappingURL=init.js.map \ No newline at end of file diff --git a/lib/init.js.map b/lib/init.js.map index 898ee9ebbe..4bf41f1c42 100644 --- a/lib/init.js.map +++ b/lib/init.js.map @@ -1 +1 @@ -{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,6DAA+C;AAC/C,yEAA2D;AAC3D,kEAAoD;AAGpD,qCAA+C;AAC/C,4DAA8C;AAE9C,2CAA0D;AAG1D,qDAAgD;AAChD,mDAAwE;AAGjE,KAAK,UAAU,UAAU,CAC9B,UAA8B,EAC9B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,iBAA2C,EAC3C,MAAc;IAOd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,GAClE,MAAM,IAAA,oBAAW,EACf,UAAU,EACV,UAAU,EACV,OAAO,EACP,OAAO,EACP,iBAAiB,EACjB,MAAM,EACN,IAAI,CACL,CAAC;IACJ,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,CAAC;AACxE,CAAC;AA3BD,gCA2BC;AAEM,KAAK,UAAU,UAAU,CAC9B,MAAoC,EACpC,MAAc;IAEd,MAAM,MAAM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} \ No newline at end of file diff --git a/lib/init.test.js b/lib/init.test.js index 283e1c4b61..02a751ac38 100644 --- a/lib/init.test.js +++ b/lib/init.test.js @@ -1,12 +1,38 @@ "use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { + Object.defineProperty(o, "default", { enumerable: true, value: v }); +}) : function(o, v) { + o["default"] = v; +}); +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); + __setModuleDefault(result, mod); + return result; +}; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); +const fs = __importStar(require("fs")); +const path_1 = __importDefault(require("path")); const ava_1 = __importDefault(require("ava")); const init_1 = require("./init"); const languages_1 = require("./languages"); const testing_utils_1 = require("./testing-utils"); +const util_1 = require("./util"); (0, testing_utils_1.setupTests)(ava_1.default); (0, ava_1.default)("printPathFiltersWarning does not trigger when 'paths' and 'paths-ignore' are undefined", async (t) => { const messages = []; @@ -24,4 +50,57 @@ const testing_utils_1 = require("./testing-utils"); }, (0, testing_utils_1.getRecordingLogger)(messages)); t.is(messages.length, 0); }); +(0, ava_1.default)("cleanupDatabaseClusterDirectory cleans up where possible", async (t) => { + await (0, util_1.withTmpDir)(async (tmpDir) => { + const dbLocation = path_1.default.resolve(tmpDir, "dbs"); + fs.mkdirSync(dbLocation, { recursive: true }); + const fileToCleanUp = path_1.default.resolve(dbLocation, "something-to-cleanup.txt"); + fs.writeFileSync(fileToCleanUp, ""); + const messages = []; + (0, init_1.cleanupDatabaseClusterDirectory)((0, testing_utils_1.createTestConfig)({ dbLocation }), (0, testing_utils_1.getRecordingLogger)(messages)); + t.is(messages.length, 2); + t.is(messages[0].type, "warning"); + t.is(messages[0].message, `The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`); + t.is(messages[1].type, "info"); + t.is(messages[1].message, `Cleaned up database cluster directory ${dbLocation}.`); + t.false(fs.existsSync(fileToCleanUp)); + }); +}); +for (const { runnerEnv, ErrorConstructor, message } of [ + { + runnerEnv: "self-hosted", + ErrorConstructor: util_1.ConfigurationError, + message: (dbLocation) => "The CodeQL Action requires an empty database cluster directory. By default, this is located " + + `at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` + + "attempt was made to clean up the directory, but this failed. This can happen if another " + + "process is using the directory or the directory is owned by a different user. Please clean " + + "up the directory manually and rerun the job.", + }, + { + runnerEnv: "github-hosted", + ErrorConstructor: Error, + message: (dbLocation) => "The CodeQL Action requires an empty database cluster directory. By default, this is located " + + `at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` + + "attempt was made to clean up the directory, but this failed. This shouldn't typically " + + "happen on hosted runners. If you are using an advanced setup, please check your workflow, " + + "otherwise we recommend rerunning the job.", + }, +]) { + (0, ava_1.default)(`cleanupDatabaseClusterDirectory throws a ${ErrorConstructor.name} when cleanup fails on ${runnerEnv} runner`, async (t) => { + await (0, util_1.withTmpDir)(async (tmpDir) => { + process.env["RUNNER_ENVIRONMENT"] = runnerEnv; + const dbLocation = path_1.default.resolve(tmpDir, "dbs"); + fs.mkdirSync(dbLocation, { recursive: true }); + const fileToCleanUp = path_1.default.resolve(dbLocation, "something-to-cleanup.txt"); + fs.writeFileSync(fileToCleanUp, ""); + const messages = []; + t.throws(() => (0, init_1.cleanupDatabaseClusterDirectory)((0, testing_utils_1.createTestConfig)({ dbLocation }), (0, testing_utils_1.getRecordingLogger)(messages), () => { + throw new Error("Failed to clean up"); + }), { instanceOf: ErrorConstructor, message: message(dbLocation) }); + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is(messages[0].message, `The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`); + }); + }); +} //# sourceMappingURL=init.test.js.map \ No newline at end of file diff --git a/lib/init.test.js.map b/lib/init.test.js.map index 271fa9d90b..90ec3efff0 100644 --- a/lib/init.test.js.map +++ b/lib/init.test.js.map @@ -1 +1 @@ -{"version":3,"file":"init.test.js","sourceRoot":"","sources":["../src/init.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAGvB,iCAAiD;AACjD,2CAAuC;AACvC,mDAAgF;AAEhF,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,IAAA,aAAI,EAAC,wFAAwF,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACzG,MAAM,QAAQ,GAAoB,EAAE,CAAC;IACrC,IAAA,8BAAuB,EACrB;QACE,SAAS,EAAE,CAAC,oBAAQ,CAAC,GAAG,CAAC;QACzB,iBAAiB,EAAE,EAAE;KACO,EAC9B,IAAA,kCAAkB,EAAC,QAAQ,CAAC,CAC7B,CAAC;IACF,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;AAC3B,CAAC,CAAC,CAAC;AAEH,IAAA,aAAI,EAAC,oFAAoF,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACrG,MAAM,QAAQ,GAAoB,EAAE,CAAC;IACrC,IAAA,8BAAuB,EACrB;QACE,SAAS,EAAE,CAAC,oBAAQ,CAAC,GAAG,CAAC;QACzB,iBAAiB,EAAE,EAAE,KAAK,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE;KACxB,EAC9B,IAAA,kCAAkB,EAAC,QAAQ,CAAC,CAC7B,CAAC;IACF,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CA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,MAAM,EAAE,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAClC,CAAC,CAAC,EAAE,CACF,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EACnB,kCAAkC,UAAU,4CAA4C,CACzF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/src/actions-util.ts b/src/actions-util.ts index 6242fd2f88..4813c11d71 100644 --- a/src/actions-util.ts +++ b/src/actions-util.ts @@ -476,3 +476,7 @@ export const getFileType = async (filePath: string): Promise => { throw e; } }; + +export function isSelfHostedRunner() { + return process.env.RUNNER_ENVIRONMENT === "self-hosted"; +} diff --git a/src/init-action.ts b/src/init-action.ts index eb9e048850..911e3f02f5 100644 --- a/src/init-action.ts +++ b/src/init-action.ts @@ -26,6 +26,7 @@ import { EnvVar } from "./environment"; import { Feature, Features } from "./feature-flags"; import { checkInstallPython311, + cleanupDatabaseClusterDirectory, initCodeQL, initConfig, isSipEnabled, @@ -321,6 +322,8 @@ async function run() { } try { + cleanupDatabaseClusterDirectory(config, logger); + // Forward Go flags const goFlags = process.env["GOFLAGS"]; if (goFlags) { diff --git a/src/init.test.ts b/src/init.test.ts index 3bef8162ca..6177f25f1c 100644 --- a/src/init.test.ts +++ b/src/init.test.ts @@ -1,9 +1,21 @@ +import * as fs from "fs"; +import path from "path"; + import test from "ava"; import { Config } from "./config-utils"; -import { printPathFiltersWarning } from "./init"; +import { + cleanupDatabaseClusterDirectory, + printPathFiltersWarning, +} from "./init"; import { Language } from "./languages"; -import { LoggedMessage, getRecordingLogger, setupTests } from "./testing-utils"; +import { + LoggedMessage, + createTestConfig, + getRecordingLogger, + setupTests, +} from "./testing-utils"; +import { ConfigurationError, withTmpDir } from "./util"; setupTests(test); @@ -30,3 +42,91 @@ test("printPathFiltersWarning does not trigger when 'paths' and 'paths-ignore' a ); t.is(messages.length, 0); }); + +test("cleanupDatabaseClusterDirectory cleans up where possible", async (t) => { + await withTmpDir(async (tmpDir: string) => { + const dbLocation = path.resolve(tmpDir, "dbs"); + fs.mkdirSync(dbLocation, { recursive: true }); + + const fileToCleanUp = path.resolve(dbLocation, "something-to-cleanup.txt"); + fs.writeFileSync(fileToCleanUp, ""); + + const messages: LoggedMessage[] = []; + cleanupDatabaseClusterDirectory( + createTestConfig({ dbLocation }), + getRecordingLogger(messages), + ); + + t.is(messages.length, 2); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + `The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`, + ); + t.is(messages[1].type, "info"); + t.is( + messages[1].message, + `Cleaned up database cluster directory ${dbLocation}.`, + ); + + t.false(fs.existsSync(fileToCleanUp)); + }); +}); + +for (const { runnerEnv, ErrorConstructor, message } of [ + { + runnerEnv: "self-hosted", + ErrorConstructor: ConfigurationError, + message: (dbLocation) => + "The CodeQL Action requires an empty database cluster directory. By default, this is located " + + `at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` + + "attempt was made to clean up the directory, but this failed. This can happen if another " + + "process is using the directory or the directory is owned by a different user. Please clean " + + "up the directory manually and rerun the job.", + }, + { + runnerEnv: "github-hosted", + ErrorConstructor: Error, + message: (dbLocation) => + "The CodeQL Action requires an empty database cluster directory. By default, this is located " + + `at ${dbLocation}. You can customize it using the 'db-location' input to the init Action. An ` + + "attempt was made to clean up the directory, but this failed. This shouldn't typically " + + "happen on hosted runners. If you are using an advanced setup, please check your workflow, " + + "otherwise we recommend rerunning the job.", + }, +]) { + test(`cleanupDatabaseClusterDirectory throws a ${ErrorConstructor.name} when cleanup fails on ${runnerEnv} runner`, async (t) => { + await withTmpDir(async (tmpDir: string) => { + process.env["RUNNER_ENVIRONMENT"] = runnerEnv; + + const dbLocation = path.resolve(tmpDir, "dbs"); + fs.mkdirSync(dbLocation, { recursive: true }); + + const fileToCleanUp = path.resolve( + dbLocation, + "something-to-cleanup.txt", + ); + fs.writeFileSync(fileToCleanUp, ""); + + const messages: LoggedMessage[] = []; + t.throws( + () => + cleanupDatabaseClusterDirectory( + createTestConfig({ dbLocation }), + getRecordingLogger(messages), + () => { + throw new Error("Failed to clean up"); + }, + ), + { instanceOf: ErrorConstructor, message: message(dbLocation) }, + ); + + t.is(messages.length, 1); + t.is(messages[0].type, "warning"); + t.is( + messages[0].message, + `The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`, + ); + }); + }); +} diff --git a/src/init.ts b/src/init.ts index 4aa68a30c8..59e52bf753 100644 --- a/src/init.ts +++ b/src/init.ts @@ -5,6 +5,7 @@ import * as exec from "@actions/exec/lib/exec"; import * as toolrunner from "@actions/exec/lib/toolrunner"; import * as safeWhich from "@chrisgavin/safe-which"; +import { getOptionalInput, isSelfHostedRunner } from "./actions-util"; import { GitHubApiCombinedDetails, GitHubApiDetails } from "./api-client"; import { CodeQL, setupCodeQL } from "./codeql"; import * as configUtils from "./config-utils"; @@ -171,3 +172,53 @@ export async function isSipEnabled(logger): Promise { return undefined; } } + +export function cleanupDatabaseClusterDirectory( + config: configUtils.Config, + logger: Logger, + // We can't stub the fs module in tests, so we allow the caller to override the rmSync function + // for testing. + rmSync = fs.rmSync, +): void { + if ( + fs.existsSync(config.dbLocation) && + (fs.statSync(config.dbLocation).isFile() || + fs.readdirSync(config.dbLocation).length) + ) { + logger.warning( + `The database cluster directory ${config.dbLocation} must be empty. Attempting to clean it up.`, + ); + try { + rmSync(config.dbLocation, { + force: true, + maxRetries: 3, + recursive: true, + }); + + logger.info( + `Cleaned up database cluster directory ${config.dbLocation}.`, + ); + } catch (e) { + const blurb = `The CodeQL Action requires an empty database cluster directory. ${ + getOptionalInput("db-location") + ? `This is currently configured to be ${config.dbLocation}. ` + : `By default, this is located at ${config.dbLocation}. ` + + "You can customize it using the 'db-location' input to the init Action. " + }An attempt was made to clean up the directory, but this failed.`; + + // Hosted runners are automatically cleaned up, so this error should not occur for hosted runners. + if (isSelfHostedRunner()) { + throw new util.ConfigurationError( + `${blurb} This can happen if another process is using the directory or the directory is owned by a different user. ` + + "Please clean up the directory manually and rerun the job.", + ); + } else { + throw new Error( + `${blurb} This shouldn't typically happen on hosted runners. ` + + "If you are using an advanced setup, please check your workflow, otherwise we " + + "recommend rerunning the job.", + ); + } + } + } +} From c8fb403f2f3a70ca1cfe9b4cc989c7c70dd42346 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 12 Jun 2024 13:17:00 +0100 Subject: [PATCH 2/6] Add PR check for cleaning up database cluster dir --- .../workflows/__cleanup-db-cluster-dir.yml | 81 +++++++++++++++++++ pr-checks/checks/cleanup-db-cluster-dir.yml | 25 ++++++ 2 files changed, 106 insertions(+) create mode 100644 .github/workflows/__cleanup-db-cluster-dir.yml create mode 100644 pr-checks/checks/cleanup-db-cluster-dir.yml diff --git a/.github/workflows/__cleanup-db-cluster-dir.yml b/.github/workflows/__cleanup-db-cluster-dir.yml new file mode 100644 index 0000000000..3c51915af8 --- /dev/null +++ b/.github/workflows/__cleanup-db-cluster-dir.yml @@ -0,0 +1,81 @@ +# Warning: This file is generated automatically, and should not be modified. +# Instead, please modify the template in the pr-checks directory and run: +# (cd pr-checks; pip install ruamel.yaml@0.17.31 && python3 sync.py) +# to regenerate this file. + +name: PR Check - Clean up database cluster directory +env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GO111MODULE: auto + CODEQL_EXTRACTOR_JAVA_AGENT_DISABLE_KOTLIN: 'true' +on: + push: + branches: + - main + - releases/v* + pull_request: + types: + - opened + - synchronize + - reopened + - ready_for_review + schedule: + - cron: '0 5 * * *' + workflow_dispatch: {} +jobs: + cleanup-db-cluster-dir: + strategy: + fail-fast: false + matrix: + include: + - os: ubuntu-latest + version: linked + name: Clean up database cluster directory + permissions: + contents: read + security-events: write + timeout-minutes: 45 + runs-on: ${{ matrix.os }} + steps: + - name: Setup Python on MacOS + uses: actions/setup-python@v5 + if: >- + runner.os == 'macOS' && ( + + matrix.version == 'stable-20230403' || + + matrix.version == 'stable-v2.13.5' || + + matrix.version == 'stable-v2.14.6') + with: + python-version: '3.11' + - name: Check out repository + uses: actions/checkout@v4 + - name: Prepare test + id: prepare-test + uses: ./.github/actions/prepare-test + with: + version: ${{ matrix.version }} + use-all-platform-bundle: 'false' + - name: Add a file to the database cluster directory + run: | + mkdir -p "${{ runner.temp }}/customDbLocation/javascript" + touch "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" + + - uses: ./../action/init + id: init + with: + build-mode: none + db-location: ${{ runner.temp }}/customDbLocation + languages: javascript + tools: ${{ steps.prepare-test.outputs.tools-url }} + + - name: Validate file cleaned up + run: | + if [[ -f "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" ]]; then + echo "File was not cleaned up" + exit 1 + fi + echo "File was cleaned up" + env: + CODEQL_ACTION_TEST_MODE: true diff --git a/pr-checks/checks/cleanup-db-cluster-dir.yml b/pr-checks/checks/cleanup-db-cluster-dir.yml new file mode 100644 index 0000000000..1c181a57e6 --- /dev/null +++ b/pr-checks/checks/cleanup-db-cluster-dir.yml @@ -0,0 +1,25 @@ +name: "Clean up database cluster directory" +description: "The database cluster directory is cleaned up if it is not empty." +operatingSystems: ["ubuntu"] +versions: ["linked"] +steps: + - name: Add a file to the database cluster directory + run: | + mkdir -p "${{ runner.temp }}/customDbLocation/javascript" + touch "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" + + - uses: ./../action/init + id: init + with: + build-mode: none + db-location: "${{ runner.temp }}/customDbLocation" + languages: javascript + tools: ${{ steps.prepare-test.outputs.tools-url }} + + - name: Validate file cleaned up + run: | + if [[ -f "${{ runner.temp }}/customDbLocation/javascript/a-file-to-clean-up.txt" ]]; then + echo "File was not cleaned up" + exit 1 + fi + echo "File was cleaned up" From 3d849e9df215507dcc28f48bfdf79732674e387b Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 12 Jun 2024 13:44:04 +0100 Subject: [PATCH 3/6] Include underlying error in error message --- lib/init.js | 4 ++-- lib/init.js.map | 2 +- lib/init.test.js | 8 ++++++-- lib/init.test.js.map | 2 +- src/init.test.ts | 9 +++++++-- src/init.ts | 8 ++++++-- 6 files changed, 23 insertions(+), 10 deletions(-) diff --git a/lib/init.js b/lib/init.js index 811bc41a5b..8b9279a131 100644 --- a/lib/init.js +++ b/lib/init.js @@ -137,12 +137,12 @@ rmSync = fs.rmSync) { // Hosted runners are automatically cleaned up, so this error should not occur for hosted runners. if ((0, actions_util_1.isSelfHostedRunner)()) { throw new util.ConfigurationError(`${blurb} This can happen if another process is using the directory or the directory is owned by a different user. ` + - "Please clean up the directory manually and rerun the job."); + `Please clean up the directory manually and rerun the job. Details: ${util.wrapError(e).message}`); } else { throw new Error(`${blurb} This shouldn't typically happen on hosted runners. ` + "If you are using an advanced setup, please check your workflow, otherwise we " + - "recommend rerunning the job."); + `recommend rerunning the job. Details: ${util.wrapError(e).message}`); } } } diff --git a/lib/init.js.map b/lib/init.js.map index 4bf41f1c42..662b25b96b 100644 --- a/lib/init.js.map +++ b/lib/init.js.map @@ -1 +1 @@ -{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAAyB;AACzB,2CAA6B;AAE7B,6DAA+C;AAC/C,yEAA2D;AAC3D,kEAAoD;AAEpD,iDAAsE;AAEtE,qCAA+C;AAC/C,4DAA8C;AAE9C,2CAA0D;AAG1D,qDAAgD;AAChD,mDAAwE;AACxE,6CAA+B;AAExB,KAAK,UAAU,UAAU,CAC9B,UAA8B,EAC9B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,iBAA2C,EAC3C,MAAc;IAOd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,uBAAuB,EAAE,WAAW,EAAE,YAAY,EAAE,GAClE,MAAM,IAAA,oBAAW,EACf,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,IAAA,iCAAkB,GAAE,EAAE,CAAC;gBACzB,MAAM,IAAI,IAAI,CAAC,kBAAkB,CAC/B,GAAG,KAAK,4GAA4G;oBAClH,sEACE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OACpB,EAAE,CACL,CAAC;YACJ,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,GAAG,KAAK,sDAAsD;oBAC5D,+EAA+E;oBAC/E,yCACE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,OACpB,EAAE,CACL,CAAC;YACJ,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AApDD,0EAoDC"} \ No newline at end of file diff --git a/lib/init.test.js b/lib/init.test.js index 02a751ac38..f022e22f3a 100644 --- a/lib/init.test.js +++ b/lib/init.test.js @@ -93,10 +93,14 @@ for (const { runnerEnv, ErrorConstructor, message } of [ fs.mkdirSync(dbLocation, { recursive: true }); const fileToCleanUp = path_1.default.resolve(dbLocation, "something-to-cleanup.txt"); fs.writeFileSync(fileToCleanUp, ""); + const rmSyncError = `Failed to clean up file ${fileToCleanUp}`; const messages = []; t.throws(() => (0, init_1.cleanupDatabaseClusterDirectory)((0, testing_utils_1.createTestConfig)({ dbLocation }), (0, testing_utils_1.getRecordingLogger)(messages), () => { - throw new Error("Failed to clean up"); - }), { instanceOf: ErrorConstructor, message: message(dbLocation) }); + throw new Error(rmSyncError); + }), { + instanceOf: ErrorConstructor, + message: `${message(dbLocation)} Details: ${rmSyncError}`, + }); t.is(messages.length, 1); t.is(messages[0].type, "warning"); t.is(messages[0].message, `The database cluster directory ${dbLocation} must be empty. Attempting to clean it up.`); diff --git a/lib/init.test.js.map b/lib/init.test.js.map index 90ec3efff0..eb03f62f1a 100644 --- a/lib/init.test.js.map +++ b/lib/init.test.js.map @@ -1 +1 @@ -{"version":3,"file":"init.test.js","sourceRoot":"","sources":["../src/init.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AA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,CAAC,CACF,EACH;gBACE,UAAU,EAAE,gBAAgB;gBAC5B,OAAO,EAAE,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,WAAW,EAAE;aAC1D,CACF,CAAC;YAEF,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;YACzB,CAAC,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;YAClC,CAAC,CAAC,EAAE,CACF,QAAQ,CAAC,CAAC,CAAC,CAAC,OAAO,EACnB,kCAAkC,UAAU,4CAA4C,CACzF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"} \ No newline at end of file diff --git a/src/init.test.ts b/src/init.test.ts index 6177f25f1c..213f4aff13 100644 --- a/src/init.test.ts +++ b/src/init.test.ts @@ -108,6 +108,8 @@ for (const { runnerEnv, ErrorConstructor, message } of [ ); fs.writeFileSync(fileToCleanUp, ""); + const rmSyncError = `Failed to clean up file ${fileToCleanUp}`; + const messages: LoggedMessage[] = []; t.throws( () => @@ -115,10 +117,13 @@ for (const { runnerEnv, ErrorConstructor, message } of [ createTestConfig({ dbLocation }), getRecordingLogger(messages), () => { - throw new Error("Failed to clean up"); + throw new Error(rmSyncError); }, ), - { instanceOf: ErrorConstructor, message: message(dbLocation) }, + { + instanceOf: ErrorConstructor, + message: `${message(dbLocation)} Details: ${rmSyncError}`, + }, ); t.is(messages.length, 1); diff --git a/src/init.ts b/src/init.ts index 59e52bf753..35e5228b1f 100644 --- a/src/init.ts +++ b/src/init.ts @@ -210,13 +210,17 @@ export function cleanupDatabaseClusterDirectory( if (isSelfHostedRunner()) { throw new util.ConfigurationError( `${blurb} This can happen if another process is using the directory or the directory is owned by a different user. ` + - "Please clean up the directory manually and rerun the job.", + `Please clean up the directory manually and rerun the job. Details: ${ + util.wrapError(e).message + }`, ); } else { throw new Error( `${blurb} This shouldn't typically happen on hosted runners. ` + "If you are using an advanced setup, please check your workflow, otherwise we " + - "recommend rerunning the job.", + `recommend rerunning the job. Details: ${ + util.wrapError(e).message + }`, ); } } From d8d73c0e76d558228c90f38c8c374dc0bfbbead1 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 12 Jun 2024 14:51:03 +0100 Subject: [PATCH 4/6] Clean up DB cluster directory at the end of each job --- lib/init-action-post-helper.js | 12 ++++++++++++ lib/init-action-post-helper.js.map | 2 +- src/init-action-post-helper.ts | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/lib/init-action-post-helper.js b/lib/init-action-post-helper.js index ac079d77e8..2b82ce942e 100644 --- a/lib/init-action-post-helper.js +++ b/lib/init-action-post-helper.js @@ -24,6 +24,7 @@ var __importStar = (this && this.__importStar) || function (mod) { }; Object.defineProperty(exports, "__esModule", { value: true }); exports.getFinalJobStatus = exports.run = exports.tryUploadSarifIfRunFailed = void 0; +const fs = __importStar(require("fs")); const core = __importStar(require("@actions/core")); const github = __importStar(require("@actions/github")); const actionsUtil = __importStar(require("./actions-util")); @@ -134,6 +135,17 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p await uploadLogsDebugArtifact(config); await printDebugLogs(config); } + try { + fs.rmSync(config.dbLocation, { + recursive: true, + force: true, + maxRetries: 3, + }); + logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`); + } + catch (e) { + logger.warning(`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`); + } return uploadFailedSarifResult; } exports.run = run; diff --git a/lib/init-action-post-helper.js.map b/lib/init-action-post-helper.js.map index 80e34daa91..c55f0e1fb5 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;AACtC,wDAA0C;AAE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IAAI,KAAK,CACb,qDAAqD,IAAA,sBAAe,EAClE,CAAC,CACF,EAAE,CACJ,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,OAAO,CACZ,2HAA2H,CAC5H,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB;IAC/B,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAM,CAAC,UAAU,CAAC,CAAC;IAChE,IACE,CAAC,wBAAwB;QACzB,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAS,CAAC,CAAC,QAAQ,CAAC,wBAAqC,CAAC,EACzE,CAAC;QACD,OAAO,yBAAS,CAAC,aAAa,CAAC;IACjC,CAAC;IACD,OAAO,wBAAqC,CAAC;AAC/C,CAAC;AATD,8CASC"} \ 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,uCAAyB;AAEzB,oDAAsC;AACtC,wDAA0C;AAE1C,4DAA8C;AAC9C,6CAA4C;AAC5C,qCAAqC;AAErC,+CAAuC;AACvC,mDAA6D;AAE7D,6CAAiE;AACjE,mDAA4C;AAC5C,wDAA0C;AAC1C,iCAOgB;AAChB,yCAKoB;AAkBpB,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,EA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AAQ,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,OAAO,CACZ,2HAA2H,CAC5H,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB;IAC/B,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAM,CAAC,UAAU,CAAC,CAAC;IAChE,IACE,CAAC,wBAAwB;QACzB,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAS,CAAC,CAAC,QAAQ,CAAC,wBAAqC,CAAC,EACzE,CAAC;QACD,OAAO,yBAAS,CAAC,aAAa,CAAC;IACjC,CAAC;IACD,OAAO,wBAAqC,CAAC;AAC/C,CAAC;AATD,8CASC"} \ No newline at end of file diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index 3d9a7e8f78..4242464aa1 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -1,3 +1,5 @@ +import * as fs from "fs"; + import * as core from "@actions/core"; import * as github from "@actions/github"; @@ -217,6 +219,19 @@ export async function run( await printDebugLogs(config); } + try { + fs.rmSync(config.dbLocation, { + recursive: true, + force: true, + maxRetries: 3, + }); + logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`); + } catch (e) { + logger.warning( + `Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`, + ); + } + return uploadFailedSarifResult; } From ed34eb9af43ff3ee9d3c1076ac8fd2db12751cd1 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 12 Jun 2024 14:59:44 +0100 Subject: [PATCH 5/6] Skip init-post cleanup on GitHub-hosted runners --- lib/init-action-post-helper.js | 26 ++++++++++++++++---------- lib/init-action-post-helper.js.map | 2 +- src/init-action-post-helper.ts | 29 +++++++++++++++++++---------- 3 files changed, 36 insertions(+), 21 deletions(-) diff --git a/lib/init-action-post-helper.js b/lib/init-action-post-helper.js index 2b82ce942e..7a953530ff 100644 --- a/lib/init-action-post-helper.js +++ b/lib/init-action-post-helper.js @@ -135,16 +135,22 @@ async function run(uploadDatabaseBundleDebugArtifact, uploadLogsDebugArtifact, p await uploadLogsDebugArtifact(config); await printDebugLogs(config); } - try { - fs.rmSync(config.dbLocation, { - recursive: true, - force: true, - maxRetries: 3, - }); - logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`); - } - catch (e) { - logger.warning(`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`); + if (actionsUtil.isSelfHostedRunner()) { + try { + fs.rmSync(config.dbLocation, { + recursive: true, + force: true, + maxRetries: 3, + }); + logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`); + } + catch (e) { + logger.warning(`Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`); + } + } + else { + logger.debug("Skipping cleanup of database cluster directory since we are running on a GitHub-hosted " + + "runner which will be automatically cleaned up."); } return uploadFailedSarifResult; } diff --git a/lib/init-action-post-helper.js.map b/lib/init-action-post-helper.js.map index c55f0e1fb5..4de49805d3 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,uCAAyB;AAEzB,oDAAsC;AACtC,wDAA0C;AAE1C,4DAA8C;AAC9C,6CAA4C;AAC5C,qCAAqC;AAErC,+CAAuC;AACvC,mDAA6D;AAE7D,6CAAiE;AACjE,mDAA4C;AAC5C,wDAA0C;AAC1C,iCAOgB;AAChB,yCAKoB;AAkBpB,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,CAC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A,sBAAe,EAClE,CAAC,CACF,EAAE,CACJ,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,OAAO,CACZ,2HAA2H,CAC5H,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB;IAC/B,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAM,CAAC,UAAU,CAAC,CAAC;IAChE,IACE,CAAC,wBAAwB;QACzB,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAS,CAAC,CAAC,QAAQ,CAAC,wBAAqC,CAAC,EACzE,CAAC;QACD,OAAO,yBAAS,CAAC,aAAa,CAAC;IACjC,CAAC;IACD,OAAO,wBAAqC,CAAC;AAC/C,CAAC;AATD,8CASC"} \ 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,uCAAyB;AAEzB,oDAAsC;AACtC,wDAA0C;AAE1C,4DAA8C;AAC9C,6CAA4C;AAC5C,qCAAqC;AAErC,+CAAuC;AACvC,mDAA6D;AAE7D,6CAAiE;AACjE,mDAA4C;AAC5C,wDAA0C;AAC1C,iCAOgB;AAChB,yCAKoB;AAkBpB,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,CAAC;QACtB,OAAO,EAAE,i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MAAM,IAAI,KAAK,CACb,qDAAqD,IAAA,sBAAe,EAClE,CAAC,CACF,EAAE,CACJ,CAAC;QACJ,CAAC;gBAAS,CAAC;YACT,MAAM,CAAC,QAAQ,EAAE,CAAC;QACpB,CAAC;IACH,CAAC;SAAM,CAAC;QACN,MAAM,CAAC,OAAO,CACZ,2HAA2H,CAC5H,CAAC;IACJ,CAAC;AACH,CAAC;AAED;;;;;GAKG;AACH,SAAgB,iBAAiB;IAC/B,MAAM,wBAAwB,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAM,CAAC,UAAU,CAAC,CAAC;IAChE,IACE,CAAC,wBAAwB;QACzB,CAAC,MAAM,CAAC,MAAM,CAAC,yBAAS,CAAC,CAAC,QAAQ,CAAC,wBAAqC,CAAC,EACzE,CAAC;QACD,OAAO,yBAAS,CAAC,aAAa,CAAC;IACjC,CAAC;IACD,OAAO,wBAAqC,CAAC;AAC/C,CAAC;AATD,8CASC"} \ No newline at end of file diff --git a/src/init-action-post-helper.ts b/src/init-action-post-helper.ts index 4242464aa1..6656a7db6b 100644 --- a/src/init-action-post-helper.ts +++ b/src/init-action-post-helper.ts @@ -219,16 +219,25 @@ export async function run( await printDebugLogs(config); } - try { - fs.rmSync(config.dbLocation, { - recursive: true, - force: true, - maxRetries: 3, - }); - logger.info(`Cleaned up database cluster directory ${config.dbLocation}.`); - } catch (e) { - logger.warning( - `Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`, + if (actionsUtil.isSelfHostedRunner()) { + try { + fs.rmSync(config.dbLocation, { + recursive: true, + force: true, + maxRetries: 3, + }); + logger.info( + `Cleaned up database cluster directory ${config.dbLocation}.`, + ); + } catch (e) { + logger.warning( + `Failed to clean up database cluster directory ${config.dbLocation}. Details: ${e}`, + ); + } + } else { + logger.debug( + "Skipping cleanup of database cluster directory since we are running on a GitHub-hosted " + + "runner which will be automatically cleaned up.", ); } From 159d9119acb94bcfe85792bd55dbc820465fed45 Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 12 Jun 2024 16:14:26 +0100 Subject: [PATCH 6/6] Tweak changelog entries Co-authored-by: Andrew Eisenberg --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5288ff40bf..f88c2732f2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,8 +6,8 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the ## [UNRELEASED] -- Avoid failing database creation if the database folder already exists and contains some unexpected files. [#2330](https://github.com/github/codeql-action/pull/2330) -- The init Action will attempt to clean up the database cluster directory before creating a new database. This will help to avoid issues where the database cluster directory is left in an inconsistent state. [#2332](https://github.com/github/codeql-action/pull/2332) +- Avoid failing database creation if the database folder already exists and contains some unexpected files. Requires CodeQL 2.18.0 or higher. [#2330](https://github.com/github/codeql-action/pull/2330) +- The init Action will attempt to clean up the database cluster directory before creating a new database and at the end of the job. This will help to avoid issues where the database cluster directory is left in an inconsistent state. [#2332](https://github.com/github/codeql-action/pull/2332) ## 3.25.8 - 04 Jun 2024