Fix PR feedback
This commit is contained in:
@@ -1737,8 +1737,9 @@ export class CliVersionConstraint {
|
||||
*/
|
||||
public static CLI_VERSION_WITH_TRIM_CACHE = new SemVer("2.15.1");
|
||||
|
||||
public static CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA_IN_QLX =
|
||||
new SemVer("2.16.1");
|
||||
public static CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK = new SemVer(
|
||||
"2.16.1",
|
||||
);
|
||||
|
||||
constructor(private readonly cli: CodeQLCliServer) {
|
||||
/**/
|
||||
@@ -1782,11 +1783,13 @@ export class CliVersionConstraint {
|
||||
);
|
||||
}
|
||||
|
||||
async supportsExtensiblePredicateMetadataInQlx() {
|
||||
return this.isVersionAtLeast(
|
||||
CliVersionConstraint.CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA_IN_QLX,
|
||||
async preservesExtensiblePredicatesInMrvaPack() {
|
||||
// Negated, because we _stopped_ preserving these in 2.16.1.
|
||||
return !this.isVersionAtLeast(
|
||||
CliVersionConstraint.CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK,
|
||||
);
|
||||
}
|
||||
|
||||
async supportsMrvaPackCreate(): Promise<boolean> {
|
||||
return (await this.cli.getFeatures()).mrvaPackCreate === true;
|
||||
}
|
||||
|
||||
@@ -276,14 +276,12 @@ describe("Variant Analysis Manager", () => {
|
||||
const queryToRun =
|
||||
"Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql";
|
||||
|
||||
// We only need to preserve queries with extensible predicates if the CLI doesn't support
|
||||
// storing the necessary metadata in the compiled QLX.
|
||||
const needsExtraQueries =
|
||||
!(await cli.cliConstraints.supportsExtensiblePredicateMetadataInQlx());
|
||||
|
||||
const extraQueries = needsExtraQueries
|
||||
? ["Telemetry/ExtractorInformation.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"]
|
||||
: [];
|
||||
|
||||
await doVariantAnalysisTest({
|
||||
queryPath: join(
|
||||
|
||||
Reference in New Issue
Block a user