mirror of
https://github.com/github/codeql-action.git
synced 2025-12-24 08:10:06 +08:00
Remove redundant query help version flag
This commit is contained in:
4
lib/codeql.js
generated
4
lib/codeql.js
generated
@@ -66,7 +66,6 @@ const CODEQL_MINIMUM_VERSION = "2.8.5";
|
|||||||
* For convenience, please keep these in descending order. Once a version
|
* For convenience, please keep these in descending order. Once a version
|
||||||
* flag is older than the oldest supported version above, it may be removed.
|
* flag is older than the oldest supported version above, it may be removed.
|
||||||
*/
|
*/
|
||||||
const CODEQL_VERSION_CUSTOM_QUERY_HELP = "2.7.1";
|
|
||||||
const CODEQL_VERSION_LUA_TRACER_CONFIG = "2.10.0";
|
const CODEQL_VERSION_LUA_TRACER_CONFIG = "2.10.0";
|
||||||
const CODEQL_VERSION_LUA_TRACING_GO_WINDOWS_FIXED = "2.10.4";
|
const CODEQL_VERSION_LUA_TRACING_GO_WINDOWS_FIXED = "2.10.4";
|
||||||
exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = "2.10.4";
|
exports.CODEQL_VERSION_GHES_PACK_DOWNLOAD = "2.10.4";
|
||||||
@@ -438,12 +437,11 @@ async function getCodeQLForCmd(cmd, checkVersion) {
|
|||||||
addSnippetsFlag,
|
addSnippetsFlag,
|
||||||
"--print-diagnostics-summary",
|
"--print-diagnostics-summary",
|
||||||
"--print-metrics-summary",
|
"--print-metrics-summary",
|
||||||
|
"--sarif-add-query-help",
|
||||||
"--sarif-group-rules-by-pack",
|
"--sarif-group-rules-by-pack",
|
||||||
...(await getCodeScanningConfigExportArguments(config, this, features)),
|
...(await getCodeScanningConfigExportArguments(config, this, features)),
|
||||||
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
||||||
];
|
];
|
||||||
if (await util.codeQlVersionAbove(this, CODEQL_VERSION_CUSTOM_QUERY_HELP))
|
|
||||||
codeqlArgs.push("--sarif-add-query-help");
|
|
||||||
if (automationDetailsId !== undefined) {
|
if (automationDetailsId !== undefined) {
|
||||||
codeqlArgs.push("--sarif-category", automationDetailsId);
|
codeqlArgs.push("--sarif-category", automationDetailsId);
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
18
lib/codeql.test.js
generated
18
lib/codeql.test.js
generated
@@ -418,24 +418,6 @@ for (const isBundleVersionInUrl of [true, false]) {
|
|||||||
t.throws(() => codeql.getExtraOptions({ foo: 87 }, ["foo"], []));
|
t.throws(() => codeql.getExtraOptions({ foo: 87 }, ["foo"], []));
|
||||||
t.throws(() => codeql.getExtraOptions({ "*": [42], foo: { "*": 87, bar: [99] } }, ["foo", "bar"], []));
|
t.throws(() => codeql.getExtraOptions({ "*": [42], foo: { "*": 87, bar: [99] } }, ["foo", "bar"], []));
|
||||||
});
|
});
|
||||||
(0, ava_1.default)("databaseInterpretResults() does not set --sarif-add-query-help for 2.7.0", async (t) => {
|
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves("2.7.0");
|
|
||||||
// safeWhich throws because of the test CodeQL object.
|
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
|
||||||
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", stubConfig, (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true));
|
|
||||||
t.false(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"), "--sarif-add-query-help should be absent, but it is present");
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("databaseInterpretResults() sets --sarif-add-query-help for 2.7.1", async (t) => {
|
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves("2.7.1");
|
|
||||||
// safeWhich throws because of the test CodeQL object.
|
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
|
||||||
await codeqlObject.databaseInterpretResults("", [], "", "", "", "-v", "", stubConfig, (0, testing_utils_1.createFeatures)([]), (0, logging_1.getRunnerLogger)(true));
|
|
||||||
t.true(runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"), "--sarif-add-query-help should be present, but it is absent");
|
|
||||||
});
|
|
||||||
(0, ava_1.default)("databaseInitCluster() without injected codescanning config", async (t) => {
|
(0, ava_1.default)("databaseInitCluster() without injected codescanning config", async (t) => {
|
||||||
await util.withTmpDir(async (tempDir) => {
|
await util.withTmpDir(async (tempDir) => {
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -622,54 +622,6 @@ test("getExtraOptions throws for bad content", (t) => {
|
|||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
|
||||||
test("databaseInterpretResults() does not set --sarif-add-query-help for 2.7.0", async (t) => {
|
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves("2.7.0");
|
|
||||||
// safeWhich throws because of the test CodeQL object.
|
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
|
||||||
await codeqlObject.databaseInterpretResults(
|
|
||||||
"",
|
|
||||||
[],
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"-v",
|
|
||||||
"",
|
|
||||||
stubConfig,
|
|
||||||
createFeatures([]),
|
|
||||||
getRunnerLogger(true)
|
|
||||||
);
|
|
||||||
t.false(
|
|
||||||
runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"),
|
|
||||||
"--sarif-add-query-help should be absent, but it is present"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("databaseInterpretResults() sets --sarif-add-query-help for 2.7.1", async (t) => {
|
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
|
||||||
const codeqlObject = await codeql.getCodeQLForTesting();
|
|
||||||
sinon.stub(codeqlObject, "getVersion").resolves("2.7.1");
|
|
||||||
// safeWhich throws because of the test CodeQL object.
|
|
||||||
sinon.stub(safeWhich, "safeWhich").resolves("");
|
|
||||||
await codeqlObject.databaseInterpretResults(
|
|
||||||
"",
|
|
||||||
[],
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"",
|
|
||||||
"-v",
|
|
||||||
"",
|
|
||||||
stubConfig,
|
|
||||||
createFeatures([]),
|
|
||||||
getRunnerLogger(true)
|
|
||||||
);
|
|
||||||
t.true(
|
|
||||||
runnerConstructorStub.firstCall.args[1].includes("--sarif-add-query-help"),
|
|
||||||
"--sarif-add-query-help should be present, but it is absent"
|
|
||||||
);
|
|
||||||
});
|
|
||||||
|
|
||||||
test("databaseInitCluster() without injected codescanning config", async (t) => {
|
test("databaseInitCluster() without injected codescanning config", async (t) => {
|
||||||
await util.withTmpDir(async (tempDir) => {
|
await util.withTmpDir(async (tempDir) => {
|
||||||
const runnerConstructorStub = stubToolRunnerConstructor();
|
const runnerConstructorStub = stubToolRunnerConstructor();
|
||||||
|
|||||||
@@ -259,7 +259,6 @@ const CODEQL_MINIMUM_VERSION = "2.8.5";
|
|||||||
* For convenience, please keep these in descending order. Once a version
|
* For convenience, please keep these in descending order. Once a version
|
||||||
* flag is older than the oldest supported version above, it may be removed.
|
* flag is older than the oldest supported version above, it may be removed.
|
||||||
*/
|
*/
|
||||||
const CODEQL_VERSION_CUSTOM_QUERY_HELP = "2.7.1";
|
|
||||||
const CODEQL_VERSION_LUA_TRACER_CONFIG = "2.10.0";
|
const CODEQL_VERSION_LUA_TRACER_CONFIG = "2.10.0";
|
||||||
const CODEQL_VERSION_LUA_TRACING_GO_WINDOWS_FIXED = "2.10.4";
|
const CODEQL_VERSION_LUA_TRACING_GO_WINDOWS_FIXED = "2.10.4";
|
||||||
export const CODEQL_VERSION_GHES_PACK_DOWNLOAD = "2.10.4";
|
export const CODEQL_VERSION_GHES_PACK_DOWNLOAD = "2.10.4";
|
||||||
@@ -773,12 +772,11 @@ export async function getCodeQLForCmd(
|
|||||||
addSnippetsFlag,
|
addSnippetsFlag,
|
||||||
"--print-diagnostics-summary",
|
"--print-diagnostics-summary",
|
||||||
"--print-metrics-summary",
|
"--print-metrics-summary",
|
||||||
|
"--sarif-add-query-help",
|
||||||
"--sarif-group-rules-by-pack",
|
"--sarif-group-rules-by-pack",
|
||||||
...(await getCodeScanningConfigExportArguments(config, this, features)),
|
...(await getCodeScanningConfigExportArguments(config, this, features)),
|
||||||
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
...getExtraOptionsFromEnv(["database", "interpret-results"]),
|
||||||
];
|
];
|
||||||
if (await util.codeQlVersionAbove(this, CODEQL_VERSION_CUSTOM_QUERY_HELP))
|
|
||||||
codeqlArgs.push("--sarif-add-query-help");
|
|
||||||
if (automationDetailsId !== undefined) {
|
if (automationDetailsId !== undefined) {
|
||||||
codeqlArgs.push("--sarif-category", automationDetailsId);
|
codeqlArgs.push("--sarif-category", automationDetailsId);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user