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() {
17371737}
17381738
17391739export 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+
17401744 /**
17411745 * CLI version where building QLX packs for remote queries is supported.
17421746 * (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 {
2424 activate as archiveFilesystemProvider_activate ,
2525 zipArchiveScheme ,
2626} from "./common/vscode/archive-filesystem-provider" ;
27- import { CodeQLCliServer } from "./codeql-cli/cli" ;
27+ import { CliVersionConstraint , CodeQLCliServer } from "./codeql-cli/cli" ;
2828import {
2929 CliConfigListener ,
3030 DistributionConfigListener ,
@@ -408,6 +408,28 @@ export async function activate(
408408 codeQlExtension . cliServer . addVersionChangedListener ( ( ver ) => {
409409 telemetryListener . cliVersion = ver ;
410410 } ) ;
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+ } ) ;
411433 }
412434
413435 return codeQlExtension ;
You can’t perform that action at this time.
0 commit comments