diff --git a/.github/update-release-branch.py b/.github/update-release-branch.py index 9d20e38ebf..b547b1736f 100644 --- a/.github/update-release-branch.py +++ b/.github/update-release-branch.py @@ -104,7 +104,7 @@ def open_pr( body.append(' - [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies.') body.append(' - [ ] Mark the PR as ready for review to trigger the full set of PR checks.') - body.append(' - [ ] Approve and merge this PR.') + body.append(' - [ ] Approve and merge this PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`.') if is_v2_release: body.append(' - [ ] Merge the mergeback PR that will automatically be created once this PR is merged.') diff --git a/.github/workflows/post-release-mergeback.yml b/.github/workflows/post-release-mergeback.yml index 7b8b8a7768..1ba81b2b2a 100644 --- a/.github/workflows/post-release-mergeback.yml +++ b/.github/workflows/post-release-mergeback.yml @@ -122,7 +122,7 @@ jobs: - [ ] Remove and re-add the "Update dependencies" label to the PR to trigger just this workflow. - [ ] Wait for the "Update dependencies" workflow to push a commit updating the dependencies. - [ ] Mark the PR as ready for review to trigger the full set of PR checks. - - [ ] Approve and merge the PR. + - [ ] Approve and merge the PR. Make sure `Create a merge commit` is selected rather than `Squash and merge` or `Rebase and merge`. EOF ) diff --git a/CHANGELOG.md b/CHANGELOG.md index bd7092482c..54301fe299 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ No user facing changes. +## 2.1.27 - 06 Oct 2022 + +- We are rolling out a feature of the CodeQL Action in October 2022 that changes the way that Go code is analyzed to be more consistent with other compiled languages like C/C++, C#, and Java. You do not need to alter your code scanning workflows. If you encounter any problems, please [file an issue](https://github.com/github/codeql-action/issues) or open a private ticket with GitHub Support and request an escalation to engineering. + ## 2.1.26 - 29 Sep 2022 - Update default CodeQL bundle version to 2.11.0. [#1267](https://github.com/github/codeql-action/pull/1267) diff --git a/lib/feature-flags.test.js b/lib/feature-flags.test.js index 9e3b4bf629..16b366dee0 100644 --- a/lib/feature-flags.test.js +++ b/lib/feature-flags.test.js @@ -36,7 +36,7 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) { } t.assert(loggedMessages.find((v) => v.type === "debug" && v.message === - "Not running against github.com. Disabling all feature flags.") !== undefined); + "Not running against github.com. Disabling all toggleable features.") !== undefined); }); }); } @@ -69,7 +69,7 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) { const featureFlags = setUpTests(tmpDir); (0, testing_utils_1.mockFeatureFlagApiEndpoint)(500, {}); await t.throwsAsync(async () => featureFlags.getValue(feature_flags_1.Feature.MlPoweredQueriesEnabled, includeCodeQlIfRequired(feature_flags_1.Feature.MlPoweredQueriesEnabled)), { - message: "Encountered an error while trying to load feature flags: Error: some error message", + message: "Encountered an error while trying to determine feature enablement: Error: some error message", }); }); }); @@ -123,7 +123,7 @@ for (const featureFlag of Object.keys(feature_flags_1.featureConfig)) { const expectedFeatureFlags = initializeFeatures(true); (0, testing_utils_1.mockFeatureFlagApiEndpoint)(200, expectedFeatureFlags); await t.throwsAsync(async () => featureFlags.getValue(featureFlag), { - message: `Internal error: A minimum version is specified for feature flag ${featureFlag}, but no instance of CodeQL was provided.`, + message: `Internal error: A minimum version is specified for feature ${featureFlag}, but no instance of CodeQL was provided.`, }); }); }); diff --git a/lib/feature-flags.test.js.map b/lib/feature-flags.test.js.map index 00836f07b5..be46f64898 100644 --- a/lib/feature-flags.test.js.map +++ b/lib/feature-flags.test.js.map @@ -1 +1 @@ -{"version":3,"file":"feature-flags.test.js","sourceRoot":"","sources":["../src/feature-flags.test.ts"],"names":[],"mappings":";;;;;AAAA,8CAAuB;AAGvB,mDAKyB;AACzB,uCAA4C;AAC5C,6CAAkD;AAClD,mDAOyB;AAEzB,iCAAgF;AAEhF,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,aAAI,CAAC,UAAU,CAAC,GAAG,EAAE;IACnB,IAAA,4BAAqB,EAAC,WAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;AAC/C,CAAC,CAAC,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CAAC,CAAC,SAAS,CAAC;AAChB,CAAC"} \ No newline at end of file diff --git a/lib/init.js b/lib/init.js index 0a8d6f64dd..443084377c 100644 --- a/lib/init.js +++ b/lib/init.js @@ -47,7 +47,6 @@ async function initConfig(languagesInput, queriesInput, packsInput, registriesIn } exports.initConfig = initConfig; async function runInit(codeql, config, sourceRoot, processName, processLevel, featureFlags, logger) { - var _a, _b; fs.mkdirSync(config.dbLocation, { recursive: true }); try { if (await (0, util_1.codeQlVersionAbove)(codeql, codeql_1.CODEQL_VERSION_NEW_TRACING)) { @@ -62,24 +61,41 @@ async function runInit(codeql, config, sourceRoot, processName, processLevel, fe } } catch (e) { - // Handle the situation where init is called twice - // for the same database in the same job. - if (e instanceof Error && - ((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes("Refusing to create databases")) && - e.message.includes("exists and is not an empty directory.")) { - throw new util.UserError(`Is the "init" action called twice in the same job? ${e.message}`); - } - else if (e instanceof Error && - ((_b = e.message) === null || _b === void 0 ? void 0 : _b.includes("is not compatible with this CodeQL CLI"))) { - throw new util.UserError(e.message); - } - else { - throw e; - } + throw processError(e); } return await (0, tracer_config_1.getCombinedTracerConfig)(config, codeql, await util.isGoExtractionReconciliationEnabled(featureFlags), logger); } exports.runInit = runInit; +/** + * Possibly convert this error into a UserError in order to avoid + * counting this error towards our internal error budget. + * + * @param e The error to possibly convert to a UserError. + * + * @returns A UserError if the error is a known error that can be + * attributed to the user, otherwise the original error. + */ +function processError(e) { + var _a, _b, _c, _d; + if (!(e instanceof Error)) { + return e; + } + if ( + // Init action called twice + ((_a = e.message) === null || _a === void 0 ? void 0 : _a.includes("Refusing to create databases")) && + ((_b = e.message) === null || _b === void 0 ? void 0 : _b.includes("exists and is not an empty directory."))) { + return new util.UserError(`Is the "init" action called twice in the same job? ${e.message}`); + } + if ( + // Version of CodeQL CLI is incompatible with this version of the CodeQL Action + ((_c = e.message) === null || _c === void 0 ? void 0 : _c.includes("is not compatible with this CodeQL CLI")) || + ( + // Expected source location for database creation does not exist + (_d = e.message) === null || _d === void 0 ? void 0 : _d.includes("Invalid source root"))) { + return new util.UserError(e.message); + } + return e; +} // Runs a powershell script to inject the tracer into a parent process // so it can tracer future processes, hopefully including the build process. // If processName is given then injects into the nearest parent process with diff --git a/lib/init.js.map b/lib/init.js.map index ba848315ae..030493cfc8 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,yEAA2D;AAC3D,kEAAoD;AAEpD,gEAAkD;AAElD,qCAA2E;AAC3E,4DAA8C;AAI9C,mDAAwE;AACxE,6CAA+B;AAC/B,iCAA4C;AAErC,KAAK,UAAU,UAAU,CAC9B,SAA6B,EAC7B,UAA4B,EAC5B,OAAe,EACf,OAA2B,EAC3B,YAA+B,EAC/B,MAAc;IAEd,MAAM,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC;IACxC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,GAAG,MAAM,IAAA,oBAAW,EAChD,SAAS,EACT,UAAU,EACV,OAAO,EACP,OAAO,EACP,YAAY,EACZ,MAAM,EACN,IAAI,CACL,CAAC;IACF,MAAM,MAAM,CAAC,YAAY,EAAE,CAAC;IAC5B,MAAM,CAAC,QAAQ,EAAE,CAAC;IAClB,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,CAAC;AAClC,CAAC;AArBD,gCAqBC;AAEM,KAAK,UAAU,UAAU,CAC9B,cAAkC,EAClC,YAAgC,EAChC,UAA8B,EAC9B,eAAmC,EACnC,UAA8B,EAC9B,UAA8B,EAC9B,kBAA2B,EAC3B,SAAkB,EAClB,iBAAyB,EACzB,iBAAyB,EACzB,UAAyB,EACzB,OAAe,EACf,MAAc,EACd,aAAqB,EACrB,aAAiC,EACjC,UAAoC,EACpC,YAA+B,EAC/B,MAAc;IAEd,MA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QACF,OAAO;KACR;IACD,MAAM,CAAC,QAAQ,EAAE,CAAC;AACpB,CAAC;AAzCD,8CAyCC"} \ No newline at end of file diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json index b2764985e8..64e2840edc 100644 --- a/node_modules/.package-lock.json +++ b/node_modules/.package-lock.json @@ -1,6 +1,6 @@ { "name": "codeql", - "version": "2.1.27", + "version": "2.1.28", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/package-lock.json b/package-lock.json index d8b156891e..605c03c462 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "codeql", - "version": "2.1.27", + "version": "2.1.28", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "codeql", - "version": "2.1.27", + "version": "2.1.28", "license": "MIT", "dependencies": { "@actions/artifact": "^1.0.0", diff --git a/package.json b/package.json index faa25a38ee..192715d85b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeql", - "version": "2.1.27", + "version": "2.1.28", "private": true, "description": "CodeQL action", "scripts": { diff --git a/src/feature-flags.test.ts b/src/feature-flags.test.ts index 11d94a64d6..0534d210e1 100644 --- a/src/feature-flags.test.ts +++ b/src/feature-flags.test.ts @@ -66,7 +66,7 @@ for (const variant of ALL_FEATURE_FLAGS_DISABLED_VARIANTS) { (v: LoggedMessage) => v.type === "debug" && v.message === - "Not running against github.com. Disabling all feature flags." + "Not running against github.com. Disabling all toggleable features." ) !== undefined ); }); @@ -122,7 +122,7 @@ test("Feature flags exception is propagated if the API request errors", async (t ), { message: - "Encountered an error while trying to load feature flags: Error: some error message", + "Encountered an error while trying to determine feature enablement: Error: some error message", } ); }); @@ -217,7 +217,7 @@ for (const featureFlag of Object.keys(featureConfig)) { await t.throwsAsync( async () => featureFlags.getValue(featureFlag as Feature), { - message: `Internal error: A minimum version is specified for feature flag ${featureFlag}, but no instance of CodeQL was provided.`, + message: `Internal error: A minimum version is specified for feature ${featureFlag}, but no instance of CodeQL was provided.`, } ); }); diff --git a/src/init.ts b/src/init.ts index 7c396e64ab..8d31544c51 100644 --- a/src/init.ts +++ b/src/init.ts @@ -117,24 +117,7 @@ export async function runInit( } } } catch (e) { - // Handle the situation where init is called twice - // for the same database in the same job. - if ( - e instanceof Error && - e.message?.includes("Refusing to create databases") && - e.message.includes("exists and is not an empty directory.") - ) { - throw new util.UserError( - `Is the "init" action called twice in the same job? ${e.message}` - ); - } else if ( - e instanceof Error && - e.message?.includes("is not compatible with this CodeQL CLI") - ) { - throw new util.UserError(e.message); - } else { - throw e; - } + throw processError(e); } return await getCombinedTracerConfig( config, @@ -144,6 +127,42 @@ export async function runInit( ); } +/** + * Possibly convert this error into a UserError in order to avoid + * counting this error towards our internal error budget. + * + * @param e The error to possibly convert to a UserError. + * + * @returns A UserError if the error is a known error that can be + * attributed to the user, otherwise the original error. + */ +function processError(e: any): Error { + if (!(e instanceof Error)) { + return e; + } + + if ( + // Init action called twice + e.message?.includes("Refusing to create databases") && + e.message?.includes("exists and is not an empty directory.") + ) { + return new util.UserError( + `Is the "init" action called twice in the same job? ${e.message}` + ); + } + + if ( + // Version of CodeQL CLI is incompatible with this version of the CodeQL Action + e.message?.includes("is not compatible with this CodeQL CLI") || + // Expected source location for database creation does not exist + e.message?.includes("Invalid source root") + ) { + return new util.UserError(e.message); + } + + return e; +} + // Runs a powershell script to inject the tracer into a parent process // so it can tracer future processes, hopefully including the build process. // If processName is given then injects into the nearest parent process with