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,10 @@ export class CliVersionConstraint {
17371737 */
17381738 public static CLI_VERSION_WITH_TRIM_CACHE = new SemVer ( "2.15.1" ) ;
17391739
1740+ public static CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK = new SemVer (
1741+ "2.16.1" ,
1742+ ) ;
1743+
17401744 constructor ( private readonly cli : CodeQLCliServer ) {
17411745 /**/
17421746 }
@@ -1779,6 +1783,13 @@ export class CliVersionConstraint {
17791783 ) ;
17801784 }
17811785
1786+ async preservesExtensiblePredicatesInMrvaPack ( ) {
1787+ // Negated, because we _stopped_ preserving these in 2.16.1.
1788+ return ! ( await this . isVersionAtLeast (
1789+ CliVersionConstraint . CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK ,
1790+ ) ) ;
1791+ }
1792+
17821793 async supportsMrvaPackCreate ( ) : Promise < boolean > {
17831794 return ( await this . cli . getFeatures ( ) ) . mrvaPackCreate === true ;
17841795 }
Original file line number Diff line number Diff line change @@ -275,7 +275,13 @@ describe("Variant Analysis Manager", () => {
275275
276276 const queryToRun =
277277 "Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql" ;
278- const extraQuery = "Telemetry/ExtractorInformation.ql" ;
278+
279+ // Recent versions of the CLI don't preserve queries with extensible predicates in MRVA packs,
280+ // because all the necessary info is in the `.packinfo` file.
281+ const extraQueries =
282+ ( await cli . cliConstraints . preservesExtensiblePredicatesInMrvaPack ( ) )
283+ ? [ "Telemetry/ExtractorInformation.ql" ]
284+ : [ ] ;
279285
280286 await doVariantAnalysisTest ( {
281287 queryPath : join (
@@ -284,7 +290,7 @@ describe("Variant Analysis Manager", () => {
284290 queryToRun ,
285291 ) ,
286292 expectedPackName : "codeql/java-queries" ,
287- filesThatExist : [ queryToRun , extraQuery ] ,
293+ filesThatExist : [ queryToRun , ... extraQueries ] ,
288294 filesThatDoNotExist : [ ] ,
289295 qlxFilesThatExist : [ ] ,
290296 dependenciesToCheck : [ "codeql/java-all" ] ,
You can’t perform that action at this time.
0 commit comments