File tree Expand file tree Collapse file tree
test/vscode-tests/cli-integration/variant-analysis Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1737,6 +1737,9 @@ export class CliVersionConstraint {
17371737 */
17381738 public static CLI_VERSION_WITH_TRIM_CACHE = new SemVer ( "2.15.1" ) ;
17391739
1740+ public static CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA_IN_QLX =
1741+ new SemVer ( "2.16.1" ) ;
1742+
17401743 constructor ( private readonly cli : CodeQLCliServer ) {
17411744 /**/
17421745 }
@@ -1779,6 +1782,11 @@ export class CliVersionConstraint {
17791782 ) ;
17801783 }
17811784
1785+ async supportsExtensiblePredicateMetadataInQlx ( ) {
1786+ return this . isVersionAtLeast (
1787+ CliVersionConstraint . CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA_IN_QLX ,
1788+ ) ;
1789+ }
17821790 async supportsMrvaPackCreate ( ) : Promise < boolean > {
17831791 return ( await this . cli . getFeatures ( ) ) . mrvaPackCreate === true ;
17841792 }
Original file line number Diff line number Diff line change @@ -275,7 +275,15 @@ describe("Variant Analysis Manager", () => {
275275
276276 const queryToRun =
277277 "Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql" ;
278- const extraQuery = "Telemetry/ExtractorInformation.ql" ;
278+
279+ // We only need to preserve queries with extensible predicates if the CLI doesn't support
280+ // storing the necessary metadata in the compiled QLX.
281+ const needsExtraQueries =
282+ ! cli . cliConstraints . supportsExtensiblePredicateMetadataInQlx ( ) ;
283+
284+ const extraQueries = needsExtraQueries
285+ ? [ "Telemetry/ExtractorInformation.ql" ]
286+ : [ ] ;
279287
280288 await doVariantAnalysisTest ( {
281289 queryPath : join (
@@ -284,7 +292,7 @@ describe("Variant Analysis Manager", () => {
284292 queryToRun ,
285293 ) ,
286294 expectedPackName : "codeql/java-queries" ,
287- filesThatExist : [ queryToRun , extraQuery ] ,
295+ filesThatExist : [ queryToRun , ... extraQueries ] ,
288296 filesThatDoNotExist : [ ] ,
289297 qlxFilesThatExist : [ ] ,
290298 dependenciesToCheck : [ "codeql/java-all" ] ,
You can’t perform that action at this time.
0 commit comments