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,8 +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" ) ;
1740+ public static CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK = new SemVer (
1741+ "2.16.1" ,
1742+ ) ;
17421743
17431744 constructor ( private readonly cli : CodeQLCliServer ) {
17441745 /**/
@@ -1782,11 +1783,13 @@ export class CliVersionConstraint {
17821783 ) ;
17831784 }
17841785
1785- async supportsExtensiblePredicateMetadataInQlx ( ) {
1786- return this . isVersionAtLeast (
1787- CliVersionConstraint . CLI_VERSION_WITH_EXTENSIBLE_PREDICATE_METADATA_IN_QLX ,
1786+ async preservesExtensiblePredicatesInMrvaPack ( ) {
1787+ // Negated, because we _stopped_ preserving these in 2.16.1.
1788+ return ! this . isVersionAtLeast (
1789+ CliVersionConstraint . CLI_VERSION_WITHOUT_MRVA_EXTENSIBLE_PREDICATE_HACK ,
17881790 ) ;
17891791 }
1792+
17901793 async supportsMrvaPackCreate ( ) : Promise < boolean > {
17911794 return ( await this . cli . getFeatures ( ) ) . mrvaPackCreate === true ;
17921795 }
Original file line number Diff line number Diff line change @@ -276,14 +276,12 @@ describe("Variant Analysis Manager", () => {
276276 const queryToRun =
277277 "Security/CWE/CWE-020/ExternalAPIsUsedWithUntrustedData.ql" ;
278278
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- ! ( await cli . cliConstraints . supportsExtensiblePredicateMetadataInQlx ( ) ) ;
283-
284- const extraQueries = needsExtraQueries
285- ? [ "Telemetry/ExtractorInformation.ql" ]
286- : [ ] ;
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+ : [ ] ;
287285
288286 await doVariantAnalysisTest ( {
289287 queryPath : join (
You can’t perform that action at this time.
0 commit comments