From 4e0668d05e3cb2e52a5dac354d3acadd04985afd Mon Sep 17 00:00:00 2001 From: Henry Mercer Date: Wed, 11 May 2022 15:52:56 +0100 Subject: [PATCH 1/2] Fix integration tests on v1 The GitHub API client coerces `fake-server-url` to the Dotcom API URL, which means commands like `util.getGitHubVersion` will call the Dotcom API with the `fake-token`, resulting in 401s. We therefore use the Dotcom URL instead and additionally stub `util.getGitHubVersion` as a good practice (it's no longer necessary). --- lib/analyze-action-env.test.js | 10 +++++++--- lib/analyze-action-env.test.js.map | 2 +- lib/analyze-action-input.test.js | 10 +++++++--- lib/analyze-action-input.test.js.map | 2 +- src/analyze-action-env.test.ts | 10 +++++++--- src/analyze-action-input.test.ts | 10 +++++++--- 6 files changed, 30 insertions(+), 14 deletions(-) diff --git a/lib/analyze-action-env.test.js b/lib/analyze-action-env.test.js index 335e61e47f..60fd7b3a5c 100644 --- a/lib/analyze-action-env.test.js +++ b/lib/analyze-action-env.test.js @@ -38,14 +38,17 @@ const util = __importStar(require("./util")); // but the first test would fail. (0, ava_1.default)("analyze action with RAM & threads from environment variables", async (t) => { await util.withTmpDir(async (tmpDir) => { - process.env["GITHUB_SERVER_URL"] = "fake-server-url"; - process.env["GITHUB_REPOSITORY"] = "fake/repository"; + process.env["GITHUB_SERVER_URL"] = util.GITHUB_DOTCOM_URL; + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; sinon .stub(actionsUtil, "createStatusReportBase") .resolves({}); sinon.stub(actionsUtil, "sendStatusReport").resolves(true); + const gitHubVersion = { + type: util.GitHubVariant.DOTCOM, + }; sinon.stub(configUtils, "getConfig").resolves({ - gitHubVersion: { type: util.GitHubVariant.DOTCOM }, + gitHubVersion, languages: [], packs: [], }); @@ -54,6 +57,7 @@ const util = __importStar(require("./util")); requiredInputStub.withArgs("upload-database").returns("false"); const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput"); optionalInputStub.withArgs("cleanup-level").returns("none"); + sinon.stub(util, "getGitHubVersion").resolves(gitHubVersion); (0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir); (0, testing_utils_1.mockFeatureFlagApiEndpoint)(200, {}); // When there are no action inputs for RAM and threads, the action uses diff --git a/lib/analyze-action-env.test.js.map b/lib/analyze-action-env.test.js.map index 9127d92a94..a9951eee22 100644 --- a/lib/analyze-action-env.test.js.map +++ b/lib/analyze-action-env.test.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze-action-env.test.js","sourceRoot":"","sources":["../src/analyze-action-env.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,4DAA8C;AAC9C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AAEjC,IAAA,aAAI,EAAC,8DAA8D,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/E,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,iBAAiB,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,iBAAiB,CAAC;QACrD,KAAK;aACF,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC;aAC3C,QAAQ,CAAC,EAAkC,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC;YAC5C,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;YAClD,SAAS,EAAE,EAAE;YACb,KAAK,E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,CAAC,CAAC;QAC7D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze-action-env.test.js","sourceRoot":"","sources":["../src/analyze-action-env.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,4DAA8C;AAC9C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AAEjC,IAAA,aAAI,EAAC,8DAA8D,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IAC/E,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;QAC1E,KAAK;aACF,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC;aAC3C,QAAQ,CAAC,EAAkC,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3D,MAAM,aAAa,GAAuB;YACxC,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM;SAChC,CAAC;QACF,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,C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AAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC/D,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/lib/analyze-action-input.test.js b/lib/analyze-action-input.test.js index dd8a1ea163..67af3acf61 100644 --- a/lib/analyze-action-input.test.js +++ b/lib/analyze-action-input.test.js @@ -38,14 +38,17 @@ const util = __importStar(require("./util")); // but the first test would fail. (0, ava_1.default)("analyze action with RAM & threads from action inputs", async (t) => { await util.withTmpDir(async (tmpDir) => { - process.env["GITHUB_SERVER_URL"] = "fake-server-url"; - process.env["GITHUB_REPOSITORY"] = "fake/repository"; + process.env["GITHUB_SERVER_URL"] = util.GITHUB_DOTCOM_URL; + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; sinon .stub(actionsUtil, "createStatusReportBase") .resolves({}); sinon.stub(actionsUtil, "sendStatusReport").resolves(true); + const gitHubVersion = { + type: util.GitHubVariant.DOTCOM, + }; sinon.stub(configUtils, "getConfig").resolves({ - gitHubVersion: { type: util.GitHubVariant.DOTCOM }, + gitHubVersion, languages: [], packs: [], }); @@ -54,6 +57,7 @@ const util = __importStar(require("./util")); requiredInputStub.withArgs("upload-database").returns("false"); const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput"); optionalInputStub.withArgs("cleanup-level").returns("none"); + sinon.stub(util, "getGitHubVersion").resolves(gitHubVersion); (0, testing_utils_1.setupActionsVars)(tmpDir, tmpDir); (0, testing_utils_1.mockFeatureFlagApiEndpoint)(200, {}); process.env["CODEQL_THREADS"] = "1"; diff --git a/lib/analyze-action-input.test.js.map b/lib/analyze-action-input.test.js.map index a7734fa9c9..a0b5de374e 100644 --- a/lib/analyze-action-input.test.js.map +++ b/lib/analyze-action-input.test.js.map @@ -1 +1 @@ -{"version":3,"file":"analyze-action-input.test.js","sourceRoot":"","sources":["../src/analyze-action-input.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,4DAA8C;AAC9C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AAEjC,IAAA,aAAI,EAAC,sDAAsD,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACvE,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,iBAAiB,CAAC;QACrD,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,iBAAiB,CAAC;QACrD,KAAK;aACF,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC;aAC3C,QAAQ,CAAC,EAAkC,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3D,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,QAAQ,CAAC;YAC5C,aAAa,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,aAAa,CAAC,MAAM,EAAE;YAClD,SAAS,EAAE,EAAE;YACb,KAAK,EAAE,EAAE;SACuB,CAAC,CAA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cAAc,CAAC,CAAC;QAC/D,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file +{"version":3,"file":"analyze-action-input.test.js","sourceRoot":"","sources":["../src/analyze-action-input.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAuB;AACvB,6CAA+B;AAE/B,4DAA8C;AAC9C,mDAAqC;AACrC,4DAA8C;AAC9C,mDAIyB;AACzB,6CAA+B;AAE/B,IAAA,0BAAU,EAAC,aAAI,CAAC,CAAC;AAEjB,4EAA4E;AAC5E,4EAA4E;AAC5E,+EAA+E;AAC/E,+EAA+E;AAC/E,gFAAgF;AAChF,iCAAiC;AAEjC,IAAA,aAAI,EAAC,sDAAsD,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;IACvE,MAAM,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,MAAM,EAAE,EAAE;QACrC,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,IAAI,CAAC,iBAAiB,CAAC;QAC1D,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC,GAAG,sCAAsC,CAAC;QAC1E,KAAK;aACF,IAAI,CAAC,WAAW,EAAE,wBAAwB,CAAC;aAC3C,QAAQ,CAAC,EAAkC,CAAC,CAAC;QAChD,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QAC3D,MAAM,aAAa,GAAuB;Y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Ac,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;QACzD,MAAM,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;QAElD,uEAAuE;QACvE,oEAAoE;QACpE,4EAA4E;QAC5E,wEAAwE;QACxE,MAAM,aAAa,CAAC,UAAU,CAAC;QAE/B,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC/D,CAAC,CAAC,SAAS,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;QAC7D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,CAAC;QAC9D,CAAC,CAAC,SAAS,CAAC,cAAc,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;IAC9D,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"} \ No newline at end of file diff --git a/src/analyze-action-env.test.ts b/src/analyze-action-env.test.ts index 63f7a0f20e..1a0e29b01b 100644 --- a/src/analyze-action-env.test.ts +++ b/src/analyze-action-env.test.ts @@ -22,14 +22,17 @@ setupTests(test); test("analyze action with RAM & threads from environment variables", async (t) => { await util.withTmpDir(async (tmpDir) => { - process.env["GITHUB_SERVER_URL"] = "fake-server-url"; - process.env["GITHUB_REPOSITORY"] = "fake/repository"; + process.env["GITHUB_SERVER_URL"] = util.GITHUB_DOTCOM_URL; + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; sinon .stub(actionsUtil, "createStatusReportBase") .resolves({} as actionsUtil.StatusReportBase); sinon.stub(actionsUtil, "sendStatusReport").resolves(true); + const gitHubVersion: util.GitHubVersion = { + type: util.GitHubVariant.DOTCOM, + }; sinon.stub(configUtils, "getConfig").resolves({ - gitHubVersion: { type: util.GitHubVariant.DOTCOM }, + gitHubVersion, languages: [], packs: [], } as unknown as configUtils.Config); @@ -38,6 +41,7 @@ test("analyze action with RAM & threads from environment variables", async (t) = requiredInputStub.withArgs("upload-database").returns("false"); const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput"); optionalInputStub.withArgs("cleanup-level").returns("none"); + sinon.stub(util, "getGitHubVersion").resolves(gitHubVersion); setupActionsVars(tmpDir, tmpDir); mockFeatureFlagApiEndpoint(200, {}); diff --git a/src/analyze-action-input.test.ts b/src/analyze-action-input.test.ts index 0f89189dca..6ec95ba13e 100644 --- a/src/analyze-action-input.test.ts +++ b/src/analyze-action-input.test.ts @@ -22,14 +22,17 @@ setupTests(test); test("analyze action with RAM & threads from action inputs", async (t) => { await util.withTmpDir(async (tmpDir) => { - process.env["GITHUB_SERVER_URL"] = "fake-server-url"; - process.env["GITHUB_REPOSITORY"] = "fake/repository"; + process.env["GITHUB_SERVER_URL"] = util.GITHUB_DOTCOM_URL; + process.env["GITHUB_REPOSITORY"] = "github/codeql-action-fake-repository"; sinon .stub(actionsUtil, "createStatusReportBase") .resolves({} as actionsUtil.StatusReportBase); sinon.stub(actionsUtil, "sendStatusReport").resolves(true); + const gitHubVersion: util.GitHubVersion = { + type: util.GitHubVariant.DOTCOM, + }; sinon.stub(configUtils, "getConfig").resolves({ - gitHubVersion: { type: util.GitHubVariant.DOTCOM }, + gitHubVersion, languages: [], packs: [], } as unknown as configUtils.Config); @@ -38,6 +41,7 @@ test("analyze action with RAM & threads from action inputs", async (t) => { requiredInputStub.withArgs("upload-database").returns("false"); const optionalInputStub = sinon.stub(actionsUtil, "getOptionalInput"); optionalInputStub.withArgs("cleanup-level").returns("none"); + sinon.stub(util, "getGitHubVersion").resolves(gitHubVersion); setupActionsVars(tmpDir, tmpDir); mockFeatureFlagApiEndpoint(200, {}); From f8c88ab2dc587df56ccf035747ba9d0adb22a33b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Wed, 11 May 2022 15:51:54 +0000 Subject: [PATCH 2/2] Update changelog and version after v2.1.10 --- CHANGELOG.md | 4 ++++ package-lock.json | 4 ++-- package.json | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 104a165136..66c1b0cd39 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # CodeQL Action Changelog +## [UNRELEASED] + +No user facing changes. + ## 2.1.10 - 10 May 2022 - Update default CodeQL bundle version to 2.9.5. [#1056](https://github.com/github/codeql-action/pull/1056) diff --git a/package-lock.json b/package-lock.json index 203a1cdeeb..a580b9e537 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "codeql", - "version": "2.1.10", + "version": "2.1.11", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "codeql", - "version": "2.1.10", + "version": "2.1.11", "license": "MIT", "dependencies": { "@actions/artifact": "^1.0.0", diff --git a/package.json b/package.json index 20267c4493..2782c8c3d7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "codeql", - "version": "2.1.10", + "version": "2.1.11", "private": true, "description": "CodeQL action", "scripts": {