-
Notifications
You must be signed in to change notification settings - Fork 190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove support for CodeQL CLI versions older than v2.16.6 #3728
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,5 @@ | |
"v2.18.4", | ||
"v2.17.6", | ||
"v2.16.6", | ||
"v2.15.5", | ||
"nightly" | ||
] |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -15,7 +15,6 @@ import { isAbsolute, join } from "path"; | |||||
|
||||||
import { VariantAnalysisManager } from "../../../../src/variant-analysis/variant-analysis-manager"; | ||||||
import type { CodeQLCliServer } from "../../../../src/codeql-cli/cli"; | ||||||
import { CliVersionConstraint } from "../../../../src/codeql-cli/cli"; | ||||||
import { getActivatedExtension, storagePath } from "../../global.helper"; | ||||||
import { VariantAnalysisResultsManager } from "../../../../src/variant-analysis/variant-analysis-results-manager"; | ||||||
import type { VariantAnalysisSubmission } from "../../../../src/variant-analysis/shared/variant-analysis"; | ||||||
|
@@ -347,13 +346,6 @@ describe("Variant Analysis Manager", () => { | |||||
const queryToRun = | ||||||
"Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql"; | ||||||
|
||||||
// Recent versions of the CLI don't preserve queries with extensible predicates in MRVA packs, | ||||||
// because all the necessary info is in the `.packinfo` file. | ||||||
const extraQueries = | ||||||
(await cli.cliConstraints.preservesExtensiblePredicatesInMrvaPack()) | ||||||
? ["Telemetry/ExtractorInformation.ql"] | ||||||
: []; | ||||||
|
||||||
const qlPackRootPath = join(process.env.TEST_CODEQL_PATH, "java/ql/src"); | ||||||
const queryPath = join(qlPackRootPath, queryToRun); | ||||||
const qlPackFilePath = join(qlPackRootPath, "qlpack.yml"); | ||||||
|
@@ -362,7 +354,7 @@ describe("Variant Analysis Manager", () => { | |||||
qlPackRootPath, | ||||||
qlPackFilePath, | ||||||
expectedPackName: "codeql/java-queries", | ||||||
filesThatExist: [queryToRun, ...extraQueries], | ||||||
filesThatExist: [queryToRun, ...["Telemetry/ExtractorInformation.ql"]], | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
We actually don't want to check for this file anymore.
The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🤦♀️ thank's for spotting that! |
||||||
filesThatDoNotExist: [], | ||||||
qlxFilesThatExist: [], | ||||||
dependenciesToCheck: ["codeql/java-all"], | ||||||
|
@@ -372,13 +364,6 @@ describe("Variant Analysis Manager", () => { | |||||
}); | ||||||
|
||||||
it("should run multiple queries that are part of the same pack", async () => { | ||||||
if (!(await cli.cliConstraints.supportsPackCreateWithMultipleQueries())) { | ||||||
console.log( | ||||||
`Skipping test because MRVA with multiple queries is only suppported in CLI version ${CliVersionConstraint.CLI_VERSION_WITH_MULTI_QUERY_PACK_CREATE} or later.`, | ||||||
); | ||||||
return; | ||||||
} | ||||||
|
||||||
await doVariantAnalysisTest({ | ||||||
queryPaths: [ | ||||||
"data-qlpack-multiple-queries/query1.ql", | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit confused about the version number syntax. We use version numbers with
v
in thesupported_cli_versions.json
, but here we have historically used nov
. In the code I removed we usedSemVer("2.16.1")
, so without thev
. Which one is correct?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://www.npmjs.com/package/semver says "A leading "=" or "v" character is stripped off and ignored." so either is fine. Personally I'd go with no "v" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To explain more...
From a behaviour point of view I don't think it makes any difference. From a code readability point of view it makes sense to remove unnecessary boilerplate. From a consistency point of view I suppose you might want them to match the json file, but I think any human who reads them would easily correlate the numbers and not get confused.