File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -1737,6 +1737,10 @@ export function shouldDebugCliServer() {
1737
1737
}
1738
1738
1739
1739
export class CliVersionConstraint {
1740
+ // The oldest version of the CLI that we support. This is used to determine
1741
+ // whether to show a warning about the CLI being too old on startup.
1742
+ public static OLDEST_SUPPORTED_CLI_VERSION = new SemVer ( "2.7.6" ) ;
1743
+
1740
1744
/**
1741
1745
* CLI version where building QLX packs for remote queries is supported.
1742
1746
* (The options were _accepted_ by a few earlier versions, but only from
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ import {
24
24
activate as archiveFilesystemProvider_activate ,
25
25
zipArchiveScheme ,
26
26
} from "./common/vscode/archive-filesystem-provider" ;
27
- import { CodeQLCliServer } from "./codeql-cli/cli" ;
27
+ import { CliVersionConstraint , CodeQLCliServer } from "./codeql-cli/cli" ;
28
28
import {
29
29
CliConfigListener ,
30
30
DistributionConfigListener ,
@@ -408,6 +408,28 @@ export async function activate(
408
408
codeQlExtension . cliServer . addVersionChangedListener ( ( ver ) => {
409
409
telemetryListener . cliVersion = ver ;
410
410
} ) ;
411
+
412
+ let unsupportedWarningShown = false ;
413
+ codeQlExtension . cliServer . addVersionChangedListener ( ( ver ) => {
414
+ if ( ! ver ) {
415
+ return ;
416
+ }
417
+
418
+ if ( unsupportedWarningShown ) {
419
+ return ;
420
+ }
421
+
422
+ if ( CliVersionConstraint . OLDEST_SUPPORTED_CLI_VERSION . compare ( ver ) < 0 ) {
423
+ return ;
424
+ }
425
+
426
+ void showAndLogWarningMessage (
427
+ `You are using an unsupported version of the CodeQL CLI (${ ver } ). ` +
428
+ `The minimum supported version is ${ CliVersionConstraint . OLDEST_SUPPORTED_CLI_VERSION } . ` +
429
+ `Please upgrade to the latest version of the CodeQL CLI.` ,
430
+ ) ;
431
+ unsupportedWarningShown = true ;
432
+ } ) ;
411
433
}
412
434
413
435
return codeQlExtension ;
You can’t perform that action at this time.
0 commit comments